Count Workshops per Room and Track
Problem
Table: `workshops`
| Column Name | Type |
|---|---|
| workshop_id | int |
| room | enum |
| track | enum |
`workshop_id` is the primary key. `room` is one of `('North', 'South', 'East')`. `track` is one of `('Design', 'Coding', 'Data')`.
Report how many workshops ran for every combination of room and track. You must include all nine `(room, track)` combinations even when no workshop used that combination, reporting a count of `0`. Return columns `room`, `track`, and `num_workshops` in any order.
Tables
Example rows — the live problem includes the full dataset.
| workshop_id | room | track |
|---|---|---|
| 1 | North | Design |
| 2 | North | Design |
| 3 | South | Coding |
Expected output
Your answer should return 9 rows with the columns room, track, num_workshops.
Starter code (SQL)
SELECT *
FROM workshops;Solve this SQL question free
Write SQL and run it instantly in your browser — even on your phone. No signup needed to try.
Solution & explanation
Create a free account to unlock the optimal solution, a step-by-step explanation, and the hidden test cases that grade your answer.
Sign up free to unlock