intermediateSQL Query & Schema Design93 of 469
What is the difference between UNION and UNION ALL?
Tests whether you know UNION implicitly deduplicates (forcing a sort/hash pass) while UNION ALL just concatenates results, and that you should default to UNION ALL unless you specifically need duplicates removed.
Ready to master this question?
Generate a complete walkthrough — background, the full answer in plain language, a working code example explained line by line, a real-world scenario, common mistakes, and how this same question gets asked in different ways.
Sign in to generate a response