[英]BCNF decomposition process
What is the BCNF decomposition for these dependencies? 这些依赖项的BCNF分解是什么?
A->BCD
BC->DE
B->D
D->A
What is the process to get to the answer? 得到答案的过程是什么?
We can first convert the relation R
to 3NF and then to BCNF. 我们可以先将关系
R
转换为3NF,然后转换为BCNF。
To convert a relation R
and a set of functional dependencies( FD's
) into 3NF
you can use Bernstein's Synthesis . 要将关系
R
和一组功能依赖项( FD's
)转换为3NF
,可以使用Bernstein的Synthesis 。 To apply Bernstein's Synthesis - 应用伯恩斯坦综合-
FD's
is a minimal cover FD's
集是最小覆盖范围 FD
and make it its own sub-schema. FD
并使其具有自己的子模式。 For example in your case: 例如,在您的情况下:
R = {A,B,C,D,E} R = {A,B,C,D,E}
FD's = {A->BCD,BC->DE,B->D,D->A} FD = {A-> BCD,BC-> DE,B-> D,D-> A}
First we check whether the FD's
is a minimal cover ( singleton right-hand side , no extraneous left-hand side attribute, no redundant FD ) 首先,我们检查
FD's
是否为最小覆盖率( 单例右侧,无多余左侧属性,无冗余FD )
C
from FD BC->D
and BC->E
. BC->D
和BC->E
删除了多余的LHS属性C
So now we have FD's as {A->B, A->C, A->D, B->D, B->E, B->D, D->A} Second we make each FD
its own sub-schema. 其次,我们使每个
FD
都有自己的子模式。 So now we have - ( the keys for each relation are in bold ) 现在我们有了-( 每个关系的键都以粗体显示 )
R 1 ={ A ,B} R 1 = { A ,B}
R 2 ={ A ,C} R 2 = { A ,C}
R 3 ={ B ,D} R 3 = { B ,D}
R 4 ={ B ,E} R 4 = { B ,E}
R 5 ={ D ,A} R 5 = { D ,A}
Third we see if any of the sub-schemas can be combined. 第三,我们看是否可以组合任何子模式。 We see that R 1 and R 2 have the LHS so they can be combined.
我们看到R 1和R 2具有LHS,因此可以合并。 Similarly R 3 and R 4 can be combined.
类似地, R 3和R 4可以组合。 So now we have -
所以现在我们有-
S 1 = { A ,B,C} S 1 = { A ,B,C}
S 2 = { B ,D,E} S 2 = { B ,D,E}
S 3 = { D ,A} S 3 = { D ,A}
This is in 3NF . 这是在3NF中 。 Now to check for BCNF we check if any of these relations (S 1 ,S 2 ,S 3 ) violate the conditions of BCNF ( ie for every functional dependency
X->Y
the left hand side ( X
) has to be a superkey ) . 现在检查BCNF,我们检查这些关系(S 1 ,S 2 ,S 3 )是否违反BCNF的条件( 即,对于每个函数依赖项
X->Y
,左手边( X
) 必须是超键 ) 。 In this case none of these violate BCNF and hence it is also decomposed to BCNF . 在这种情况下,这些都没有违反BCNF ,因此也分解为BCNF 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.