Chapter 6 · Subqueries
17. Largest Transaction Per Account
Medium20 XPFinance
For each account, find the single largest transaction by amount. Return account_id, transaction_date, type, and amount for each account's maximum transaction. Sort by amount 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.