Chapter 4 · Aggregations
22. Average Account Balance by Status
Easy10 XPFinance
Management wants to compare average account balances across account statuses (active, closed, frozen). Return the status, the count of accounts, and the average balance rounded to two decimal places. Sort by average balance descending.
Tables
- PKidINT
- FKcustomer_id→ customers.idINT
- account_typeTEXT
- balanceREAL
- currencyTEXT
- opened_atTEXT
- 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.