Tuple Level
Written Syntax: RelationA ∪ RelationB
Arcade Syntax: RelationA Union RelationB
Operation Definition
This binary operation results in a relation that contains all tuples of both A and B. Since relations are sets, the result only has unique tuples. This operation requires:
- 1) A – a relation whose attributes in listed order have the same domains as that as B.
- 2) B – a relation whose attributes in listed order have the same domains as that as A.
Usefulness:
This is useful if you have different locations that were separated say to represent different regions and you are compiling them to query over all the regions. Think if you had split up the orders from customers between countries and you wanted to query info from all over the globe.
Example:
Foo (Orginal)
A |
B |
1 |
2 |
3 |
4 |
4 |
5 |
10 |
11 |
Bar (Orginal)
A |
B |
1 |
2 |
5 |
6 |
4 |
9 |
11 |
10 |
Foo Union Bar
A |
B |
1 |
2 |
3 |
4 |
4 |
5 |
10 |
11 |
5 |
6 |
4 |
9 |
11 |
10 |