A confusion about 2nd normal form for relation (R,N,S,C,X,P)

眉间皱痕 提交于 2019-12-11 04:59:23

问题


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?


回答1:


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



来源:https://stackoverflow.com/questions/45188362/a-confusion-about-2nd-normal-form-for-relation-r-n-s-c-x-p

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!