Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

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 ?

share|improve this question
    
Are C and F candidate keys by themselves? Or is their compound (C,F) a candidate key? –  ypercube Jun 30 '13 at 16:30
    
@ypercube C itself is a candidate key and F itself is a candidate key. –  the_critic Jun 30 '13 at 16:40
    
So, you also have C->ABDEFGHIJK and F->ABCDEGHIJK. I wonder why you haven't given these before, too. In this case, there is no part of a candidate key, all candidate keys have only one attribute. –  ypercube Jun 30 '13 at 16:43
    
@ypercube I tried to evaluate the NF of my given example here -> koffeinhaltig.com/fds/… which tells me that it is not in 2.NF, as attributes need to depend on both candidate keys... –  the_critic Jun 30 '13 at 16:49
1  
As in my previous comment, if all your dependencies are the ones you show in the question, then your only candidate key is CF. C and F are not. –  ypercube Jun 30 '13 at 16:54

1 Answer 1

up vote 4 down vote accepted

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.