The Lion's Share
A medium SQL interview practice problem on DataDriven. Write and execute real sql code with instant grading.
- Domain
- SQL
- Difficulty
- medium
- Seniority
- mid
Problem
The merchandising finance team suspects our revenue is far more concentrated than the catalog's breadth suggests: a handful of product categories may be quietly carrying the whole business while the rest contribute noise. To make the next planning cycle's investment case, they want a clear picture of how purchase revenue is distributed across product categories. For each category, show how much total purchase revenue it brought in, how many purchases it took to get there, and what portion of the company's overall revenue that category represents, presented from the biggest earner down to the smallest so the concentration is obvious at a glance.
Summary
Every category claims its slice. Find out who really owns the table.
Practice This Problem
Solve this SQL problem with real code execution. DataDriven runs your SQL queries against a real database and grades it automatically.