部分依赖(数据库) [英] Partial Dependency (Databases)

查看:75
本文介绍了部分依赖(数据库)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我提出了一个定义,即当字段间接依赖于主键或部分依赖但还依赖于依赖于主键的其他键时,部分依赖就是这样,如果删除了另一个字段所依赖的字段,则该依赖关系由于它依赖于主键,因此该字段仍将存在.我不确定是否正确.我已经研究过,每个定义听起来都具有误导性.我的定义正确吗?如果不是,那么

I fabricated a definition that a partial dependency is when fields are indirectly dependent on the primary key or partially dependent but are also dependent on other keys that depend on the primary such that if the field which another field depends on is deleted then that field will still exist due to its dependence on the primary key. I am not sure if it is correct. I have researched and every definition sounds misleading. Is my definition correct and if not what is?

推荐答案

在删除某个确定属性时,在关系中持有的FD(功能依赖项)是部分的,从而提供了在关系中持有的FD.不完全的FD已满.

A FD (functional dependency) that holds in a relation is partial when removing one of the determining attributes gives a FD that holds in the relation. A FD that isn't partial is full.

例如:如果{A,B}→{C}但也{A}→{C},则{C}在功能上部分取决于{A,B}.

Eg: If {A,B} → {C} but also {A} → {C} then {C} is partially functionally dependent on {A,B}.

例如:这是该示例条件所处的关系值.(当FD包含可能出现的每个值时,它都会包含一个关系变量.)

Eg: Here's a relation value where that example condition holds. (A FD holds in a relation variable when it holds in every value that can arise.)

A  B  C
1  1  1
1  2  1
2  1  1

具有以下条件的非平凡FD:{A,B}确定{C},{B,C},{A,C}&{A,B,C};{A},{B}&{}还要确定{C}.其中:{A,B}→{C}是{A}→{C},{B}→{C}的一部分.{}→{C};{A}→{C}&{B}→{C}是{}→{C}的一部分;其他人都吃饱了.

The non-trivial FDs that hold: {A,B} determines {C}, {B,C}, {A,C} & {A,B,C}; {A}, {B} & {} also determine {C}. Of those: {A,B} → {C} is partial per {A} → {C}, {B} → {C} & {} → {C}; {A} → {C} & {B} → {C} are partial per {} → {C}; the others are full.

功能依赖项X→Y是完全功能依赖项,如果从X删除任何属性A表示该依赖项不持有更多;也就是说,对于任何属性AεX,(X – {A})都不会从功能上确定Y.从函数X→Y是部分依赖项如果某些属性AεX可以从X移除,并且依赖性仍然成立;也就是说,对于某些AεX,(X – {A})→Y.

A functional dependency X → Y is a full functional dependency if removal of any attribute A from X means that the dependency does not hold any more; that is, for any attribute A ε X, (X – {A}) does not functionally determine Y. A functional dependency X → Y is a partial dependency if some attribute A ε X can be removed from X and the dependency still holds; that is, for some A ε X, (X – {A}) → Y.

-数据库系统基础第六版Ramez Elmasri&纳瓦特(Navathe)

-- FUNDAMENTALS OF Database Systems SIXTH EDITION Ramez Elmasri & Navathe

请注意,FD是完整的还是部分的并不取决于CK(候选密钥),更不用说一个可能称为PK(主密钥)的CK了.

Notice that whether a FD is full vs partial doesn't depend on CKs (candidate keys), let alone one CK that you might be calling the PK (primary key).

(2NF的定义是每个非CK属性都由每个CK完全功能地确定.请注意,唯一的CK是{A,B}&唯一的非CK属性C部分依赖于它,因此值不是2NF,实际上是组件/投影到{A,B}和{A,C}到{A,B}和{B,C}到{A,B}和{C}.)

(A definition of 2NF is that every non-CK attribute is fully functionally determined by every CK. Observe that the only CK is {A,B} & the only non-CK attribute C is partially dependent on it so this value is not in 2NF & indeed it is the lossless join of components/projections onto {A,B} & {A,C}, onto {A,B} & {B,C} & onto {A,B} & {C}.)

(请注意,教科书中对传递式FD"的定义并没有定义与传递式FD"的标准定义相同的事物.)

(Beware that that textbook's definition of "transitive FD" does not define the same sort of thing as the standard definition of "transitive FD".)

这篇关于部分依赖(数据库)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆