TASK 8 A short note on NULLs Flashcards
1
Q
Find the name and role of all employees who have not been assigned to a building
A
SELECT name, role FROM employees
WHERE building IS NULL;
2
Q
Find the names of the buildings that hold no employees
A
SELECT DISTINCT building_name
FROM buildings
LEFT JOIN employees
ON building_name = building
WHERE role IS NULL;