Published on

Database Normalization: 4NF

Fourth Normal Form (4NF) is a level of database normalization designed to eliminate multi-valued dependencies, which are a more subtle type of redundancy not handled by 3NF or even Boyce-Codd Normal Form (BCNF).


๐Ÿ”„ Quick Recap of Earlier Forms

Normal FormWhat It Solves
1NFAtomicity (no repeating groups, each column has atomic values)
2NFPartial dependencies (applies to composite keys)
3NFTransitive dependencies (non-key depending on another non-key)
BCNFEvery determinant is a candidate key (a stricter form of 3NF)

๐Ÿงฉ What Is a Multi-Valued Dependency?

A multi-valued dependency (MVD) occurs when:

For a single value of attribute A, there are multiple independent values of attribute B and attribute C โ€” and B and C are independent of each other.

This leads to repetition and redundancy if not separated.


๐Ÿ“Œ 4NF Rule

A table is in 4NF if:

  • It is already in Boyce-Codd Normal Form (BCNF)
  • AND it has no non-trivial multi-valued dependencies

๐Ÿง  Example

Not in 4NF

StudentCoursesLanguages
-------------------------
Student | Course | Language
--------|--------|---------
Alice   | Math   | English
Alice   | Math   | French
Alice   | History| English
Alice   | History| French

Here:

  • Each student can take multiple courses
  • Each student can speak multiple languages
  • But Courses and Languages are independent!

This causes a multi-valued dependency: Student โ†’โ†’ Course and Student โ†’โ†’ Language

Split into 4NF

StudentCourses
---------------
Student | Course
--------|--------
Alice   | Math
Alice   | History

StudentLanguages
----------------
Student | Language
--------|----------
Alice   | English
Alice   | French

Now the redundancy is gone, and MVDs are eliminated โœ…


๐Ÿ›  Summary

Aspect4NF
Based onBCNF + No Multi-Valued Dependencies
SolvesRedundancy due to independent multivalued facts
Common FixDecompose into multiple relations
Real-World UsageOften important in design of many-to-many relationships