Chapter 18mChallenge
SQL Introduction — Challenge
Query language for databases.
This content is not yet available in gu. Showing English version.
View in English →Products per Category
mediumProducts per Category
Write a query that shows each product category and the number of products in it (COUNT(*)), aliased as n.
Expected Result
| category | n |
|---|---|
| Accessories | 2 |
| Electronics | 4 |
| Stationery | 2 |
Test cases (1)
1 · returns 3 categories with counts
expected: category | n
------------+---
Accessories | 2
Electronics | 4
Stationery | 2
sqlSQLite · 3 tables
Loading editor...