Products with Continuously Growing Revenue
Problem
**[Asked at Deloitte]**
The sales team wants to identify products whose annual revenue has
**never decreased** year-over-year — i.e., every year is strictly
higher than the previous year.
Return `product_id` and `product_name` for qualifying products,
ordered by product_id.
Tables
Example rows — the live problem includes the full dataset.
products
| product_id | product_name | category |
|---|
sales
| product_id | year | total_revenue |
|---|
Expected output
Your answer should return 1 row with the columns product_id, product_name.
Starter code (SQL)
SELECT *
FROM products;Solve this SQL question free
Write SQL and run it instantly in your browser — even on your phone. No signup needed to try.
Solution & explanation
Create a free account to unlock the optimal solution, a step-by-step explanation, and the hidden test cases that grade your answer.
Sign up free to unlock