Created
October 2, 2024 20:46
-
-
Save acstrahl/383438bfb27ab6db7f14c607e6dc32a1 to your computer and use it in GitHub Desktop.
Dataquest Customers and Products Analysis Using SQL Project
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Customers and Products Analysis Project | |
-- First, let's look at the count of rows and columns for each table in the database: | |
SELECT 'Customers' AS table_name, | |
13 AS number_of_attribute, | |
COUNT(*) AS number_of_row | |
FROM Customers | |
UNION ALL | |
SELECT 'Products' AS table_name, | |
9 AS number_of_attribute, | |
COUNT(*) AS number_of_row | |
FROM Products | |
UNION ALL | |
SELECT 'ProductLines' AS table_name, | |
4 AS number_of_attribute, | |
COUNT(*) AS number_of_row | |
FROM ProductLines | |
UNION ALL | |
SELECT 'Orders' AS table_name, | |
7 AS number_of_attribute, | |
COUNT(*) AS number_of_row | |
FROM Orders | |
UNION ALL | |
SELECT 'OrderDetails' AS table_name, | |
5 AS number_of_attribute, | |
COUNT(*) AS number_of_row | |
FROM OrderDetails | |
UNION ALL | |
SELECT 'Payments' AS table_name, | |
4 AS number_of_attribute, | |
COUNT(*) AS number_of_row | |
FROM Payments | |
UNION ALL | |
SELECT 'Employees' AS table_name, | |
8 AS number_of_attribute, | |
COUNT(*) AS number_of_row | |
FROM Employees | |
UNION ALL | |
SELECT 'Offices' AS table_name, | |
9 AS number_of_attribute, | |
COUNT(*) AS number_of_row | |
FROM Offices; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment