-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathproject.sql
More file actions
64 lines (36 loc) · 1.3 KB
/
Copy pathproject.sql
File metadata and controls
64 lines (36 loc) · 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/*
This project contains 8 tables:
Customers: customer data
Employees: all employee information
Offices: sales office information
Orders: customers' sales orders
OrderDetails: sales order line for each sales order
Payments: customers' payment records
Products: a list of scale model cars
ProductLines: a list of product line categories
*/
---- Query 1 ----
SELECT 'customers' as table_name, 13 as number_of_attributes, count(*) as number_of_rows
FROM customers
UNION ALL
SELECT 'products' as table_name, 9 as number_of_attributes, count(*) as number_of_rows
FROM products
UNION ALL
SELECT 'productlines' as table_name, 4 as number_of_attributes, count(*) as number_of_rows
FROM productlines
UNION ALL
SELECT 'orders' as table_name, 7 as number_of_attributes, count(*) as number_of_rows
FROM orders
UNION ALL
SELECT 'orderdetails' as table_name, 5 as number_of_attributes, count(*) as number_of_rows
FROM orderdetails
UNION ALL
SELECT 'payments' as table_name, 4 as number_of_attributes, count(*) as number_of_rows
FROM payments
UNION ALL
SELECT 'employees' as table_name, 8 as number_of_attributes, count(*) as number_of_rows
FROM employees
UNION ALL
SELECT 'offices' as table_name, 9 as number_of_attributes, count(*) as number_of_rows
FROM offices
------------------------