SQL QuestSQL Interview Questions › Conditional Logic

Tool Wear Stress Tier

EasyFreeQuerying BasicsConditional Logic

Categorize each product by wear_tier: 'Worn-Out' if tool_wear_min >= 200, 'Aging' if >= 150, 'Used' if >= 50, 'Fresh' if < 50. Show product_id, type, tool_wear_min, wear_tier. Order by tool_wear_min descending. Top 30.

Solve it in the browser editor →

Runs on SQLite in your browser, graded against the expected result, no signup. A wrong answer gets a diagnosis, not just "incorrect".

Schema

products

udiproduct_idtypetool_wear_min
5640L52819L180
2171M17030M10
228L47407L168

Expected output: Each product labeled by wear tier

Hint

CASE WHEN tool_wear_min >= 200 ... order matters; check from largest threshold first.

Concepts

SELECT CASE ORDER BY

Practise the topic: SQL practice questions · CASE WHEN practice

In these company practice sets

Tesla

A SQL Quest challenge matched to patterns reported for these companies — not a question any of them has published.

Related questions

Calculated ColumnsEasy · FreeComp Tier LabelsEasy · FreeMembership Display LabelsEasy · FreeRounded Revenue: Top 10 from 2015+Easy · FreeAsset Tier ClassificationEasy · FreeBuilding Age TierEasy · Free

Where would this cost you points in an interview?

Ten questions, no signup: a Skillmap across nine SQL skills and the one to fix first.

Take the readiness test