patternMinor
Questions regarding second normal form
Viewed 0 times
questionsregardingnormalsecondform
Problem
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 ?
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 ?
Solution
If all your dependencies are those you have shown:
Your only candidate key is
Therefore, the
For the other question, if you had for example these dependencies:
where the candidate keys are
{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 -> DEwhere 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.Code Snippets
BC -> AF
AF -> BC
F -> DEContext
StackExchange Database Administrators Q#45479, answer score: 4
Revisions (0)
No revisions yet.