Task 7 OUTER JOINs Flashcards
1
Q
Find the list of all buildings that have employees
A
SELECT DISTINCT building FROM employees;
2
Q
Find the list of all buildings and their capacity
A
SELECT * FROM buildings;
3
Q
List all buildings and the distinct employee roles in each building (including empty buildings)
A
SELECT DISTINCT building_name, role
FROM buildings
LEFT JOIN employees
ON building_name = building;