数据库无关的属性和分解 [英] Database extraneous attributes and decomposition
问题描述
我是那种对外部属性的概念,并适当分解成3NF的困惑。
I am kind of confused on the notion of extraneous attributes and a proper decomposition into 3NF.
例如,我有如下关系:
r(A,B,C,D,E,F)
F = FD's
F = {A-> BCD, BC-> DE, B->D, D->A}
我要计算规范覆盖为了使用一种算法来分解成3NF。所以,我必须从FD的删除多余的属性。
I want to compute the canonical cover in order to decompose it into 3NF using an algorithm. So I have to remove extraneous attributes from the FD's.
我计算 A +。 B +,C +,D +(A + = ABCDE,B + = BD,C + = C,D + = AD)
我开始试图找到多余的属性。首先我看了看属性,在β
I computed A+. B+, C+, D+ (A+ = ABCDE, B+ = BD, C+ = C, D+ = AD)
I started trying to find extraneous attributes. First I looked at attributes in β
我试图找到,如果D是多余的。
I tried to find if D is extraneous in
BC - > DE
BC -> DE
和使用BC +我发现D是多余的(自公元前+包含属性D)。
所以,现在我的FD从 BC改变 - > DE公元前 - > Ë
现在,我试图来计算α无关的属性。
and using BC+ I found D is extraneous (Since BC+ contains the attribute D).
So now my FD changed from BC -> DE to BC -> E
Now I tried to compute extraneous attributes for α.
我看看,如果B或C是FD无关 BC - > DE
(计算B +和C +导致我既不B或C是多余的,因为他们没有包含E)。
I looked to see if B or C is extraneous in FD BC -> DE
(Computing B+ and C+ led me to neither B or C being extraneous since none of them contain E).
我也看了无关的一个原因 - > BCD,发现两个B和C是多余的(因为A +包含全部属性)。所以我留下了以下内容:
I also looked at extraneous attributed in A -> BCD and found both B and C to be extraneous (Since A+ contains all attributes). So I was left with following:
A -> D
BC -> E
B -> D
D -> A
对不起,极长的问题,我只是想写下我做了什么。
Sorry for the extremely long question, I just wanted to write down what I did.
我很困惑,如果这是正确的,或者如果我连这样做正确。我试图遵循一些注意事项和一些网上的参考,但它会很高兴,如果有人能指出,如果我这样做的权利,如果不尝试,并解释有所为准确地找到多余的属性和分解。
I am confused as to if this is correct or if I am even doing this correctly. I am trying to follow some notes and some online references but it would be nice if someone could point out if I am doing this right and if not try and explain somewhat as to properly find extraneous attributes and decomposing.
推荐答案
你的一些封锁是错误的(B + = ABCDE,例如由于B-> D,D-> A,A-> BCD,BC-> DE)。
Some of your closures are wrong (B+ = ABCDE, for instance due to B->D,D->A,A->BCD,BC->DE).
B和C不在A-> BCD无关。事实上,关闭关于
B and C are not extraneous in A->BCD. Indeed, the closure of A with respect to
{A - > D,BC - > E,B - > D,D - > A}
{A -> D, BC -> E, B -> D, D -> A}
是广告,而不是ABCDE。
is AD rather than ABCDE.
因此,让我们回溯到您的previous步:
So let us backtrack to your previous step:
{A-> BCD,BC-> E,B-> D,D-> A}
{A-> BCD, BC-> E, B->D, D->A}
D为A-> BCD多余的,因为A-> B和B->Ð。我们消除d从A-> BCD并获得:
D is extraneous in A->BCD since A->B and B->D. We eliminate D from A-> BCD and obtain:
{A-> BC,BC-> E,B-> D,D-> A}
{A-> BC, BC-> E, B->D, D->A}
C为BC->电子无关。事实上,B-> D,D-> A,A-> BC。因此,
C is extraneous in BC->E. Indeed, B->D, D->A, A-> BC. Hence,
{A-> BC,B-> E,B-> D,D-> A}
{A-> BC, B-> E, B->D, D->A}
接下来,我们将所有的FDS具有相同左边:
Next we combine all fds with the same left-hand side:
{A-> BC,B-> DE,D-> A}
{A-> BC, B-> DE, D-> A}
这组函数依赖中不包含冗余依赖或外来属性,因此,是一个典型的封面。
This set of functional dependencies does not contain redundant dependencies or extraneous attributes, and, hence, is a canonical cover.
这篇关于数据库无关的属性和分解的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!