Second Purchase
A hard SQL interview practice problem on DataDriven. Write and execute real sql code with instant grading.
- Domain
- SQL
- Difficulty
- hard
- Seniority
- L5
Problem
The onboarding team wants to study second-purchase behavior. For each user with more than one transaction, order their transactions by transaction_date and isolate the second one. Return the user_id, total_amount, and transaction_date of that second purchase.
Summary
The first buy is curiosity. The second is commitment.
Practice This Problem
Solve this SQL problem with real code execution. DataDriven runs your SQL queries against a real database and grades it automatically.