Interview Question

What is UNION?

UNION combines compatible results and removes duplicates.

💡 Concept ✅ Quick Revision 🗃️ SQL

Answer

UNION combines compatible query results and removes duplicate rows. • Each query must return the same number of columns. • Corresponding columns must have compatible types. • A final ORDER BY applies to the combined result.

💡 SQL Example

SELECT email FROM customers UNION SELECT email FROM suppliers;

Result

Distinct emails from both queries

⚡ Quick Revision

UNION combines compatible results and removes duplicates.