NULL
A LEFT JOIN keeps every row from the first table even when nothing matches on the second. Where nothing matches, SQL doesn't leave the cell blank or put in a zero: it fills it with NULL, SQL's word for “nothing recorded here.”
Query
SELECT st.name, s.section
FROM staff st
LEFT JOIN stations s ON st.name = s.lead;↓ result
st.name s.section
Giorgos hot
Yannick cold
Sofia cold
Dan hot
Konstantinos NULL
Eleni NULL
Marina NULLYou can't filter for NULL with = NULL: to SQL, nothing ever “equals” nothing, so that comparison silently matches zero rows. Use IS NULL instead, or IS NOT NULL for the opposite.
Query
SELECT st.name
FROM staff st
LEFT JOIN stations s ON st.name = s.lead
WHERE s.section IS NULL;↓ result
st.name
Konstantinos
Eleni
MarinaNULL printed on a real docket looks like a bug, not an answer. COALESCE swaps it for a fallback value you choose, and leaves anything that isn't NULL exactly as it was.
Query
SELECT st.name, COALESCE(s.section, 'Not assigned') AS section
FROM staff st
LEFT JOIN stations s ON st.name = s.lead
ORDER BY st.name;↓ result
st.name section
Dan hot
Eleni Not assigned
Giorgos hot
Konstantinos Not assigned
Marina Not assigned
Sofia cold
Yannick coldOne more habit worth knowing: COUNT(*) counts every row, but COUNT(some_column) only counts the rows where that column isn't NULL. Here that difference is the whole answer: 4 staff are assigned to a station, and 3 aren't, all from one join.