简体   繁体   English

BCNF分解?

[英]BCNF Decomposition?

Given relation R(A,B,C,D,E) and FDs = {A->BC, CD->E, B->D, E->A} 给定关系R(A,B,C,D,E)FDs = {A-> BC,CD-> E,B-> D,E-> A}
While converting R into BCNF: 将R转换为BCNF时:

ABCDE -> BD & ABCE will be first decomposition ABCDE-> BD&ABCE将首先分解
BD is in BCNF BD位于BCNF中

Regarding ABCE: 关于ABCE:

Opinion 1: ABCE has FDs: A->BCE, E->ABC, BC->AE 意见1: ABCE有FD:A-> BCE,E-> ABC,BC-> AE
Therefore its already in BCNF 因此它已经在BCNF中

Opinion 2 ABCE has FDs: A->BC, E->ABC 意见2 ABCE具有FD:A-> BC,E-> ABC
Therefore needs to be decomposed into ABC & AE 因此需要分解为ABC和AE

I believe that first one should be correct because in second we are assuming that A->E and BC->E are not possible because D is not one of the attributes of the relation. 我相信第一个应该是正确的,因为在第二个中我们假设A-> E和BC-> E是不可能的,因为D不是关系的属性之一。 But I am not sure about it. 但是我不确定。
Please tell whether in ABCE A->E and BC->E will hold or not? 请说明在ABCE中A-> EBC-> E是否成立?

You have correctly identified the issue around which the problem revolves. 您已正确确定问题所围绕的问题。 That is, whether "BC->AE" indeed applies to ABCE or not. 也就是说,“ BC-> AE”是否确实适用于ABCE。 For it to apply to ABCE, it needs to be proved that it applies to the original, ABCDE. 为了使其适用于ABCE,需要证明其适用于原始的ABCDE。 Can you prove that ? 你能证明吗? (Hint : start with B->D from the original and augment with the trivial C->C to obtain BC->CD). (提示:从原始的B-> D开始,并用琐碎的C-> C进行扩充以获得BC-> CD)。

Important discussion now follows. 现在进行重要的讨论。 Please sit it out entirely. 请把它完全坐下来。

Now take a step back and see what happened to the schema/design upon the first decomposition. 现在退后一步,看看在第一次分解时架构/设计发生了什么。 That first decomposition singled out BD into its own table/schema. 第一次分解将BD分离到其自己的表/模式中。 That left the existing FD "CD->E" inexpressible in any of the remaining tables/schemas (in ABCE because that one doesn't have D, in BD because that one doesn't have ACE). 这使得现有的FD“ CD-> E”在其余任何表/方案中都无法表达(在ABCE中,因为一个人没有D,在BD中,因为一个人没有ACE)。 But the business rule that was expressed by this FD still applies. 但是此FD所表达的业务规则仍然适用。 What this means is that in the replacing design (the one with BD singled out), there is an extra constraint to be defined across the two tables, and this constraint must have the same effect on the combination of the two tables (their JOIN, that is) as the FD had on the original single-table design. 这意味着在替换设计(单选BD的设计)中,在两个表之间定义了一个额外的约束,并且该约束必须对两个表的组合具有相同的影响(它们的JOIN,也就是FD与原始单表设计一样。 That is, that constraint must enforce that in any JOIN of the two tables, it will never be the case that the same CD value combination appears alongside distinct (>1) E values. 也就是说,该约束必须强制在两个表的任何JOIN中都不会出现相同的CD值组合出现在不同的(> 1)E值旁边的情况。

The replacing design without the additional constraint, would never be perfectly equivalent to the original design with the FD included. 没有附加约束的替换设计永远不会完全等同于包含FD的原始设计。 But because the two designs are indeed supposed to be equivalent, you should be allowed to assume that this additional constraint is indeed in place (and the corresponding FD still "applies to the JOIN"). 但是,由于这两种设计确实应该是等效的,因此应该允许您假设确实存在此附加约束(并且相应的FD仍“适用于JOIN”)。 Pls note that I have personally never seen or heard that being stated explicitly. 请注意,我个人从未见过或听到过明确指出的内容。 Treatments of normalization theory tend to overlook additional constraints, even if they are equivalent to an FD that was given earlier on. 归一化理论的处理方法往往会忽略其他约束,即使它们等同于之前给出的FD。

If you could not make that assumption, and you are forced to look only at what the remaining FDs imply for the individual table they apply to, then there would be no way for you to prove that BC->AE holds in your ABCE table/schema. 如果您无法做出此假设,而您仅被迫查看剩余FD对它们所适用的单个表的暗示,那么您将无法证明BC-> AE在您的ABCE表/架构。 And you would be forced to conclude that option 2 is the correct answer. 您将不得不得出结论,选择2是正确的答案。

(Important conclusion here.) Alas, there is also a lot of poor teaching around, and it is nowhere near certain that all normalization theory courses take the same stance on such issues. (这里的重要结论。)可惜,周围的教学也很多,而且几乎可以肯定的是,所有归一化理论课程都对此类问题持相同的立场。 So although my conviction/opinion is that you were right, unfortunately my answer must be "it depends on how well your teacher understands normalization theory him/herself". 因此,尽管我的信念/观点是你是对的,但不幸的是,我的答案必须是“这取决于你的老师对他/她自己的归一化理论的理解程度”。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM