A decomposition preserves the dependencies if and only if the union of the projection of the dependencies on the decomposed relations is a cover of the dependencies of the relation.
So, to know if a decomposition preserves or not the dependencies it is not sufficient to check if the dependencies of a particular cover have been preserved or not (for instance by looking if some decomposed relation has all the attributes of the dependency). For instance, in a relation R(ABC)
with a cover F = {A→B, B→C, C→A}
one could think that in the decomposition R1(AB)
and R2(BC)
the dependency C→A
is not preserved. But if you project F
on AB
you obtain A→B, B→A
, projecting it on BC
you obtain B→C, C→B
, so from their union you can derive also C→A
.
The check is not simple, even if there exists polynomial algorithms that perform this task (for instance, one is described in J. Ullman, Principles of Database Systems, Computer Science Press, 1983).
Assuming the dependencies that you have given form a cover of the dependencies of the relation, the canonical cover that you have found is incorrect. In fact BF -> C
cannot be derived from the original dependencies.
For this reason, your decomposition is not correct, since R2(BCF)
is not in BCNF (actually, it is not in 2NF).
One possible canonical cover of R
is the following:
BDF → C
C → A
C → E
C → F
E → C
E → D
Following the analysis algorithm, there are two possible decompositions in BCNF (according to the dependencies chosen for elimination). One is:
R1 = (ACDEF)
R2 = (BC)
while the other is:
R1 = (ACDEF)
R3 = (BE)
(note that BC
and BE
are candidate keys of the original relation, together with BDF
).
A cover of the dependencies in R1
is:
C → A
C → E
C → F
E → C
E → D
while both in R2
and R3
no non-trivial dependencies hold.
From this, we can conclude that both decompositions do not preserve the dependencies; for instance the following dependency (and all those derived from it) cannot be obtained:
BDF → C