Eroxl's Notes
Third Normal Form
aliases
3NF

Third normal form is a normal form used in database normalization. Third normal form eliminates transitive dependencies of non-key attributes on the primary key.

3NF is strictly weaker than BCNF. The difference is that 3NF permits a non-trivial FD when is prime, even if is not a super key. BCNF does not allow this exception.

The advantage of 3NF over BCNF is that it is always possible to find a decomposition into 3NF that is both loseless and dependency-preserving, which is not always achievable for BCNF.

Definition

A schema is in third normal form if for every non-trivial functional dependency (where is a single attribute) at least one of the following holds:

Equivalently, a schema is in 3NF if it is in 2NF and no non-prime attribute is transitively dependent on any candidate key.

A transitive dependency exists when and , where is not a super key and is a non-prime attribute. In this case is a transitive dependency through .

Example

Consider a schema Student(StudentID, Department, DepartmentHead) with the following functional dependencies:

  • StudentID Department
  • Department DepartmentHead

The only candidate key is {StudentID}.

This schema is in 2NF (the key is a single attribute, so partial dependencies are impossible), but it is not in 3NF because DepartmentHead is transitively dependent on StudentID through Department:

Here Department DepartmentHead violates 3NF because Department is not a super key and DepartmentHead is not a prime attribute.

To bring it into 3NF, we decompose into:

  • Student(StudentID, Department)
  • Department(Department, DepartmentHead)