# Difficulties with getting a relation into 3NF

Tags:
1. Feb 24, 2016

### Mateusz Szost

1. The problem statement, all variables and given/known data
R(ABCDEF)
D->F
AB->C
E->F
C->BD
D->E

Decompose R into dependency preserving 3NF

2. Relevant equations
F = {D->F, AB->C, E->F, C->BD, D->E}

3. 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.