多值依赖性违例? [英] Multivalue Dependency violation?

查看:139
本文介绍了多值依赖性违例?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我很困惑关于mvd违规,只是我不能弄清楚任何会违反mvd,例如有ABC三列,每一行是一个元组



ABC



a2 b2 c1

a1 b1 c2

a1 b1 c3

a2 b3 c1

B - >> C and B - >> A?





感谢

解决方案

MVD 。它适用于您的业务案例或不是,您需要检查要求和/或规格,以了解。



您不知道它是否适用于从



查看示例数据只能告诉你,如果规则适用,则此数据将有效/无效或如果该数据必须有效,那么某些特定的MVD规则肯定不会应用。



现在,这样的MVD规则状态



首先看一下FD的状态是什么。 FD陈述了对于某一[组]属性[s](FD的左侧),不能是某些特定的[组合]值与多于一个的[组合]相关联的情况,



A-> B实际上意味着对于所有属性值对(a1,b1)和(a2,b2),它认为a1 = a2 ===> b1 = b2。MVD是FD的一般化,其不表示状态 B值必须与A值相关联/由A值确定,而是它表示 B值的SETS必须与A值相关联/由A确定



(警告:此处从A / B切换到B / C)



在您的示例中,b2是 与集合{c1},并且值b1与集合{c2,c3}关联。现在如果MVD B - >> C确实适用,那么除非a4,b1,c3行同时出现,否则不应该在表中出现一行a4,b1,c2。同样,如果你有这两个额外的行,并且添加a1,b1,c4,这将添加c4的值是多由值b1的集合,因此,你的MVD将被违反,除非你还要添加a4,b1,c4。


i am confused about mvd violation, simply i cant figure out anything that will violate mvd, for example there are A B C three columns, each row is a tuple

A B C

a2 b2 c1
a1 b1 c2
a1 b1 c3
a2 b3 c1

does B->>C and B->>A?

thanks

解决方案

An MVD, just like an FD, is a rule. It applies to your business case or not, you'll need to inspect the requirements and/or the specs in order to know.

You cannot know whether it applies from looking at sample data (that applies to FD's as well).

Looking at sample data can only tell you, "if the rule applies, then this data will be valid/invalid", or "if this data must be valid, then some particular MVD rule certainly won't apply".

Now what does such an MVD rule state exactly ?

First take a look at what an FD states exactly. An FD states that for a certain [set of] attribute[s] (the Left side of the FD), it cannot be the case that some particular [combination of] value[s] is associated with more than one [combination of] distinct value[s] of the attributes on the Right hand side of the FD.

A->B indeed means that for all attribute value pairs (a1,b1) and (a2,b2), it holds that a1=a2 ===> b1=b2.

An MVD is a generalization of an FD, in that it does not state that individual B values must be associated with/determined by A values, but instead it states that SETS of B values must be associated with/determined by A values.

(warning : switching from A/B to B/C here !)

In your example, b2 is "associated" with the set {c1}, and the value b1 is "associated" with the set {c2,c3}. Now if the MVD B->>C applies indeed, then it should be impossible for a row a4,b1,c2 to appear in your table unless the row a4,b1,c3 also appears, simultaneously. Likewise, if you have those two additional rows, and you add a1,b1,c4, this will "add" c4 to the set of values that are "multidetermined by" the value b1, and consequently, your MVD will be violated unless you also add a4,b1,c4.

这篇关于多值依赖性违例?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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