Chapter 9 · Interview Level
03. Classify Orders by Size
Easy10 XPE-Commerce
The analytics team wants to segment orders by value. Write a query that returns the order id, total_amount, and a new column called order_size that labels orders as 'Small' (under 50), 'Medium' (50 to 200 inclusive), or 'Large' (over 200).
Tables
- PKidINT
- FKcustomer_id→ customers.idINT
- order_dateTEXT
- statusTEXT
- total_amountREAL
Need help?
Ask Sol
AI tutor — looks at your current query and nudges you, without spoiling the answer.
Solution
Try the hints first — solving it yourself is what makes it stick.