In a GATE question paper, I got a question to solve and I want your help to solve it.
I have a relation
E=(R,N,S,C,X,P)
And I have some FDs
P->C,X
S->P
C->P
X->P
According to the answer, the relation is in 2NF but I failed to get that. According to me, its primary key is NSR and S->P IS NOT SUPPORTING 2NF CONDITIONS. Could you help me with this?
None of the FDs (functional dependencies) determines R, N or S, so they must be prime, ie in every CK (candidate key). They determine all other attributes, so RNS is a CK. Any other CK would have to contain RNS but not contain a smaller superkey, so there are no other CKs. Following an algorithm for CKs gives them mechanically.
This relation is not in 2NF. For Codd's definition, the FD that "violates" or "contradicts" 2NF is RNS->P, because it is a partial dependency of a non-prime attribute on a CK. You can use S->P when showing that RNS->P is a partial dependency, but S->P is not what violates 2NF. (And S->P is not partial.) For this definition, S->P is in violation.
(It's actually sloppy language to say that a FD violates a NF. Really it's the combination of all the FDs that violates it. Saying that an FD violates a NF is short for saying that the FD violates a particular requirement of a particular definition, where the definition & requirement are understood but unspoken.)