Rank all transactions by amount within their account's type using DENSE_RANK. Join transactions to accounts. Return account_type, transaction id, amount, and the dense_rank. Only include the top 5 ranked transactions per account type. Sort by account_type, then rank.
Schema
🔑idINT
🔗customer_idINT
account_typeTEXT
balanceREAL
currencyTEXT
opened_atTEXT
statusTEXT
postgresql
Run your query to see results
Press Ctrl + Enter to execute