主要属性和部分依赖说明

Prime attributes and Partial Dependencies clarification

当我看到这个我认为是错误的例子时,我正在浏览我的讲座幻灯片。我的讲师无法澄清。如果能得到一些说明,我将不胜感激。

R = (A, B, C)
Functional Dependencies = (A -> B, B -> A)

上面的例子说明了上面的最高范式是1NF,因为A->B形成了部分依赖。

我的解决方案:

AC -> BC (via augmentation axiom)
BC -> AC (via augmentation axiom)

(A,C) and (B,C) are minimal keys and (A, B, C) are prime attributes.

我这样说对吗:

If (A,C) is the primary key, A -> B is NOT partial FD as RHS is a prime 
attribute. B -> A is a non trivial FD as LHS is not a candidate key.

我讲师的解释是,如果选择 (A, C) 作为主键,我们不必将 (B,C) 视为键,如果 B 不是主属性,因此部分依赖看台

假设给定的函数依赖是关系模式的所有函数依赖的覆盖,正如您所发现的那样,呈现的模式是 3NF。事实上,唯一的候选键是 (A, C)(B, C),所以每个属性都是质数,并且根据定义,关系在 3NF 中。 (请注意,主要属性取决于候选键,而不是主键)。

通常,如果 Y 也依赖于 X。 (更准确地说,Y 部分依赖 X。候选键。在这种情况下,您说 A → B 是非部分依赖是正确的(但不是因为 B 是主要属性。例如,B 是 而不是 完全依赖于候选键A C(因为在F+中存在部分依赖A C → B)。然而,事实上B是一个素数属性暗示模式在 2NF 中。

换句话说,鉴于前面部分依赖的定义,关于你的这部分问题:

Am I correct to say this:

If (A,C) is the primary key, A → B is NOT partial FD as RHS is a prime attribute. B → A is a non trivial FD as LHS is not a candidate key.

我们可以这样说:

  1. A → B 是非部分依赖不是因为 B 是素数,而是因为 {A} 的真子集不能确定 B

  2. B → A 不是平凡的,不是因为 LHS 不是候选键,而是因为 {A} 不是 {B}.

    的子集

最后一点,关系不是 Boyce-Codd 范式。遵循该范式的分解是 R1(A, B)R2(A C).