BCNF分解过程 [英] BCNF decomposition process

查看:397
本文介绍了BCNF分解过程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这些依赖项的BCNF分解是什么?

  A-> BCD 
BC-> DE
B-> D
D-> A

我们可以先将关系 R c>到3NF然后到BCNF。



要转换关系 R 和一组函数依赖code> FD's )转换为 3NF ,您可以使用 Bernstein's Synthesis 。要应用Bernstein的综合 -




  • 首先,确保给定的 / $>
  • 第三,我们尝试合并这些子模式



  • R = {A,B,C,D,E}

    FD's = {A-> BCD,BC-> DE,B-> D,D-> A}



    首先会检查 FD的是否为最小封面 - 手侧,无外部左侧属性,无冗余FD )




    • :我们使用单例RHS编写FD。所以现在我们有FD = {A-> B,A-> C,A-> D,BC-> D,BC-> E,B-> D,D-> A}

    • 没有无关的LHS属性:我们从FD BC-> D 中移除了额外的LHS属性 C code>和 BC-> E 。所以现在我们有FD's为{A-> B,A-> C,A-> D,B-> D,B-> E,B-> D,D-> A}

    • 无冗余FD:我们删除了冗余依赖关系。现在FD是{A-> B,A-> C,B-> D,B-> E,D-> A}



    第二,我们使每个 FD 自己的子模式。现在我们有 - (每个关系的键都是粗体



    R 1 { A ,B}

    R 2 = { A ,C}

    R < sub> 3 = { B ,D}

    R 4 br>
    R 5 = { D ,A}



    第三,我们看到是否可以组合任何子模式。我们看到 R 1 R 2 具有LHS,因此可以合并。同样,可以合并 R 3 R 4 。现在我们有 -



    S 1 = { A ,B,C}

    S 2 = { B ,D,E}

    S 3 = { D ,A}



    这在 3NF 。现在检查 BCNF ,我们检查是否有任何这些关系(S <1> ,S 2 ,S 3 违反 BCNF 个功能依赖 X-> Y 左侧( X 必须 超级键 )。在这种情况下,这些都不会违反 BCNF ,因此也会分解为 BCNF


    What is the BCNF decomposition for these dependencies?

    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.

    To convert a relation R and a set of functional dependencies(FD's) into 3NF you can use Bernstein's Synthesis. To apply Bernstein's Synthesis -

    • First we make sure the given set of FD's is a minimal cover
    • Second we take each FD and make it its own sub-schema.
    • Third we try to combine those sub-schemas

    For example in your case:

    R = {A,B,C,D,E}
    FD's = {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)

    • Singleton RHS: We write the FD's with singleton RHS. So now we have FD's as {A->B, A->C, A->D, BC->D, BC->E, B->D, D->A}
    • No extraneous LHS attribute: We remove the extraneous LHS attribute C from FD BC->D and BC->E. So now we have FD's as {A->B, A->C, A->D, B->D, B->E, B->D, D->A}
    • No redundant FD's: We remove the redundant dependencies. Now FD's are {A->B, A->C, B->D, B->E, D->A}

    Second we make each FD its own sub-schema. So now we have - (the keys for each relation are in bold)

    R1={A,B}
    R2={A,C}
    R3={B,D}
    R4={B,E}
    R5={D,A}

    Third we see if any of the sub-schemas can be combined. We see that R1 and R2 have the LHS so they can be combined. Similarly R3 and R4 can be combined. So now we have -

    S1 = {A,B,C}
    S2 = {B,D,E}
    S3 = {D,A}

    This is in 3NF. Now to check for BCNF we check if any of these relations (S1,S2,S3) violate the conditions of BCNF (i.e. for every functional dependency X->Y the left hand side (X) has to be a superkey) . In this case none of these violate BCNF and hence it is also decomposed to BCNF.

    这篇关于BCNF分解过程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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