How can we find customers who have at least one order?
EXISTS tests for the existence of rows in a correlated subquery, returning true as soon as one match is found.
High-performance presence checks, finding active purchasing customers, transactional auditing.
SELECT c.customer_name
FROM customers c
WHERE EXISTS (
SELECT 1
FROM orders o
WHERE o.customer_id = c.customer_id
);Practice typing production-grade SQL code for EXISTS.