Latest Order Per Customer Using Join and Subquery
Hard
joins
Amazon
Stripe
Airbnb
For each customer, return their name and most recent order date. Use a subquery to find the max order date per customer, then join back to get the full row.
Expected Output
| customer_name | order_date |
|---|---|
| Alice | 2024-03-15 |
| Bob | 2024-02-20 |
| Carol | 2024-01-10 |
Tables
Hints (3 available)
SQL Editor
Output
Click "Run" to see results...