📘 Third Normal Form (3NF)
A table is in 3NF if:
- ✅ It is in 2NF
- ✅ It has no transitive dependencies — i.e., non-key columns do not depend on other non-key columns
🔍 What is a Transitive Dependency?
A transitive dependency happens when:
A non-key column depends on another non-key column, which in turn depends on the primary key.
In short:
Primary Key → A → B
Then B is transitively dependent on the primary key via A → ❌ violates 3NF.
❌ Example: Not in 3NF
Table: Employees
EmpID (PK) | Name | DeptID | DeptName |
---|---|---|---|
1 | Alice | 10 | HR |
2 | Bob | 20 | Finance |
3 | Carol | 10 | HR |
- Primary key:
EmpID
DeptName
depends onDeptID
DeptID
depends onEmpID
So:
EmpID → DeptID → DeptName
→ ❌ transitive dependency- This violates 3NF
✅ Convert to 3NF: Remove Transitive Dependency
Table 1: Employees
EmpID (PK) | Name | DeptID |
---|---|---|
1 | Alice | 10 |
2 | Bob | 20 |
3 | Carol | 10 |
Table 2: Departments
DeptID (PK) | DeptName |
---|---|
10 | HR |
20 | Finance |
- ✅ Now
DeptName
depends only onDeptID
- ✅ No transitive dependency in
Employees
- ✅ The schema is in 3NF
🧠 Summary of Normal Forms:
Form | Rule |
---|---|
1NF | Atomic values, no repeating groups |
2NF | No partial dependency on part of composite key |
3NF | No transitive dependency (non-key columns shouldn’t depend on each other) |