简体   繁体   English

博伊斯·科德范式

[英]Boyce-Codd Normal Form

I do not understand Boyce-Codd Normal Form. 我不了解博伊斯·科德范式。 I looked at my textbook but I do not understand it. 我看了看课本,但听不懂。 Let's say relation R = (A,B,C,D,E) and F={A->C, D->CB, AC->E}. 假设关系R =(A,B,C,D,E)且F = {A-> C,D-> CB,AC-> E}。 How do you determine if R is in BCNF? 您如何确定R是否在BCNF中? Need help. 需要帮忙。 Thanks! 谢谢!

To determine if a relation is BCNF we examine it's functional dependencies. 为了确定某个关系是否为BCNF,我们检查它的功能依赖性。

It is in BCNF if for each FD X→Y, we either have 对于每个FD X→Y,我们都有BCNF

  • X→Y is a trivial functional dependency (Y ⊆ X) X→Y是琐碎的函数依存关系(Y⊆X)
  • X is a superkey for schema R. X是架构R的超键。

The FDs are A→C, D→CB, AC→E. FD为A→C,D→CB,AC→E。 Let's start with the first FD A→C. 让我们从第一个FD A→C开始。

A→C is not trivial because C ∉ A. A→A is trivial dependency for instance. A→C不平凡,因为C∉A。A→A是平凡的依存关系。

Now is A→C a superkey? 现在A→C是超级键吗? To check that we compute the closure of left hand side of the FD, in this case A. The closure is all elements logically implied by A. [A]+ = A ∪ C ∪ E = ACE or so we have A→ACE. 为了检查我们是否计算了FD左手边的闭合,在这种情况下为A。闭合是A逻辑上隐含的所有元素。[A] + = A∪C∪E = ACE或因此我们有A→ACE。

ACE is not a superkey, because it does contain all attributes of the relation. ACE不是超键,因为它确实包含关系的所有属性。

So the relation is not in BCNF, because A→C is neither trivial or a superkey. 因此该关系不在BCNF中,因为A→C既不重要也不是超键。

There are other violations of BCNF too. 还有其他违反BCNF的行为。 [D]+ = BCD which is not a superkey or trivial. [D] + = BCD,它不是超键也不是琐碎的。 [AC]+ = ACE which is not a superkey or trivial. [AC] + = ACE,它不是超键也不是琐碎的。

Hope this helps! 希望这可以帮助! I think everything is correct but I'm studying for finals right now and trying to learn a lot of this material as well. 我认为一切都是正确的,但是我现在正在研究决赛,并尝试学习很多此类材料。

Informally, you first identify all the candidate keys. 非正式地,您首先确定所有候选键。 Then you look at the arrows in the functional dependencies. 然后,您查看功能依赖项中的箭头。

If every arrow is an arrow out of a candidate key, it's in BCNF. 如果每一个箭头的箭候选键,它在BCNF。

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

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