Chapter 18mChallenge

SQL Introduction — Challenge

Query language for databases.

This content is not yet available in ne. Showing English version.

View in English →

Products per Category

medium

Products per Category

Write a query that shows each product category and the number of products in it (COUNT(*)), aliased as n.

Expected Result

categoryn
Accessories2
Electronics4
Stationery2
Test cases (1)
1 · returns 3 categories with counts
expected: category | n ------------+--- Accessories | 2 Electronics | 4 Stationery | 2
sqlSQLite · 3 tables
Loading editor...