Chapter 4 · Aggregations
24. Total Deposits Per Account
Easy10 XPFinance
The finance team wants to know how much money has been deposited into each account. Write a query that returns the account_id and the total deposit amount for each account. Only include deposit transactions. Order by total deposits descending.
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.