Boyce-Codd Normal Form

Schema R is in BCNF with respect to a set of functional dependencies F if and only if whenever (XY)F+ where XYR then at least one of the following hold:

  1. XY is trivial (YX)
  2. X is a superkey of R

Database schema p={R1,,Rn},F is in BCNF if each relation schema Ri is in BCNF with respect to F

Algorithm

function computeBCNF(R, F)
begin
    Result := {R};
    while some Ri ∈ Result and (X -> Y) ∈ F+
            violate the BCNF condition do begin
        Replace Ri by Ri - (Y - X);
        Add X ∪ Y to Result;
    end;
    return Result;
end

Correctness Theorem for ComputeBCNF

Function ComputeBCNF(R,F) returns a lossless-join decomposition of R for which each table in the decomposition is in BCNF with respect to F

Computing lossless-join BCNF decomposition

No efficient procedure exists

  • Results depend on sequence of FDs used to decompose relations
  • It is possible no lossless join dependency preserving BCNF decomposition exists

Consider R={A,B,C} and F={ABC,CB}

  • R is not in BCNF with respect to F
  • ABC will be an inter-relational FD in any decomposition of R