Loading...

Multi-Category Buyers

A hard SQL interview practice problem on DataDriven. Write and execute real sql code with instant grading.

Domain
SQL
Difficulty
hard

Problem

The recommendations team is building a cross-category shopper segment. Ignoring products with no category on file, find users whose purchases span more than one product category. Return each qualifying username and how many categories they've bought from.

Practice This Problem

Solve this SQL problem with real code execution. DataDriven runs your SQL queries against a live PostgreSQL database and grades it instantly.