SQL QuestSQL Interview Questions › Subqueries & CTEs

Above-Average Tool Wear

MediumFreeQuerying BasicsSubqueries & CTEs

Find products whose tool_wear_min is above the dataset average. Use a scalar subquery for the average. Show product_id, type, tool_wear_min. Order by tool_wear_min descending. Top 20.

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: More-worn tools than typical

Hint

WHERE tool_wear_min > (SELECT AVG(tool_wear_min) FROM products).

Concepts

SELECT WHERE Subquery

Practise the topic: SQL practice questions · CTE 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

Department Roster with GROUP_CONCATMedium · FreeConsistent Director AnalysisMedium · FreeBelow Department AverageMedium · FreeHighest Total Salary Budget DepartmentMedium · FreeFare Imputation AnalysisMedium · FreeUNION ALL Dedup: Cross-Dataset SearchMedium · 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