The set operators in SQL permit you to process the output of two or more queries by combining the result sets, subtracting one result set from another, or displaying the rows that are common to the result sets of each of the select statements.
To learn how to use set operators, follow these steps:
location_id= 1700 (Seattle) with a manager ID of 200 or 205 combined with departments whose names contain the text 'Acc':
union allset operator. All rows from both result sets are displayed. The Accounting department was selected in each query and therefore appears twice on the report.
unionset operator. The distinct rows from both result sets are displayed.
minusset operator. The "Accounting" department has been subtracted from the first result set because that same department appears in the second result set.
intersectset operator. The "Accounting" department is the sole line of output because it is the only row common to both result sets. The row appears only one time because
intersectdisplays distinct rows.