liveBook · Manning

Third normal form

As explained in Grokking Relational Database Design

Third normal form is a relational design level in which the table is in second normal form and non-key attributes do not depend transitively on a key.

Third normal form (3NF) is a relational design level that reduces redundancy and protects data integrity. A table reaches 3NF when it has a primary key, no multivalued columns, and non-key columns depend directly on that key rather than on another non-key column. section 6.2 section 6.8

Check a table against these practical 3NF rules:

  • Confirm that the table has a primary key. section 6.8
  • Remove multivalued columns. section 6.8
  • Ensure every non-key column depends directly on the key and on nothing else. section 6.7
  • Separate columns involved in a transitive dependency into related tables, using a foreign key when appropriate. section 6.7

Employee and department

Suppose employee_id identifies an employee, employee_id determines department_id, and department_id determines department_name. Because department_name depends on employee_id through another non-key column, the employee table has a transitive dependency. Move department_id and department_name into a department table keyed by department_id, and keep department_id as a foreign key in the employee table. section 6.7

The normal forms are hierarchical: 3NF builds on earlier forms, while BCNF includes the characteristics of 1NF through 3NF. A fully normalized design commonly uses BCNF as the practical target. section 6.2

How Grokking Relational Database Design covers it

How deep it goes
Defines transitive dependency, demonstrates its employee-table form, and prescribes decomposition into directly dependent tables.
Examples
Uses an employee table whose department details create a transitive dependency, then separates employee and department data.
What it assumes
Builds on earlier normal forms and assumes familiarity with primary keys, candidate keys, superkeys, and functional dependencies.
What you can do after
Apply a 3NF checklist and split tables containing transitive dependencies into related tables.
How it connects
Links normalization with primary keys, functional dependencies, foreign keys, transitive dependencies, second normal form, and BCNF.

Also explained in

Compare how 2 books explain third normal form →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Grokking Relational Database Design. The section links point to the parts of the book it draws on.