Across the Aisles
A hard SQL interview practice problem on DataDriven. Write and execute real sql code with instant grading.
- Domain
- SQL
- Difficulty
- hard
- Seniority
- L4
Problem
The recommendations team is building a cross-category shopper segment. Find the users whose purchases span more than one product category, ignoring any purchase whose product has no category on file. Return each qualifying user with the number of categories they've bought from, most categories first.
Summary
The best customers never stay in one aisle.
Practice This Problem
Solve this SQL problem with real code execution. DataDriven runs your SQL queries against a real database and grades it automatically.