Questions regarding second normal form

normalization

I understand that in order to fulfill 2.NF, attributes must not be dependent on part of the key. Now, the question is, let's say we have a relation R with a set of attributes {A,B,C,D,E,F,G,H,I,J,K} and its functional dependencies {A→GH, B→IJ, C→A, F→B, FC→DK, K→E} and the candidate keys C AND F. Do these FDs like C→A violate 2.NF because it is not fully functionally dependent on BOTH F AND C ?

So the question is

Do attributes in functional dependencies need to be dependent on the whole set of candidate keys – in this case FC ? Or is the dependency on one of the keys sufficient to fulfill 2.NF ?

Best Answer

If all your dependencies are those you have shown: {A->GH, B->IJ, C->A, F->B, FC->DK, K->E} then you have come to the wrong conclusion.

Your only candidate key is CF. The C and F are not candidate keys on their own.

Therefore, the F->B dependency (and the C->A as well) means that the relation violates 2NF.


For the other question, if you had for example these dependencies:

BC -> AF
AF -> BC
 F -> DE

where the candidate keys are BC and AF, then again the F -> DE would mean that the relation violates 2NF. To be in 2NF would mean that there is no dependency on any part of any candidate key.