EXPERIMENT NO 8 dms
EXPERIMENT NO 8 dms
Table1 Table2
Statements:
1. Union: UNION is an SQL operator which combines the result of two or more SELECT
queries and provides the single set in the output.
Syntax: SELECT column_name from table1 UNION SELECT column_name from table2;
2. Union All: It returns the set without removing duplication and sorting the data.
Syntax: SELECT column_name from table1 UNION ALL SELECT column_name from
table2;
3. Intersect: The INTERSECT statement will return only those rows which will be common
to both of the SELECT statements.
Syntax: SELECT column_name from table1 INTERSECT SELECT column_name from
table2;
4. Except: The MINUS operator in SQL is used to return all rows in the first query that are
not present in the second query.
Syntax: SELECT column_name from table1 EXCEPT SELECT column_name from table2;