Unions Intersection Minus Assignment 5
Unions Intersection Minus Assignment 5
1. UNION
• Definition: Combines the results of two SELECT statements, removing duplicate rows by
default.
• Key Points:
o Columns in both queries must have the same number and compatible data types.
o Use UNION ALL to include duplicates.
• Syntax:
• Example:
2. INTERSECTION
• Key Points:
o Columns in both queries must have the same number and compatible data types.
o Removes duplicates by default.
• Syntax:
• Example:
3. MINUS
• Definition: Returns the rows that are in the first SELECT statement but not in the second.
• Key Points:
o Columns in both queries must have the same number and compatible data types.
o Removes duplicates by default.
• Syntax:
• Example: