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 XA, X is not a Superkey of R)
  3. Decompose
    1. Replace R with two new schemas
      1. R1=XA
      2. R2=RAX
    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={AB,BC}

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