Chapter 8 · Window Functions
08. Cumulative Loan Disbursements by Month
Medium20 XPFinance
The finance team wants a monthly view of loan disbursements with a running total. For each month (YYYY-MM from start_date), return the month, the count of new loans, total principal disbursed that month, and a cumulative principal total. Sort by month.
Tables
- PKidINT
- FKcustomer_id→ customers.idINT
- loan_typeTEXT
- principalREAL
- interest_rateREAL
- term_monthsINT
- start_dateTEXT
- 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.