多值依赖?

Multi-Valued Dependencies?

我在理解多值依赖性时遇到一些问题。定义是:当关系中至少有 3 个属性(如 X、Y 和 Z)并且对于 X 的值有一组明确定义的 Y 值和一组明确定义的 Z 值时,存在多值依赖关系. 然而,Y 的值集独立于 Z 集,反之亦然。

Suppose we have a relation R(A,B,C,D,E) that satisfies the MVD's
A →→ B and B →→ D

这里的 MVD 如何作用于 A->B 和 B->D?老实说,在看了示例问题后,我不确定我是否真的理解了定义。

If R contains the tuples (0,1,2,3,4) and (0,5,6,7,8), what other tuples must 
necessarily be in R? Identify one such tuple in the list below.


     a)     (0,5,2,3,8)
     b)     (0,5,6,3,8)
     c)     (0,5,6,7,4)
     d)     (0,1,6,3,4)

我本以为AB是0,1和0,5,BD是1,3和5,7。 None 个答案有 0、1、3、5、7。

MVD(多值依赖)与"at least 3 attributes"无关。 (你似乎在引用维基百科的文章,但那个非正式的定义部分是错误的,部分是难以理解的。)你需要阅读和思考一个清晰、准确和正确的定义。 (你可能已经得到了。)

MVD X ↠ Y 提到了所有属性的集合 S 的两个子集,X 和 Y。有很多方法可以定义 MVD 何时保持关系,但最简单的陈述和设想可能是这两个投影 XY 和 X(S-Y) 连接到原始关系。其中还提到了第三个子集 S-Y。这就是(二进制)JD(连接依赖){XY, X(S-Y)} 所说的。

维基百科(虽然那篇文章很乱):

  • A decomposition of R into (X, Y) and (X, R−Y) is a lossless-join decomposition if and only if X ↠ Y holds in R.

来自 :

MVDs always come in pairs. Suppose MVD X ↠ Y holds in a relation with attributes S, normalized to components XY & X(S-Y). Notice that S-XY is the set of non-X non-Y attributes, and X(S-Y) = X(S-XY). Then there is also an MVD X ↠ S-XY, normalized to components X(S-XY) & X(S-(S-XY)), ie X(S-XY) & XY, ie X(S-Y) & XY. Why? Notice that both MVDs give the same component pair. Ie both MVDs describe the same condition, that S = XY JOIN X(S-XY). So when an MVD holds, that partner holds too. We can write the condition expressed by each of the MVDs using the special explicit & symmetrical notation X ↠ Y | S-XY.

对于 R =

A,B,C,D,E
0,1,2,3,4
0,5,6,7,8
...

A ↠ B 告诉我们以下连接到 R:

A,B  A,C,D,E
0,1  0,2,3,4
0,5  0,6,7,8
...  ...

所以 R 至少有

A,B,C,D,E
0,1,2,3,4
0,1,6,7,8
0,5,2,3,4
0,5,6,7,8

其中两个是给定的,两个是新的但不是选择。

B ↠ D 告诉我们以下连接到 R:

B,D  A,B,C,E
1,3  0,1,2,4
5,7  0,5,6,8
...  ...

所以 R 至少有

A,B,C,D,E
0,1,2,3,4
0,5,6,7,8

我们已经知道了。

所以我们还不知道 R 中是否有任何选项。但我们现在知道 R 是

A,B,C,D,E
0,1,2,3,4
0,1,6,7,8
0,5,2,3,4
0,5,6,7,8
...

重复,A ↠ B 没有添加新的元组,但是 B ↠ D 现在给出了这个连接:

B,D  A,B,C,E
1,3  0,1,2,4
1,7  0,1,6,8
5,3  0,5,2,4
5,7  0,5,6,8
...  ...

并且该连接中的元组之一是选择 b) (0,5,6,3,8)

问题的措辞方式,他们可能希望您使用他们给您的定义,就像维基百科中的另外两个定义一样。有人说当

时 α ↠ β 在 R 中成立
  • [...] if we denote by (x, y, z) the tuple having values for α, β, R − α − β collectively equal to x, y, z, then whenever the tuples (a, b, c) and (a, d, e) exist in r, the tuples (a, b, e) and (a, d, c) should also exist in r.

(给出 "formal" 定义 "in more simple words" 的唯一意义是这是 也是 的定义。因为这实际上并不是释义它,因为它使用 R − α − β 而它使用 R − β。)

通过应用此规则从给定元组开始为 R 重复生成更多元组,我们最终生成 b) (0,5,6,3,8) 与上面所做的非常相似。

PS 我通常会建议您回顾导致您期待 "AB is 0,1 and 0,5 and BD is 1,3 and 5,7"(无论那是什么意思)或“0,1,3,5,7”的(不合理的)推理。但是您提供的 "definition" (来自维基百科)没有任何意义。所以我建议你考虑一下你用它做了什么。