DBMS slides 📂 Functional Dependencies & Normalization · 9 of 9 36 min read

Fifth Normal Form (5NF)

Fifth Normal Form removes the last redundancy the lower forms can't see — the kind created by a join dependency. When a cyclic three-way constraint links three attributes, splitting into two tables invents fake rows, but splitting into three rejoins losslessly. Using the Supplier–Part–Project example, this tutorial defines join dependencies, shows spurious tuples, and explains why 4NF isn't enough.

Fifth Normal Form (5NF)

Join dependencies and the last step of normalization. When redundancy survives even 4NF, the fix is to split into three tables that rejoin losslessly — no fake rows. Also called Project–Join Normal Form (PJNF).
Join Dependency Spurious Tuples 3-Table Split The Final Rung

Press Next → or use ← → arrow keys

The Story

The Supplier Catalog That Kept Lying

Three facts that only make sense together
A procurement team tracks which supplier supplies which part for which project. Their rule is subtle and cyclic: if a supplier supplies a part, and that part is used by a project, and that supplier already works with that project — then the supplier must be supplying that part to that project. Store all three columns in one table and the same combinations repeat, yet splitting into two tables invents deliveries that never happened.
🕳️
The Twist

This table can already be in 4NF — no bad functional or multi-valued dependency. The redundancy comes from a join dependency: a three-way constraint that only 5NF can see.

Foundations

Where 5NF Sits on the Ladder

1–3NF BCNFFDs 4NFMVDs 5NFJoin deps 6NF / DKNFbeyond
🪜
The Redundancy Ladder

BCNF removes functional-dependency redundancy. 4NF removes independent multi-valued redundancy. 5NF removes what's left: redundancy from a join dependency — the kind that needs three or more tables to eliminate.

🎓
Two Names, One Form

5NF is also called Project–Join Normal Form (PJNF) — because it's about projecting a table into pieces and joining them back without loss.

The Concept

What Is a Join Dependency?

📖
Definition

A relation R has a join dependency ⋈(R1, R2, …, Rn) if R can be reconstructed exactly by projecting it onto R1…Rn and joining them back — no rows lost, no rows invented.

🔗
The Generalization

A multi-valued dependency (4NF) is just a join dependency with two components. A join dependency is the bigger idea: the redundancy may only dissolve when you split into three or more tables at once.

🔁
Where It Comes From

A non-trivial JD arises from a cyclic business rule among three attributes — "if these three pairwise facts hold, the triple must hold too." That cycle is exactly what lets a 3-way split rebuild the original cleanly.

The Example

SUPPLIES — 4NF, Yet Still Redundant

SUPPLIES(Supplier, Part, Project)
SupplierPartProject
S1P1J2
S1P2J1
S2P1J1
S1P1J1

The whole row is the key — no FD or MVD is violated, so it's already in 4NF.

Supplier Part Project cyclic 3-way rule → join dependency
🔁
The Cyclic Rule Behind the Data

If S1 supplies P1, P1 is used by J1, and S1 works on J1, then S1 must supply P1 to J1. That constraint links all three attributes at once — a functional/multi-valued lens can't express it.

The Trap

A Two-Table Split Invents Fake Rows

Project onto just SP(Supplier, Part) and PJ(Part, Project), then join on Part:

SPSupplier · Part ⋈ PJPart · Project SP ⋈ PJ = 5 rows (S1,P1,J2) (S1,P1,J1) (S1,P2,J1) (S2,P1,J1) (S2,P1,J2) ✗ ↑ fake — S2 never supplied P1 to J2 a spurious tuple
👻
Lossy Decomposition

The join produces a row (S2, P1, J2) that was never in the original. Rejoining two projections doesn't rebuild the truth — it fabricates a delivery. Two tables are not enough.

The Fix

Decompose Into Three Binary Tables

Project onto all three pairs — supplier–part, part–project, and project–supplier:

SP · Supplier–Part
SupplierPart
S1P1
S1P2
S2P1
PJ · Part–Project
PartProject
P1J2
P2J1
P1J1
JS · Project–Supplier
ProjectSupplier
J2S1
J1S1
J1S2
🧷
The Missing Third Constraint

The two-table split lost the Project–Supplier relationship. JS restores it — and it's precisely this third table that will veto the fake row.

The Fix · Proof

The Three-Way Join Is Lossless

SP ⋈ PJ ⋈ JS exactly the original 4 rows (S1,P1,J2) (S1,P2,J1) (S2,P1,J1) (S1,P1,J1) ✓ no spurious rows
🛡️
JS Vetoes the Fake Row

The fake (S2, P1, J2) survives SP ⋈ PJ — but joining with JS checks "does S2 work on J2?" It doesn't: (J2, S2) isn't in JS, so the fake row is filtered out. Only the true four rows remain.

The Definition

Fifth Normal Form — The Definition

📐
The 5NF Rule

A relation is in 5NF (PJNF) if it is in 4NF and every non-trivial join dependency in it is implied by its candidate keys — i.e., each JD's components are all superkeys.

1️⃣
Condition 1
Already in 4NF — all functional and multi-valued redundancy is gone.
2️⃣
Condition 2
Every non-trivial join dependency is implied by the candidate keys — no "surprise" JD.
🗣️
The Folk Version

"If a table can be split into smaller pieces that rejoin with no loss and no fake rows, it should be." 5NF means it can't be split any further without losing information.

The Nuance

MVD vs JD · Trivial vs Non-Trivial

👥
MVD = 2-way JD
A multi-valued dependency is a join dependency with exactly two projections. 4NF is the special case; 5NF is the general one.
🧩
JD = n-way split
A true 5NF problem needs three or more projections to rebuild losslessly — a two-way split always leaves spurious rows.
😴
Trivial JD

One projection is the whole relation. Harmless — nothing to split. 5NF ignores it.

💣
Non-Trivial JD

Every projection is smaller than R, yet they rejoin exactly. This is the redundancy 5NF removes.

Head to Head

4NF vs 5NF — Side by Side

Aspect4NF5NF (PJNF)
Dependency handledMulti-valued X →→ YJoin dependency ⋈(R1…Rn)
Split neededTwo tablesThree or more tables
Core ruleEvery non-trivial MVD's left side is a superkeyEvery non-trivial JD is implied by candidate keys
Redundancy removedIndependent multi-valued setsCyclic three-way constraints
PrerequisiteMust be in BCNFMust be in 4NF
GeneralitySpecial case (binary JD)The general case
🧠
The Mental Model

4NF = "one key fans out into two unrelated sets." 5NF = "three attributes are locked in a cycle that only a three-way split can untangle."

Perspective

Academic vs Industry Lenses

🎓
Academic lens
Built on the join dependency, the most general FD-family constraint. 5NF = 4NF + every non-trivial JD implied by candidate keys. It's the strongest normal form achievable through projection and join. Hierarchy: 4NF ⊂ 5NF ⊂ (6NF/DKNF).
🏭
Industry lens
Genuine 5NF violations are rare — they need a real cyclic constraint among three independent many-to-many relationships. Most schemas that reach 4NF are already in 5NF. When it does occur, the fix is natural: one association table per pairwise relationship.
🤝
Where They Meet

Academia proves 5NF is the ceiling of projection-join normalization; industry rarely needs to reach for it — but when a three-way cyclic rule appears, 5NF is the only clean answer.

Judgment

When 5NF Matters — and When It's Overkill

✅
Apply 5NF
Three independent many-to-many relationships bound by a cyclic rule (supplier–part–project), causing a real join dependency.
⚠️
Skip 5NF
If no cyclic constraint holds, the two-way split is already lossless — you're done at 4NF. Don't split for its own sake.
📊
Denormalize on purpose
Read-heavy systems may keep the joined shape to avoid three-way joins at query time — a profiled trade-off.
🏁
The Ladder Is Complete

1NF → 2NF → 3NF → BCNF → 4NF → 5NF. Beyond 5NF lie 6NF (temporal / irreducible relations) and DKNF (domain-key), but 5NF is the end of the classic projection-join road.

Cheat Sheet

Golden Rules of 5NF

🏆 NON-NEGOTIABLE PRINCIPLES
1
Reach 4NF first. 5NF assumes all multi-valued redundancy is already gone.
2
Suspect a join dependency when three attributes are tied by a cyclic "if-pairwise-then-triple" rule.
3
Test the two-way split first — if it produces spurious rows, you need a three-way (or n-way) decomposition.
4
Project onto every pairwise relationship — the missing pair is what vetoes the fake rows.
5
Verify the rejoin reproduces the original exactly — no rows lost, none invented.
6
Mantra: "If it splits cleanly, split it." Normalize for correctness, denormalize for measured speed.
FINAL

The Last Step of Normalization

4NF+Prerequisite
⋈Join dependency
3Tables, lossless
0Spurious rows
🎯
The Redundancy Only a Three-Way Split Can Kill

5NF catches redundancy created by a join dependency — a cyclic three-way constraint that a two-table split can't honour without inventing fake rows. Project onto all three pairwise relationships and the original rejoins losslessly and spurious-free. When a table can't be split any further without losing information, it's in 5NF.

🧠
One Sentence to Remember

If two projections rejoin with fake rows but three rejoin cleanly, the table had a join dependency — and splitting it into all three is 5NF.

🧩 End of tutorial · Press ← to review, or click Restart

You have completed Functional Dependencies & Normalization. View all sections →