Skip to main content
All Problems
medium0% acceptance

Each Customer's Most Recent Order Amount

For each customer, find the total_amount of their most recent order. Use a correlated subquery to match each customer to their latest order. Return customer_id, order_date, and total_amount.

Schema

🔑idINT
🔗customer_idINT
order_dateTEXT
statusTEXT
total_amountREAL
postgresql

Run your query to see results

Press Ctrl + Enter to execute