-
Notifications
You must be signed in to change notification settings - Fork 0
/
queries.sql
27 lines (23 loc) · 839 Bytes
/
queries.sql
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
SELECT SUM(f.GEWINN)
FROM northwind_dwh.verkauf_fact f
JOIN northwind_dwh.kunde_dim k
ON f.KUNDE_ID_DIM = k.KUNDE_ID_DIM
WHERE k.COMPANY = "Company A";
SELECT SUM(f.GEWINN)
FROM northwind_dwh.verkauf_fact f
JOIN northwind_dwh.kunde_dim k
ON f.KUNDE_ID_DIM = k.KUNDE_ID_DIM
JOIN northwind_dwh.produkt_dim p
ON f.PRODUKT_ID_DIM = p.PRODUKT_ID_DIM
WHERE k.COMPANY = "Company A" AND
p.PRODUKT_NAME = "Northwind Traders Coffee";
SELECT ORDER_MONTH, r.STATE_PROVINCE, f.BRUTTO_ERLOES
FROM northwind_dwh.verkauf_fact f
JOIN northwind_dwh.region_dim r
ON f.REGION_ID_DIM = r.REGION_ID_DIM
JOIN northwind_dwh.produkt_dim p
ON f.PRODUKT_ID_DIM = p.PRODUKT_ID_DIM
JOIN northwind_dwh.zeit_dim t
ON f.ZEIT_ID_DIM = t.ZEIT_ID_DIM
WHERE p.PRODUKT_NAME = "Northwind Traders Chocolate" AND r.STATE_PROVINCE = "OR"
GROUP BY t.ORDER_MONTH;