- #1
Mateusz Szost
- 14
- 0
Homework Statement
R(ABCDEF)
D->F
AB->C
E->F
C->BD
D->E
Decompose R into dependency preserving 3NF
Homework Equations
F = {D->F, AB->C, E->F, C->BD, D->E}
The Attempt at a Solution
My attempt is to first construct the minimal basis for the FD set F, which is G={A->C, E->F, C->B, C->D, D->E} (hopefully correct). Then I created a set of relations over all the FD's in G, which is as following:
S0(AC)
S1(EF)
S2(CB)
S3(CD)
S4(DE)
Then I also add a relation, whose schema forms a key. The key for the relation R is AB and therefore I added S5(AB), so the complete solution is:
S0(AC)
S1(EF)
S2(CB)
S3(CD)
S4(DE)
S5(AB)
But afterwards, when I test this solution if it fills the requirements to be in 3NF, then it is incorrect. Firstly, my definition of a relation in 3NF is if X->A is a FD that holds in a relation, then X is a superkey or A is a prime (an attribute that is part of a key). The functional dependency C-D will fail in my solution because it doesn't fill either of the requirements.
Have I constructed the minimal basis incorrectly? I don't know why I can't get this all right.
If you have a very simple and effective algorithm to decompose a relation into 3NF, then please let me know it so I will be better at decomposing relations into 3NF.
Thanks for your help!