Keep SQLtest alive: Help cover this month's $100 server costs to keep all lessons and the SQL playground online. Support the project →
SQL code copied to buffer
Task 139:

Room Types in Every Building

MariaDB
Facilities management plans the timetable and needs a full picture of the rooms. For every building and every room type in the rooms table, count the rooms of that type in the building. A building–type pair without rooms must be shown with 0.
Output columns:
- building
- room_type
- rooms - the number of rooms

Sort the result by building, then by room_type.
Expected result Columns: 3 · Rows: 35
building room_type rooms

Sample rows open after wrong checks: 0 of 2

Write your query below and click "Check it!". Tables are described in the right pane.

Tutorial
The query result will appear here. Ctrl+Enter - Run query