Great! You can use this technique to filter rows with no matching rows.
Suppose we want to get a list of lecturers that still do not have any course assigned:
LEFT JOIN Course
ON Course.LecturerId = Lecturer.Id
WHERE LecturerId IS NULL
Notice that we added
WHERE LecturerId IS NULL line.
First, our database
LEFT JOINs the table. Then, we simply inform the database that we'd like to select only those rows where for which the value of
LecturerId IS NULL (i.e. there is no matching course for a given lecturer). Note that the
LecturerId is a column in the right table,
Course. This value will be missing if there is no matching course.