SQL QuestSQL Interview Questions › Aggregation & Grouping

Quality Grade Distribution

EasyFreeQuerying BasicsAggregation & Grouping

How many products are in each quality grade (L=low, M=medium, H=high)? Show type, product_count. Order by product_count descending.

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: Per-grade product counts

Hint

GROUP BY type with COUNT(*).

Concepts

SELECT GROUP BY Aggregation

Practise the topic: SQL practice questions · GROUP BY exercises

Related questions

Counting RowsEasy · FreeSUM, AVG, MIN, MAXEasy · FreeGROUP BY BasicsEasy · FreeMonthly Order CountEasy · FreeHow Many Genres Do We Cover? (DISTINCT)Easy · FreeFemale Survivor CountEasy · 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