The Last Checkout
A medium SQL interview practice problem on DataDriven. Write and execute real sql code with instant grading.
- Domain
- SQL
- Difficulty
- medium
- Seniority
- L4
Problem
The retention team wants to understand every user's most recent checkout. For each user in `transactions`, find the most recent date they made a purchase and how many purchase rows they had on that date (a user can show up multiple times on the same date if they bought several items). Return the date, the user id, and the count, sorted from oldest last-purchase date to newest.
Summary
Their last visit. Everything in the bag.
Practice This Problem
Solve this SQL problem with real code execution. DataDriven runs your SQL queries against a real database and grades it automatically.