Natural Join
- Combines two tables into one.
- Connects matching rows (as defined by foreign keys).
join(R, S)
The join columns of R and
S are the column names common to both relations.
- Considering all pairs of rows, (r, s), such that r ∈
R, s ∈ S.
- Find pairs such that columns with matching names in r and s are equal.
- When such a match is found, output the concatenated rows (without duplicated columns).
Natural join can be defined in terms of simpler operations
- generate all pairs of rows from inputs.
- Followed by remove "duplicate: columns
- Followed by keep pairs in which join columns match
- ... along with some renaming to make sure that column names are unique at each step.
|