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

FormRuleRemoves
1NFAtomic columnsRepeating groups
2NFNo partial dependencyRedundancy on composite keys
3NFNo transitive dependencyNon-key → non-key
BCNFEvery determinant is a superkeyRemaining anomalies
4NFNo multi-valued dependencyIndependent 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: