Kings of the Calendar
A hard SQL interview practice problem on DataDriven. Write and execute real sql code with instant grading.
- Domain
- SQL
- Difficulty
- hard
- Seniority
- L4
Problem
We publish a monthly leaderboard of the best-selling products for an online marketplace, where selling is measured by total units sold in each calendar month. For every month, return the top 10 products with their total units sold and standing, counting only completed sales by dropping any transaction with a negative `total_amount` (those are refunds), with the oldest month first.
Summary
Every month has a winner.
Practice This Problem
Solve this SQL problem with real code execution. DataDriven runs your SQL queries against a real database and grades it automatically.