Chapter 4 · Aggregations
27. Total Fees Charged Per Account
Easy10 XPFinance
The billing team wants to see total fees charged to each account. Return account_id and total_fees for accounts that have at least one fee transaction. Only consider transactions where type is 'fee'. Order by total_fees 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.