← All SQL interview questions
Label each basket as Small, Medium or Large
EasyCASE StatementsMyntraMeesho
A merchandising team buckets shopping baskets by spend so it can size up its packaging inventory.
For every row in basket_summary, return basket_id, basket_value and a derived column named size_label:
Smallwhenbasket_valueis below 1000Mediumwhen it is at least 1000 but below 5000Largewhen it is 5000 or more
Sample data
More CASE Statements questions
Practising alone only goes so far — our live cohorts pair SQL depth with dashboards, agentic analytics projects and mock interviews.
Explore the program