Loading...
Price Pairs
A hard SQL interview practice problem on DataDriven. Write and execute real sql code with instant grading.
- Domain
- SQL
- Difficulty
- hard
Problem
The pricing analyst wants to flag wide price gaps inside a single category. Find every pair of products in the same category where one product costs at least twice as much as the other, and list each pair exactly once. Return both product_name values, the shared category, and both prices.
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.