Relational Algebra Joins
Context: FIT2094_MOC · combine two relations on a predicate · theta, equi, and natural joins · built from Cartesian Product + project
Quick Revision
- 🎯 Objective: combines tuples from two relations satisfying a predicate ➔ product + select (+ project).
- 📦 Core Components: theta (any comparison) ➔ equi () ➔ natural (shared attrs, dedup column).
- ⚡ Key Constraint: joins are derived from Cartesian Product, not primitive.

📝 Core
1. The Join
- Definition ➔ combines tuples from two relations satisfying a predicate.
- Three kinds ➔ theta / equi / natural.
2. The Three Kinds
- Theta ➔ , , .
- Equi ➔ theta with being ; shared attribute appears twice.
- Natural ➔ equi join on common attribute(s) with duplicate column removed; no explicit predicate needed.
3. Natural Join = 3 Steps
- Product ➔ .
- Select ➔ (this is the equi join).
- Project ➔ drop the duplicate column → natural join.
Key identities:
⚖️ Core Decision Matrix
| Join | Predicate | Shared column |
|---|---|---|
| theta | any | kept (both) |
| equi | duplicated | |
| natural | on common | removed |
| vs set ops | different schemas | (set ops need identical) |
When It Flips: every join is a Cartesian Product filtered by the predicate (natural join also projects) — joins are derived, not primitive. Equi joins on PK = FK are the everyday case (Foreign Key and Referential Integrity); pure algebra drops unmatched tuples (inner join, no NULLs).
📊 Exam Execution Trace
Applied Exercise
Problem: Show the natural join of STUDENT and MARK on ID as three steps. Derivation Proof / Hand-Calculation Walkthrough:
Final Extracted Output: 3 tuples; Alice (ID 1) appears twice, Bob (ID 2) once.
⚠️ Common Mistakes
- 💡 Natural join needs a shared attribute ➔ if relations share matching attribute(s) the predicate is implicit; without one, use an equi join and state the predicate.
🧠 Active Recall
Distinguish theta, equi, and natural joins.
- Hint: Comparison and column handling.
Answer
- Short answer: Theta = any ; equi = (shared column duplicated); natural = equi on common attrs with duplicate column removed.
- Why: Implicit predicate ➔ natural join needs no stated predicate when attributes match.
Show the natural join of STUDENT and MARK on ID as three algebra steps.
- Hint: Product → select → project.
Answer
- Short answer: (6 tuples), (3, equi), drop dup ID (natural).
- Why: Alice twice ➔ two marks with ID 1; Bob once.