问题描述
让R(A,B,C,D,E)是一个关系模式,F = {A→C,B→D,C→E,E→A},查找所有候选键。
Let R(A,B,C,D,E) be a relation schema and F = {A→C, B→D, C→E, E→A}, Find all candidate keys.
我认为由于无法映射,因此该集合中不存在CK。 B或D与B-> D之外的任何其他关系。这是否意味着没有候选密钥?
I believe that there exists no CK's in this set due to not being able to map. B or D to any other relation besides B -> D . Does this mean that that there are no Candiate Keys? Although I am able to map A to all other entities besides B and D.
推荐答案
有三个候选键。
B不会出现在任何功能依赖项的右侧。这意味着B必须是每个候选键的一部分。我认为单独不能保证至少有一个候选密钥,但是从检查中可以清楚看出AB是这里的三个候选密钥之一。
B doesn't appear on the right-hand side of any functional dependency. That means B must be part of every candidate key. I think that alone doesn't guarantee there is at least one candidate key, but it should be clear from inspection that AB is one of the three candidate keys here.
您的教科书应至少包括一种用于确定所有候选键集的算法。如果幸运的话,它包括一种适用于纸张和铅笔的算法,另一种适用于通过编程实现自动化的算法。
Your textbook should include at least one algorithm for determining the set of all candidate keys. If you're lucky, it includes one algorithm suitable for paper and pencil, and another suitable for automation by programming.
这篇关于使用功能依赖性确定候选键很简单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!