Previous Day Top Service
A hard SQL interview practice problem on DataDriven. Write and execute real sql code with instant grading.
- Domain
- SQL
- Difficulty
- hard
- Seniority
- L4
Problem
Build a daily revenue dashboard widget that shows each date's top-spending service from the previous day. Round totals to 2 decimal places before comparing. If multiple services tie for the top spot, show all. Only include dates where prior-day data exists. Return the billing day, service name, and total amount.
Summary
Yesterday's top spender.
Practice This Problem
Solve this SQL problem with real code execution. DataDriven runs your SQL queries against a real database and grades it automatically.