Loading...
Profit Tiers
A medium SQL interview practice problem on DataDriven. Write and execute real sql code with instant grading.
- Domain
- SQL
- Difficulty
- medium
Problem
The CFO wants orders bucketed by profitability for the operating review. Label each order in orders as 'high' when profit exceeds 100, 'moderate' when profit is between 0 and 100 inclusive, and 'negative' when profit is below 0, then count orders per tier. Return the tier label and its order count.
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.