Third Normal Form (3NF)
Press Next → or use ← → arrow keys
The Story — The Office Phone Directory Disaster
The room and the head were never facts about the employee — they were facts about the department. Storing them on the employee row is exactly the redundancy 3NF removes.
The Foundation — Functional Dependencies
If you know X's value, Y's value is fixed and unambiguous. One StudentID always maps to exactly one StudentName — but a name can be shared by many IDs. FDs point one direction only.
Never declare an FD from data alone. An FD is a business rule about every legal state — confirm it with domain experts, not with today's rows.
Quick Recap — Climbing to 2NF
1NF removes repeating groups → 2NF removes partial dependency. Each form fixes exactly one species of redundancy the previous one couldn't see. Next rung: the redundancy hiding between non-key columns.
The Issue 2NF Leaves Behind
This STUDENT table is perfectly in 2NF — the key is single-column, so no partial dependency is even possible. Yet DeptName and DeptHead repeat on every row.
| StudentID key | StudentName | DeptID | DeptName | DeptHead |
|---|---|---|---|---|
| S1 | Aarav | D1 | Computer Science | Dr. Rao |
| S2 | Diya | D1 | Computer Science | Dr. Rao |
| S3 | Kabir | D2 | Mathematics | Dr. Bose |
| S4 | Mira | D1 | Computer Science | Dr. Rao |
StudentID → DeptID (direct), then DeptID → DeptName, DeptHead (non-prime determines non-prime). So DeptName reaches the key only indirectly — a transitive dependency 2NF was never built to catch.
One Transitive Dependency → Three Anomalies
The table satisfies 2NF completely, yet still suffers redundancy and all three anomalies. The culprit is the transitive dependency — and removing it is precisely the job of 3NF.
Third Normal Form — The Definition
A relation is in 3NF if it is already in 2NF and contains no transitive dependency of a non-prime attribute on a candidate key.
For every non-trivial FD X → Y, at least one must hold:
If you ever find a dependency where the left side is not a superkey and the right side is not a prime attribute, the table breaks 3NF. Bill Kent's mantra: "every non-key attribute depends on the key, the whole key, and nothing but the key — so help me Codd."
Breaking the Chain — Before & After
Lift the dependent group (DeptName, DeptHead) into its own table beside its true key, leaving DeptID behind as a foreign key. DeptName now lives once. The split is lossless — a join rebuilds the original exactly.
Worked Example — Redundant to Lean
Before: one bloated table where "Comp Sci / Rao" repeats. After: two clean tables in 3NF.
❌ STUDENT — before (2NF, redundant)
| SID | Name | DeptID | DeptName | Head |
|---|---|---|---|---|
| S1 | Aarav | D1 | Comp Sci | Rao |
| S2 | Diya | D1 | Comp Sci | Rao |
| S3 | Kabir | D2 | Maths | Bose |
| S4 | Mira | D1 | Comp Sci | Rao |
✅ STUDENT — after
| SID | Name | DeptID FK |
|---|---|---|
| S1 | Aarav | D1 |
| S2 | Diya | D1 |
| S3 | Kabir | D2 |
| S4 | Mira | D1 |
✅ DEPARTMENT — after
| DeptID PK | DeptName | DeptHead |
|---|---|---|
| D1 | Computer Science | Dr. Rao |
| D2 | Mathematics | Dr. Bose |
In STUDENT the only FD is StudentID → Name, DeptID (left side is the key); in DEPARTMENT it's DeptID → DeptName, DeptHead (left side is the key). Both are in 3NF. Now: insert Physics with zero students · update the CS head once · delete the last Maths student and DEPARTMENT stays intact.
Second Drill — The Geography Chain
Chains can be longer than one hop. When columns "travel together," suspect a transitive chain.
| CandNo key | CandName | State | Country | PinCode |
|---|---|---|---|---|
| C1 | Aarav | Himachal Pradesh | India | 173212 |
| C2 | Diya | Himachal Pradesh | India | 173212 |
| C3 | Liam | California | USA | 94016 |
Lift the chain into a LOCATION(PinCode, State, Country) table; keep only PinCode as a foreign key in CANDIDATE. Both tables are now in 3NF. Lesson: follow every arrow until it dead-ends — city/state/country, code/description, product/category/manager — each link is its own violation.
2NF vs 3NF — Side by Side
| Aspect | 2NF | 3NF |
|---|---|---|
| Target problem | Partial dependency | Transitive dependency |
| Dependency removed | Non-prime on part of key | Non-prime on another non-prime |
| Needs composite key? | Yes — multi-attribute keys only | No — happens even with single-column |
| Prerequisite | Must be in 1NF | Must be in 2NF |
| Rule of thumb | Depend on the whole key | Depend on nothing but the key |
| Remaining risk | Transitive chains still allowed | Rare overlapping-key cases → BCNF |
1NF removes repeating groups · 2NF removes partial dependency · 3NF removes transitive dependency. Each form kills exactly one redundancy species the previous form could not see.
Common Pitfalls & Misconceptions
Two Lenses — and When 3NF Isn't Enough
BCNF is stricter: every determinant (FD left side) must be a superkey — no exception for prime attributes. If your table has a single candidate key (most cases), reaching 3NF usually puts you in BCNF for free. Overlapping candidate keys are the edge case 3NF still permits and BCNF tightens.
Test Yourself — Three Interview Questions
Golden Rules of Third Normal Form
Nothing But the Key
3NF makes every non-key column depend on the key and nothing but the key — dissolving the transitive chains, redundancy, and three anomalies 2NF left behind, all via a lossless split linked by foreign keys. For the vast majority of OLTP schemas, that removes essentially all harmful redundancy.
If a non-key column is determined by another non-key column, split it out — 3NF means every non-key attribute depends on the key, the whole key, and nothing but the key. The one tighter step left is BCNF.
🔗 End of tutorial · Press ← to review, or click Restart