Chapter 8 · Window Functions
04. Running Total of Payments
Medium20 XPE-Commerce
Create a running total of completed payments over time. For each completed payment, show the payment_date, amount, and a cumulative sum of amounts ordered by payment_date (payments on the same date are added in payment id order). Sort by payment_date.
Tables
- PKidINT
- FKorder_id→ orders.idINT
- payment_dateTEXT
- amountREAL
- methodTEXT
- statusTEXT
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.