union
Problem
Given two relations with the same heading, create a relation with all tuples from both relations.
Example: I want the list of all managers plus all employees.
Description
The set union of two relations. The result contains all tuples from left
as well as all tuples from right
.
The result’s heading is identical with that of the inputs’.
Requirements
The headings of the two relations must be identical.
Example
Generated SQL
Note that the scoping of the table alias t1
is limited to the respective SELECT
clauses, which is why the same alias is used in both clauses.