← 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:

  • Small when basket_value is below 1000
  • Medium when it is at least 1000 but below 5000
  • Large when it is 5000 or more

Sample data

Table: basket_summary

12 row(s) · showing first 8

basket_idINTcustomer_codeTEXTitem_countINTbasket_valueNUMERIC(10,2)
9001CU-1182640.00
9002CU-22451899.50
9003CU-3171999.99
9004CU-402117420.00
9005CU-11831000.00
9006CU-55684999.95
9007CU-6631412500.00
9008CU-2241249.00

Practising alone only goes so far — our live cohorts pair SQL depth with dashboards, agentic analytics projects and mock interviews.

Explore the program