What is a union, intersect, minus?
UNIONUnion operator is used to return all rows from multiple tables and eliminate duplicate rows. The number of columns and the datatypes of the columns must be identical in all the SELECT statements used in the query. The names of the columns need not be identical.
Syntax SELECT column1, column2 FROM tablename1
UNION
SELECT column1, column2 FROM tablename2;
INTERSECT This operator is used to return all rows common to multiple queries. Intersect ignores NULL values
SyntaxSELECT column1, column2 FROM tablename1
INTERSECT
SELECT column1, column2 FROM tablename2;
MINUS This operator returns all those rows from first query that are not present in the second query.
Syntax SELECT column1, column2 FROM tablename1
MINUS
SELECT column1, column2 FROM tablename2;