4.4.21 · D3Databases

Worked examples — Normalization — 1NF, 2NF, 3NF, BCNF — anomalies each resolves

3,808 words17 min readBack to topic

This page is the practice arena for the parent topic. We march through every kind of table normalization can hand you and normalize it by hand. Before each answer, you forecast — commit to a guess, then check.

Everything here leans on Functional Dependencies (the arrow ) and Candidate Keys and Superkeys (what "minimal determines everything" means). If those words feel shaky, read those first — I re-anchor them below whenever they matter.


The scenario matrix

Every normalization problem is one (or a blend) of these case classes. The 8 examples below are labelled with the cell they hit — together they touch every row.

# Case class What makes it tricky Covered by
C1 1NF violation — non-atomic cell / repeating group value is a list, not one thing Ex 1
C2 2NF violation — partial dependency on a composite key key has ≥2 cols, a non-prime hangs off part Ex 2
C3 3NF violation — transitive dependency via a non-key middleman non-prime → non-prime Ex 3
C4 BCNF-but-3NF — the "prime loophole" non-superkey determinant, but target is prime Ex 4
C5 Degenerate: single-column key cannot violate 2NF; is it already BCNF? Ex 5
C6 Multiple candidate keys / overlapping keys which columns are prime? Ex 6
C7 All-key relation (every column is prime) is it automatically BCNF? Ex 7
C8 Real-world word problem + exam twist (dependency-preservation trap) BCNF may lose an FD → stop at 3NF Ex 8

The limiting cases to keep in mind throughout (each appears below):

  • Fewest columns possible → single-attribute key, always ≥ 2NF (C5).
  • Everything is a key → all-key relation, always BCNF (C7).
  • Nothing but trivial FDs → already BCNF, nothing to do (C7).

Figure — Normalization — 1NF, 2NF, 3NF, BCNF — anomalies each resolves
Figure s01 — the ladder of normal forms drawn as a tightening screw. Four cyan boxes (1NF, 2NF, 3NF) and one amber box (BCNF) sit left-to-right, joined by white arrows. Under each arrow an amber caption names the offending arrow that step removes: "kill lists" (1NF→2NF), "kill part-key" (2NF→3NF), "kill non-key middleman" (3NF→BCNF). The top line states the subset chain — each form is strictly stronger. Read it left to right: every example below moves you one box rightward by killing exactly one kind of bad dependency.

Use this figure as your map for the whole page: whenever an example "fixes 2NF" it is walking you from the first arrow to the second box, and so on. Each example below tells you which arrow of the screw diagram it is walking you across.










Recall Quick self-test on the matrix

Which cell is Enroll(StudentID, CourseID, Grade, StudentName)? ::: C2 — partial dependency (2NF). A single-column-key table can violate 2NF. True/False? ::: False — no proper subset of the key exists (C5). An all-key relation is always in which highest form? ::: BCNF (C7). Teacher → Subject passes 3NF but fails BCNF because…? ::: Subject is prime, so 3NF's "or target is prime" loophole saves it (C4). When might you deliberately stop at 3NF? ::: When BCNF decomposition would not preserve a dependency (C8).