Database Normalization — Why?

Chapter 7 · normalization is a systematic process of organizing data in a relational database to reduce redundancy and improve data integrity.

Definition

In simple words, normalization means dividing a large table into smaller related tables so that data is stored only where it logically belongs.
Formal definition. Database normalization is the process of structuring relational database tables based on functional dependencies and keys, to minimize redundancy and avoid data anomalies such as insertion, update and deletion anomalies.

The problem — one big table

Suppose a university stores student and course information in one table:

Student_IDStudent_NameProgramCourse_IDCourse_TitleInstructor
101RahimCSECSE101DatabaseDr. Hasan
101RahimCSECSE102ProgrammingDr. Karim
102KarimEEECSE101DatabaseDr. Hasan
This table has repeated data. For example:
  • Rahim and CSE are repeated for Student_ID 101.
  • Database and Dr. Hasan are repeated for Course_ID CSE101.
This repetition of data leads to several problems!

The three anomalies

AnomalyProblem in this table
Update anomalyIf Dr. Hasan’s name changes, it must be updated in many rows. If one row is missed, the database becomes inconsistent.
Insertion anomalyA new course cannot be inserted unless at least one student is enrolled in that course.
Deletion anomalyIf Student_ID 102 drops CSE101, information about CSE101 may be lost if that was the only row storing it.
Normalization solves these problems.

Types of normal form

FormNameRule in one line
1NFFirst Normal FormAtomic values · no repeating groups · unique rows
2NFSecond Normal Form1NF + no partial dependency
3NFThird Normal Form2NF + no transitive dependency
BCNFBoyce-Codd Normal FormEvery determinant is a super key
4NFFourth Normal FormNo multi-valued dependencies
5NFFifth Normal FormNo join dependencies

In most academic and practical database design, 1NF, 2NF, 3NF and BCNF are the most important — and they are the four this course examines.

Unnormalized table (UNF)
repeating groups, non-atomic cells
make atomic
1NF — atomic values, no repeating groups, unique rows
split by FD
2NF — remove partial dependencies on part of a composite key
split by FD
3NF — remove transitive dependencies (non-key → non-key)
split by FD
BCNF — every determinant must be a super key
Each step is a decomposition guided by the functional dependencies.

Next: First Normal Form →