Interview › IN vs EXISTS

SQL interview: IN vs EXISTS vs JOIN

A subquery that can return NULL makes NOT IN return no rows. EXISTS does not have that mood.

Prompt. Customers who have at least one shipped order.

Hint: WHERE EXISTS (SELECT 1 FROM Orders o WHERE …)

A JOIN can duplicate customers if they have two shipped orders. EXISTS will not.

Then write it on a ticket

Monday is free. A colleague asks, you type, we mark it.

Clock in free