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.
Schema
🔑idINT
🔗account_idINT
transaction_dateTEXT
typeTEXT
amountREAL
balance_afterREAL
descriptionTEXT
reference_numberTEXT
postgresql
Run your query to see results
Press Ctrl + Enter to execute