I have the following problem: R(ABCDEFG) and F ={ AB->CD, C->EF, G->A, G->F, CE ->F}. Clearly, B & G should be part of the key as they are not part of the dependent set. Further, BG+ = ABCDEFG, hence candidate key. Clearly, AB->CD violates BCNF. But when I follow the algorithm, I do not end up in any answer. Probably doing something wrong. Can anyone show me how to apply the algorithm correctly to reach the decomposition?
Thanks in advance.
First, you should calculate a canonical cover of the dependencies. In this case it is:
Since the (unique) candidate key is
B G
, no functional dependency satisfies the BNCF. Then, starting from any functional dependencyX → Y
that violates the BCNF, we calculate the closure ofX
,X+
, and replace the original relationR<T,F>
with two relations,R1<X+>
andR2<T - X+ + X>
. So, chosing in this case the dependencyA B → C
, we replace the original relation with:and:
Then we check each decomposed relation to see if it satisfies the BCNF, otherwise we apply recursively the algorithm.
In this case, for instance, in
R1
the key isA B
, soC -> E
violates the BCNF, and we replaceR1
with:and:
two relations that satisfy the BCNF.
Finally, since
R2
too does not satisfy the BCNF (beacuse the key isB G
), we decomposeR2
in:and:
that are in BCNF.
So the final decomposition is constituted by the relations:
R3
,R4
,R5
, andR6
. We can also note that the dependencyG → F
on the original relation is lost in the decomposition.