Database Normalization

Database normalization is the process of organizing data in a database to reduce redundancy and prevent data anomalies such as insertion, update, and deletion anomalies.

Important Terms

  1. X: Determinant — the left-hand side of a functional dependency.
  2. Y: Dependent Attribute — the right-hand side of a functional dependency.
  3. Proper Subset (⊂): A set that contains fewer elements than another set.
  4. Prime Attribute: An attribute that is part of at least one candidate key.
  5. Non-prime Attribute: An attribute that is not part of any candidate key.
  6. Super Key: One or more attributes that uniquely identify a row.
  7. Candidate Key: A minimal super key that uniquely identifies a row.
  8. FD: Functional Dependency.
  9. MVD: Multivalued Dependency.
  10. Join Dependency: A constraint where a relation can be reconstructed by joining multiple decomposed relations.

1NF: First Normal Form

  1. Condition: Atomic Values
  2. Each column must contain a single, indivisible value.
  3. A column should not contain multiple values in a single cell.
  4. Repeating groups and multivalued attributes are not allowed.

2NF: Second Normal Form

  1. Condition: No Partial Dependency
  2. The table must already be in 1NF.
  3. Every non-prime attribute must depend on the entire candidate key.
  4. A non-prime attribute must not depend on a proper subset of a composite candidate key.
  5. For every functional dependency X → Y:
    1. X must not be a proper subset of any candidate key K, or
    2. Y must be a Prime Attribute.
  6. Partial dependency exists when:
    1. X is a proper subset of candidate key K, and
    2. X → Y, where Y is a non-prime attribute.

3NF: Third Normal Form

  1. Condition: No Transitive Dependency
  2. The table must already be in 2NF.
  3. Non-prime attributes should not depend on other non-prime attributes.
  4. For every functional dependency X → Y:
    1. X must be a Super Key, or
    2. Y must be a Prime Attribute.

BCNF: Boyce-Codd Normal Form

  1. Condition: Every Determinant is a Super Key.
  2. The table must satisfy the requirements of 3NF.
  3. For every non-trivial functional dependency X → Y, X must be a Super Key.
  4. BCNF is stricter than 3NF.

4NF: Fourth Normal Form

  1. Condition: No Non-trivial Multivalued Dependency.
  2. The table must already be in BCNF.
  3. A non-trivial multivalued dependency X ↠ Y should not exist unless X is a Super Key.
  4. 4NF mainly deals with independent multivalued facts about the same entity.

5NF: Fifth Normal Form

  1. Condition: No Non-trivial Join Dependency.
  2. The table must already be in 4NF.
  3. Every non-trivial join dependency must be implied by candidate keys.
  4. 5NF deals with situations where a table can be further decomposed into smaller tables without losing information.

Quick Revision

  1. 1NF → Atomic Values
  2. 2NF → No Partial Dependency
  3. 3NF → No Transitive Dependency
  4. BCNF → Every Determinant is a Super Key
  5. 4NF → No Non-trivial Multivalued Dependency
  6. 5NF → No Non-trivial Join Dependency

Archive

More
Stories.

Back To Stories