Answer
EXISTS tests whether a subquery returns a row, while IN compares a value with a set of values. • EXISTS often expresses a correlated relationship clearly. • IN is concise for a known list or one-column subquery. • NOT IN needs special care when the set can contain NULL.
💡 SQL Example
SELECT name FROM customers c WHERE EXISTS (SELECT 1 FROM orders o WHERE o.customer_id = c.customer_id);
Result
Customers with orders
⚡ Quick Revision
EXISTS checks row existence; IN checks value membership.