One Pager Cheat Sheet
- This tutorial covers four
SET operators-UNION,UNION ALL,INTERSECTandMINUS- which combine the results of two or more component queries to form a single set of results, while adhering to certain rules. - The UNION set operator combines the results of two or more SELECT operations, removing any duplicate rows during the process.
- The UNION ALL operator allows for duplicate values to be included in the resulting set, as seen in the sample
queryandresulting tableprovided. - UNION removes duplicate rows from the
resulting table, while UNION ALL includes them. - The
INTERSECTset operator is used to combine two or more SELECT statements, returning only the duplicate rows which are present in each SELECT statement. - The
MINUSset operator returns the rows from the first query that are not present in the second query, removing any duplicate rows and displaying the result in ascending order. - The
MINUSoperator can be used to get the rows ofTable2that are not present inTable1by reversing the order of the two queries.


