Asked about The queries you will actually be asked to write
Why can NOT IN return nothing?
An answer that works
If the subquery contains a NULL, the comparison with that NULL is unknown for every row, so no row satisfies NOT IN. NOT EXISTS does not have this problem.
Reading an answer is not being able to give one. The section that teaches this is The queries you will actually be asked to write, 5 hours of SQL & data access.
Learn this properlyAlso asked about SQL & data access
What is the difference between WHERE and HAVING?When do you use a LEFT JOIN?A query is slow. How do you diagnose it?What is a window function for?Write a query for each user's most recent order.What is the difference between COUNT(*) and COUNT(column)?A client retries a request after a timeout. How do you make sure it is not processed twice?What is a race condition in a read-modify-write, and how do you prevent it?