Database Normalization

DB Normalization

  • Normalization is the process of splitting one table into two or more tables in order to transform it into a stable data structure that minimizes data inconsistency and data duplication while securing maximum data stability, without data loss or the introduction of unnecessary information.

Purpose of DB Normalization

  • Maintain data integrity
    • Minimize the storage space needed for data storage and eliminate anomalies caused by data insertion, update, and deletion.
  • Maximize the stability of the data structure.

Normalization Process

  • First Normal Form
    • Decomposes data so that every attribute value has an atomic value.
  • Second Normal Form
    • Satisfies First Normal Form and decomposes data so that non-primary-key attributes are fully functionally dependent on the primary key.
      • Here, full functional dependency means that a subset of the primary key does not determine another value.
  • Third Normal Form
    • Satisfies Second Normal Form and decomposes data so that non-primary-key attributes are directly dependent on the primary key (non-transitive dependency).
      • Here, transitive dependency means that A->B->C holds, and decomposing it into A,B and B,C is Third Normal Form.
  • BCNF Normalization
    • Satisfies Third Normal Form and decomposes data so that when the functional dependency X->Y holds, every determinant X becomes a candidate key.