Chapter 8 · Window Functions
07. Cumulative Monthly Revenue
Medium20 XPE-Commerce
Show monthly revenue and a cumulative running total. For each month (YYYY-MM), display the monthly revenue from delivered orders and the cumulative revenue up to and including that month. Round to 2 decimal places. Sort chronologically.
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.