Normal Forms

  • If a relation is in a certain normal form, it is known that certain kinds of problems are avoided/minimized
    • This can be used to decide whether decomposing the relation will help

Boyce-Codd Normal Form (BCNF)

  • If for all in , is trivial ( contains ) or contains a key for
  • Relation is in BCNF if the only non-trivial FDs that hold over represent key constraints
  • Ensures that no redundancy can be detected using FD information alone
    • Most desirable normal form in terms of redundancy
  • Decomposition into
    • Given: Relation with FDs
    • Look among the given FDs for a BCNF violation
      • If any FD following from violates BCNF, then there will surely be an FD in itself that violates BCNF
    • Compute
      • Not all attributes, or else is a superkey
    • Decompose using
      • Replace by relations with schemas:
      • Project given FDs onto the two new relations
      • Lossless decomposition
  • Steps
    1. Find keys of relation
    2. Find a BCNF violation FD
    3. Compute
    4. Decompose to and
    5. Find projecting FDs
  • Problem
    • When and
    • There are two keys, and
    • is a BCNF violation, so we must decompose into
    • After decomposing you can no longer guarantee that

3rd Normal Form (3NF)

  • Modifies the BCNF condition so it does not have the decomposition problem
  • An attribute is prime if it is the member of any key
  • violates 3NF iff is not a superkey and is not prime
  • Allows for some redundancy (it is a compromise when BCNF is not possible)
    • Should be used when a lossless-join, dependency preserving decomposition into BCHNF is not possible
  • To ensure dependency preservation
    • Use a minimal cover for (the fewest possible functional dependencies that still produces )
    • If any in the minimal cover is not preserved, add to a relation