Chapter 8 · Window Functions
15. Running Total of Daily Revenue
Hard40 XPE-Commerce
The finance team needs a running total of daily revenue. First compute total revenue per day, then calculate a cumulative running total across days. Return the order_date, daily revenue, and running total, sorted 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.