简体   繁体   English

归一化3NF和BCNF

[英]Normalization 3NF and BCNF

If I have the following relation R = (A, B, C, D) 如果我有以下关系R =(A,B,C,D)

And the functional dependencies: 和功能依赖:

  • A -> B, B -> A, CDB -> A, CDA -> B A - > B,B - > A,CDB - > A,CDA - > B.

The candidate keys are CDA and CDB . 候选键是CDACDB

The third normal form says that there can not be a functional dependency between non-prime attributes. 第三种常规形式表示非主要属性之间不存在功能依赖性。 A non-prime attribute is an attribute that doesn't occur in one of the candidate keys. 非素数属性是在其中一个候选键中不出现的属性。 Then that means that this relation already is 3NF since both A and B, that depend on each other, are part of one of the candidate keys, am I right? 那意味着这个关系已经是3NF,因为A和B之间相互依赖,是其中一个候选键的一部分,对吗?

If so, I have another question about BCNF. 如果是这样,我还有另一个关于BCNF的问题。 BCNF says that every determinant must be a candidate key. BCNF表示每个决定因素必须是候选键。 In this case, A and B are not candidate keys, so that violates BCNF, or am I missing something here? 在这种情况下,A和B不是候选键,因此违反了BCNF,或者我在这里遗漏了什么?

Thanks. 谢谢。

If the three FDs you have given are supposed to be a canonical cover of the FDs satisfied by R then you are right to conclude that CDA and CDB must be candidate keys. 如果你给出的三个FD应该是R满足的FD的规范封面那么你就可以得出结论,CDA和CDB必须是候选密钥。 (You didn't state the FDs are canonical and if not then there are other ways to satisfy the same dependencies but I guess the intent of the question is that the candidate keys must be inferred only from what you are given.) (您没有声明FD是规范的,如果没有,那么还有其他方法来满足相同的依赖关系,但我想问题的意图是候选键必须仅根据您给出的内容推断。)

If CDA and CDB are in fact the candidate keys of R then you are right that R satisfies 3NF but not BCNF. 如果CDA和CDB实际上是R的候选键,那么你是对的,R满足3NF但不满足BCNF。

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

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