Normalization (1NF → BCNF)
Normalization removes redundancy and update anomalies by decomposing tables based on functional dependencies.
Cheat sheet
- ▸1NF: atomic values, no repeating groups.
- ▸2NF: 1NF + no partial dependency (non-key attribute depends on whole candidate key).
- ▸3NF: 2NF + no transitive dependency (non-key → non-key).
- ▸BCNF: for every FD X → Y, X is a superkey.
- ▸Anomalies: insertion, deletion, update.
- ▸Decomposition should be lossless and ideally dependency-preserving.
Normal forms
| Form | Rule | Removes |
|---|---|---|
| 1NF | Atomic columns | Repeating groups |
| 2NF | No partial dependency | Redundancy on composite keys |
| 3NF | No transitive dependency | Non-key → non-key |
| BCNF | Every determinant is a superkey | Remaining anomalies |
| 4NF | No multi-valued dependency | Independent multi-valued facts |
Visual
Student(roll, name, dept, hod) roll → dept, dept → hod (transitive) ⇒ Student(roll, name, dept) + Dept(dept, hod) [3NF]
Top 10 campus interview questions
Quick quiz
1. Removing partial dependencies gives:
2. R(A,B,C) with A→B, B→C, key A. Highest form?
3. BCNF condition: for every FD X→Y, X is a:
4. A table with a multi-valued column violates:
5. Denormalization mainly improves: