Chapter 8 · Window Functions
20. Running Total of Daily Order Revenue
Hard40 XPE-Commerce
Produce a daily revenue report with a running total. For each order_date, show the date, the daily revenue (sum of total_amount), and the cumulative running total across all dates. Sort by order_date.
Tables
- PKidINT
- FKcustomer_id→ customers.idINT
- order_dateTEXT
- statusTEXT
- total_amountREAL
Need help?
Ask Sol
AI tutor — looks at your current query and nudges you, without spoiling the answer.
Solution
Try the hints first — solving it yourself is what makes it stick.