Task 7 OUTER JOINs Flashcards

1
Q

Find the list of all buildings that have employees

A

SELECT DISTINCT building FROM employees;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Find the list of all buildings and their capacity

A

SELECT * FROM buildings;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly