gpt4 book ai didi

database - 3NF 的两个定义是否相等?

转载 作者:搜寻专家 更新时间:2023-10-30 20:24:15 24 4
gpt4 key购买 nike

来自 3rd Normal Form Definition :

A database is in third normal form if it satisfies the following conditions:

  • It is in second normal form.
  • There is no transitive functional dependency.

By transitive functional dependency, we mean we have the following relationships in the table: A is functionally dependent on B, and B is functionally dependent on C. In this case, C is transitively dependent on A via B.

我的讲师给了我们 3NF 的第二次辩护:

Non-prime attributes cannot depend on any set that isn't a super-key (transitive dependency).

3NF 的两个定义是否相等?为什么?

最佳答案

假设存在一个属性 X,它依赖于一组不是 super 键的属性。这意味着 X 所依赖的集合至少包含一个不属于 super key 的属性 np1。但是 np1 又会依赖于 super key 。因为 np1 依赖于 Super-Key,所以以下一项(且仅一项)为真:

A. X 仅取决于 super key => 这与我们最初的假设相矛盾

B. X 仅依赖于 np1 => 这引入了传递依赖

如果 X 真的同时依赖于 SK 和 np1,那么 [SK, np1] 将成为 super 键——这是不可能的。

所以唯一可能的结论是这两个定义是相等的。

关于database - 3NF 的两个定义是否相等?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45649166/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com