Intersect

Tuple Level

Syntax:

Written Syntax: RelationA ∩ RelationB Arcade Syntax: RelationA Intersect RelationB

Operation Definition

This binary operation results in a relation that contains all tuples contained in both A and B. Since relations are sets, the result only has unique tuples. This operation requires:

  1. 1) A – a relation whose attributes in listed order have the same domains as that as B.
  2. 2) B – a relation whose attributes in listed order have the same domains as that as A

Usefulness:

This is useful to find shared tuples between relations. It could be used to find things such as similarly named cities across different region relations. Note that the result of Intersect is equivalent to A Intersect B == A – (A – B).

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 Intersect Bar

A B
1 2