We use cookies for site analytics. Accept to help us understand how the site is used. See our Privacy Policy for details.
Set operations combine whole result sets vertically: UNION stacks and de-duplicates, UNION ALL stacks and keeps duplicates, and EXCEPT subtracts one set from another. Interviews use them to test whether you know the de-duplication semantics (UNION vs UNION ALL is a classic follow-up) and to solve "in this set but not that one" problems without a join. They come up less often than joins, but when they do, the clean answer is short.
3 problems across 2 schemas · Premium. Each runs your query in an isolated SQLite sandbox with instant, graded feedback.
Keep the syntax at your fingertips with the free SQL quick references, then come back and solve.