Chapter 8 · Window Functions
26. Running Transaction Total Per Account
Hard40 XPFinance
The audit team needs a running total of transaction amounts for each account, ordered by transaction date. Return account_id, transaction_date, amount, and running_total. Limit to account_id = 151 for readability. Sort by transaction_date.
Tables
- PKidINT
- FKaccount_id→ accounts.idINT
- transaction_dateTEXT
- typeTEXT
- amountREAL
- balance_afterREAL
- descriptionTEXT
- reference_numberTEXT
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.