Hamish Burke | 2025-05-29

Related to: #databases


BCNF Decomposition Algorithm

Steps

  1. First check if not already BCNF
  2. Find a violation (where FD X→A, X is not a Superkey of R)
  3. Decompose
    1. Replace R with two new schemas
      1. R1=X∪A
      2. R2=R−A∪X
    2. Compute F1=F+projected onto R1
    3. Compute F2=F+projected onto R2
  4. Repeat until all schemas are BCNF

Example

R={A,B,C}

F={A→B,B→C}

  1. A→B: A is a superkey (A⋆=ABC)
  2. B→C: B is not a superkey (B⋆=BC)
    1. R1={B,C}
      1. F1={B→C}
    2. R2={A,B}
      1. F2={A→B}
  3. R1,R2 both result in BCNF (with their FD X→A, X⋆ being a superkey)
  4. Done