I have the schema: a,b,c,d,e,g
and the following functional dependencies:
b->c, dg->ce, bc->dg, e->a, g->bd
for which I want to find the minimal cover. It seems that more than one scenario is possible.
First I represent the dependencies by splitting the right-hand side:
b->c, dg->c, dg->e, bd->d, bc->g, e->a, g->b, g->d
For dg->c
there's one extraneous attributed
. Same goes for dg->e
.
For bc->d
the attribute c
is extraneous as well as for bc->g
.
For g->bd
the attribute d
is extraneous because if we have g->b
then g+ = {gbcd}
which contains d
.
So we have 4 possible minimal covers:
b->c, g->c OR g->e, b->d OR b->g, g->b, e->a
.
The correct answer is g-->c; g-->e; b-->g; e-->a; g-->b; g-->d
according to this tool.
I cannot get the same answer from simplifying my minimal cover. What am I doing wrong?
Best Answer
Starting from the dependencies:
and splitting the right hand side, one obtain:
(Note that you have written
bd->d
instead ofbc->d
).Then you have correctly found that the attribute
d
is extraneous both indg->c
anddg->e
, whilec
is extraneous both inbc->d
and inbc->g
. So that the set of dependencies is now:Then you say:
but no dependency
g->bd
exists (it has already been split in the two dependenciesg->d
andg->b
).The last step is to find the superfluous dependencies in:
that are
b->d
andb->c
. So at the end we have:which is exactly the answer given by the tool.
Finally, consider that actually a set of functional dependencies could have more than one minimal cover: this depends on the order in which the attributes and the dependencies are considered for the elimination.