Grokking the Data Engineering Interview
0% completed
Slowly Changing Dimensions
A bakery chain's finance team runs one query at the end of each reporting period: sales per region for days 1 to 40. On day 40 it returned these totals:
SELECT st.region, SUM(s.sales_cents) AS sales_cents FROM daily_sales s JOIN stores st ON st.store_code = s.store_code WHERE s.day_no BETWEEN 1 AND 40 GROUP BY st.region ORDER BY st.region;
Output:
+--------+-------------+ | region | sales_cents | +--------+-------------+ | East | 58000 | | North | 138000 | +--------+-------------+
.....
.....
.....
Like the course? Get enrolled and start learning!
Reading Progress
0%