Database.Beginner.Third Normal Form (3NF)

Third Normal Form (3NF)

Goal:

  • Be in 2NF AND
  • Eliminate transitive dependencies (non-key columns must depend only on the primary key, not on other non-key columns).

A table in 2NF but NOT in 3NF:

student_idstudent_namestudent_zipcodezipcode_city
1Alice12345New York
2Bob67890Los Angeles

Problem:

  • zipcode_city depends on student_zipcode, not directly on student_id.
  • This is a transitive dependency: student_id → student_zipcode → zipcode_city.

Fix — Table in 3NF:

Split into two tables:

Students

student_idstudent_namestudent_zipcode
1Alice12345
2Bob67890

Zipcodes

student_zipcodezipcode_city
12345New York
67890Los Angeles

✅ Now, all non-key columns depend only on the primary key.


Summary Table

Normal FormWhat It FixesRequirement
1NFRepeating groups, multivalued columnsAtomic values (no lists or sets inside fields).
2NFPartial dependenciesNo non-key column depends on part of a composite key.
3NFTransitive dependenciesNo non-key column depends on another non-key column.

🎯 In Simple Words:

  • 1NF: One value per cell.
  • 2NF: No partial key dependency.
  • 3NF: No indirect dependency.
This entry was posted in Без рубрики. Bookmark the permalink.