3NF 的两个定义是否相等?
Are both definitions to 3NF equal?
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 的两个定义是否相等?为什么?
两者都是相似的陈述,但第二个被改进,因此更吸引人。
Specifically: a relation is in 2NF if it is in 1NF and no non-prime attribute is dependent on any proper subset of any candidate key of the relation. A non-prime attribute of a relation is an attribute that is not a part of any candidate key of the relation.
候选键是一个超级键,不能从中删除更多属性。
突出显示的部分给出的结论是数据库是 2NF 形式(那是你的第一个摘录)
让我们假设存在一个属性 X
,它依赖于一组不是超级键的属性。这意味着 X
所依赖的集合至少包含一个不属于超级密钥的属性 np1
。但是 np1
又会依赖于超级密钥。
因为 np1
依赖于 Super-Key,所以以下一项(且仅一项)为真:
A. X
只依赖于 Super-Key => 这与我们最初的假设相矛盾
或
B. X
只依赖于 np1
=> 这引入了一个传递依赖
如果 X 真的同时依赖于 SK 和 np1,那么 [SK, np1] 将成为超级密钥 - 这是不可能的。
所以唯一可能的结论是这两个定义是相等的。
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 的两个定义是否相等?为什么?
两者都是相似的陈述,但第二个被改进,因此更吸引人。
Specifically: a relation is in 2NF if it is in 1NF and no non-prime attribute is dependent on any proper subset of any candidate key of the relation. A non-prime attribute of a relation is an attribute that is not a part of any candidate key of the relation.
候选键是一个超级键,不能从中删除更多属性。
突出显示的部分给出的结论是数据库是 2NF 形式(那是你的第一个摘录)
让我们假设存在一个属性 X
,它依赖于一组不是超级键的属性。这意味着 X
所依赖的集合至少包含一个不属于超级密钥的属性 np1
。但是 np1
又会依赖于超级密钥。
因为 np1
依赖于 Super-Key,所以以下一项(且仅一项)为真:
A. X
只依赖于 Super-Key => 这与我们最初的假设相矛盾
或
B. X
只依赖于 np1
=> 这引入了一个传递依赖
如果 X 真的同时依赖于 SK 和 np1,那么 [SK, np1] 将成为超级密钥 - 这是不可能的。
所以唯一可能的结论是这两个定义是相等的。