Tuple Level
Written Syntax: RelationA - RelationB
Arcade Syntax: RelationA - RelationB
Operation Definition
This binary operation results in a relation that contains all tuples of A that is not in 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 to find the tuples unique to a relation relative to another relation. It is equivalent to the difference operation in normal sets.
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 - Bar
A |
B |
3 |
4 |
4 |
5 |
10 |
11 |