Skip to main content
All Problems
medium0% acceptance

Highest Single Transaction per Customer

For each customer, find their single largest transaction amount. Use a correlated subquery to get the max transaction amount per customer. Return first_name, last_name, and max_transaction. Only include customers with at least one transaction. Sort by max_transaction descending. Limit to 20.

Schema

🔑idINT
first_nameTEXT
last_nameTEXT
emailTEXT
phoneTEXTNULL
date_of_birthTEXT
cityTEXT
stateTEXT
countryTEXT
created_atTIMESTAMP
postgresql

Run your query to see results

Press Ctrl + Enter to execute