Chapter 6 · Subqueries
29. Accounts with Above-Average Transaction Volume
Medium20 XPFinance
Find accounts whose total number of transactions exceeds the average transaction count across all accounts. Return account_id and txn_count. Use a subquery or HAVING to compare against the overall average. Order by txn_count 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.