当属性与任何其他属性无关时,如何分解BCNF

时间:2017-04-03 09:48:11

标签: database database-normalization bcnf

作业:

  

考虑关系(,,,,,,)及其FD集= {→,→,→,→,→,→}。   如果它不在BCNF中,则将其分解为BCNF关系的集合。确保你的分解是无损连接。

解释

嗨,我正在处理我的数据库作业(关系设计章节)。 我想我已经根据课堂示例指导了基本流程。 然而,这里棘手的部分是我们有一个属性' H'与他人无关,这让我深感困惑。我该怎么处理呢?

尝试回答

•   We start from a schema: ABCDEGH, since H has no relations with any attribute, we decompose it into tables: H and ABCDEG
•   The FDs for ABCDEG remains the same, therefore key is E.
•   The FD D →AG violates BCNF (FD with non-key on LHS).
•   To fix, we need to decompose into tables: ADG and BCDE
•   FDs for ADG are { D → AG }, therefore key is D, therefore BCNF.
•   FDs for BCDE are { B → CD,  E → D,  BC → DE, E → B, CD → BE }
•   Key for BCDE is also E, and FD B → CD violates BCNF (FD with non-key on LHS).
•   To fix, we need to decompose into tables: BCD and BE
•   FDs for BCD are { B → CD } therefore key is B, therefore BCNF.
•   FDs for BE are { E → B } therefore key is E, therefore BCNF.
•   Final schema:  H, ADG, BCD, BE

您对我的错误有何看法?

1 个答案:

答案 0 :(得分:1)

你的第一颗子弹错了。如果您使用具有正确BCNF分解算法的已发布学术教科书的参考文献,那么它就不会有这一步骤。