关于关系(R,N,S,C,X,P)的第二范式的困惑 [英] A confusion about 2nd normal form for relation (R,N,S,C,X,P)

查看:116
本文介绍了关于关系(R,N,S,C,X,P)的第二范式的困惑的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在GATE试卷中,我有一个要解决的问题,希望得到您的帮助。

In a GATE question paper, I got a question to solve and I want your help to solve it.

我有关系

E =(R,N,S,C,X,P)

E=(R,N,S,C,X,P)

我有一些FD

P-> C,X

S-> P

C-> P

X-> P

P->C,X
S->P
C->P
X->P

根据答案,该关系为2NF,但我未能得到。据我说,它的主键是NSR,并且S-> P不支持2NF条件。您能帮我吗?

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?

推荐答案

没有FD(功能依赖项)确定R,N或S,因此它们必须是素数,即在每个CK(候选密钥)中。它们确定所有其他属性,因此RNS是CK。任何其他CK都必须包含RNS但不包含较小的超键,因此没有其他CK。遵循针对CK的算法,可以机械地获得它们。

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.

此关系不在2NF中。对于Codd的定义,违反或矛盾 2NF的FD是RNS-> P,因为它是部分依赖 CK上的非素数属性。当显示RNS-> P是部分依赖项时,可以使用S-> P,但S-> P并不违反2NF。 (而且S-> P不是部分。)对于此定义,S-> P违反了。

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.

(说FD违反NF实际上是一种草率的语言。实际上是FD违反了所有FD的组合。说FD违反了NF就是说FD违反了特定定义的特定要求,该定义和要求可以理解但没有说出来。)

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

这篇关于关于关系(R,N,S,C,X,P)的第二范式的困惑的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆