4NF,不带功能依赖项的多值依赖项 [英] 4NF, Multivalued Dependencies without Functional Dependencies

查看:88
本文介绍了4NF,不带功能依赖项的多值依赖项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

很抱歉提出一个问题,可能会考虑一个基本问题)

Sorry for asking a question one might consider a basic one)

假设我们有一个具有多值依赖关系的关系R(A,B,C,D,E) :

Suppose we have a relation R(A,B,C,D,E) with multivalued dependencies:

A->> B
B->> D。

A->>B B->>D.

关系R没有没有任何功能依赖性。
接下来,假设我们将R分解为4NF。

Relation R doesn't have any functional dependencies. Next, suppose we decompose R into 4NF.

我的考虑:

因为我们不这样做没有任何功能依赖性,唯一的关键就是所有属性(A,B,C,D,E)。我们可以通过两种方式分解关系R:

Since we don't have any functional dependencies, the only key is all attributes (A,B,C,D,E). There are two ways we can decompose our relation R:


  1. R1(A,B)R2(A,C,D,E)

  2. R3(B,D)R4(A,B,C,E)

我的问题是-这2次分解是否最终完成?由于没有多余的多值依赖项,因此看起来很像。还是我错过了什么?

My question is - are these 2 decompositions final? Looks like they are since there are no nontrivial multivalued dependencies left. Or am I missing something?

推荐答案


关系R没有任何功能依赖性。

Relation R doesn't have any functional dependencies.

您的意思是非平凡的FD(功能依赖性)。 (必须始终有琐碎的FD。)

You mean, non-trivial FDs (functional dependencies). (There must always be trivial FDs.)

假定R中的MVD(多值依赖项)是{A↠B,B↠D的可传递闭包中的那些。 }:

Assuming that the MVDs (multivalued dependencies) holding in R are those in the transitive closure of {A ↠ B, B ↠ D}:

在1个R1(A,B)R2(A,C,D,E)中,我们可以将R重建为R1 JOIN R2,并且R1& R2在4NF中,并且它们的连接将满足A↠B。如果某个组件包含其他MVD的所有属性,则可以根据该MVD对其进行进一步分解。我们知道,给定所有组件的某些所谓值,它们通过连接而重构的R可以满足两个MVD。但是这里没有这样的组件。因此,我们无法进一步分解。并且,我们知道通过连接而实现的R的所谓重构满足A↠B,但是我们仍然必须检查B↠D。我们说MVD B↠D是未保留的,并且分解为R1&A。 R2不保留MVD。

In 1 R1(A,B) R2(A,C,D,E), we can reconstruct R as R1 JOIN R2 and both R1 & R2 are in 4NF and their join will satisfy A ↠ B. If some component contained all the attributes of the other MVD then we could further decompose it per that MVD. And we would know that, given some alleged values for all components, their alleged reconstruction of R by joining would satisfy both MVDs. But here there is no such component. So we can't further decompose. And we know that an alleged reconstruction of R by joining satisfies A ↠ B but we would still have to check whether B ↠ D. We say that the MVD B ↠ D is "not preserved" and the decomposition to R1 & R2 "does not preserve MVDs".

在2个R3(B,D)R4(A,B,C,E)中,我们可以将R重构为R3 JOIN R4以及R3和R4在4NF中,连接将满足B BD。现在,某个组件包含其他MVD的所有属性,因此我们可以根据该MVD对其进行进一步分解。而且我们知道,鉴于所有组件的某些所谓价值,他们通过加入R的所谓R重构满足了两个MVD。该组件是R4,我们可以对其进行进一步分解,将其重构为AB JOIN ACE。而且我们知道,通过加入R进行的所谓的重构同时满足A↠B和A。 B↠D。因为原始MVD出现在组件中,所以我们说这些分解保留了MVD。

In 2 R3(B,D) R4(A,B,C,E), we can reconstruct R as R3 JOIN R4 and both R3 & R4 are in 4NF and the join will satisfy B ↠ D. Now some component contains all the attributes of the other MVD so we can further decompose it per that MVD. And we know that, given some alleged values for all components, their alleged reconstruction of R by joining satisfies both MVDs. That component is R4, which we can further decompose, reconstructing as AB JOIN ACE. And we know that an alleged reconstruction of R by joining satisfies both A ↠ B & B ↠ D. Because the MVDs in the original appear in a component, we say these decompositions "preserve MVDs".

PS 1 分解必须分为三个部分

PS 1 The 4NF decomposition must be to three components

MVD总是成对出现。假设MVD X↠Y与属性S保持关系,并归一化为分量XY&A。 X(S-Y)。请注意,S-XY是非X非Y属性的集合,并且X(S-Y)= X(S-XY)。然后还有一个MVD X↠S-XY,归一化为分量X(S-XY)&。 X(S-(S-XY)),即X(S-XY)& XY,即X(S-Y)& XY。为什么?请注意,两个MVD提供相同的组件对。即,两个MVD描述相同的条件,即S = XY JOIN X(S-XY)。因此,当MVD成立时,该合伙人也持有。我们可以使用特殊的显式&来写每个MVD表示的条件。对称符号X↠Y | S-XY。

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.

我们说,当且仅当它们连接到S时,S的某些组件的JD(联接依赖项)成立。因此,如果S = XY JOIN X( SY)= XY JOIN X(S-XY),则JD * {XY,X(S-XY)}成立。即,两个MVD描述的条件是JD。因此,某个MVD和某个二进制JD对应。这是了解为什么规范化MVD涉及2向联接以及MVD成对出现的一种方式。导致4NF关系不在5NF中的JD是那些 not 与MVD不对应的JD。

We say a JD (join dependency) of some components of S holds if and only if they join to S. So if S = XY JOIN X(S-Y) = XY JOIN X(S-XY) then the JD *{XY, X(S-XY)} holds. Ie the condition that both MVDs describe is that JD. So a certain MVD and a certain binary JD correspond. That's one way of seeing why normalizing an MVD away involves a 2-way join and why MVDs come in pairs. The JDs that cause a 4NF relation to not be in 5NF are those that do not correspond to MVDs.

您的示例涉及到两个MVD,它们不是合作伙伴两者都不存在,因此,您知道无损分解的最终形式将涉及两个连接,每个MVD对一个。

Your example involves two MVDs that aren't partners & neither otherwise holds as a consequence of the other, so you know that the final form of a lossless decomposition will involve two joins, one for each MVD pair.

PS 2 含糊不清假设我们与这些多值依赖项有关系

PS 2 Ambiguity of "Suppose we have a relation with these multi-valued dependencies"

在按每个 FD 分解时(功能依存关系),通常为我们提供关系规范/最小覆盖,即以某种形式存在的集合,其在阿姆斯特朗公理下的传递闭包(因此必须保持的FD集合) )拥有该关系中的所有FD。当我们被告知某些FD成立时,这常常被忘记。我们必须给该关系一个规范的/最小覆盖率,或者给我们一个任意集,并告诉我们保持该关系的FD是其传递闭合中的FD。如果只给我们一组保留的FD,那么我们知道传递闭包中的FD可以保留,但是可能还有其他。因此,通常我们无法对其进行归一化。

When decomposing per FDs (functional dependencies) we are usually given a canonical/minimal cover for the relation, ie a set in a certain form whose transitive closure under Armstrong's axioms (set of FDs that must consequently hold) holds all the FDs in the relation. This is frequently forgotten when we are told that some FDs hold. We must either be given a canonical/minimal cover for the relation or be given an arbitrary set and be told that the FDs that hold in the relation are the ones in its transitive closure. If we're just given a set of FDs that hold, we know that the ones in its transitive closure hold, but there might be others. So in general we can't normalize.

在这里,您给出了一些保留的MVD。但是他们并不是唯一的,因为每个人都有一个伙伴。此外,其他人可能会(并且在这里确实会)持有。 (例如,X↠Y和Y↠Z表示X↠Z-Y成立。)但是,您并不是说它们构成了规范的覆盖或最小覆盖。一种获得MVD规范形式的方法(每个传递闭包唯一,希望更简洁!)是一个最小的覆盖范围(不会丢失任何MVD并仍然具有相同的传递闭包),由合作伙伴增加每个MVD。 (对于FD,标准规范形式是最小的。)您也不要说持有的MVD是这些语言的传递闭包中的MVD。您只是说那些MVD成立了。因此,也许某些不在传递闭包中的函数也是如此。因此您的示例无法解决。我们可以猜测,您可能是说这是一个最小的保障。 (不是规范的。)或者关系中包含的MVD是给定关系的传递闭包中的MVD。 (在这种情况下,这是最小的保障。)

Here you give some MVDs that hold. But they aren't the only ones, because each has a partner. Moreover others might (and here do) consequently hold. (Eg X ↠ Y and Y ↠ Z implies X ↠ Z-Y holds.) But you don't say that they form a canonical or minimal cover. One way to get a canonical form for MVDs (a unique one per each transitive closure, hopefully more concise!) would be a minimal cover (one that can't lose any MVDs and still have the same transitive closure) augmented by the partner of each MVD. (Whereas for FDs the standard canonical form is minimal.) You also don't say "the MVDs that hold are those in the transitive closure of these". You just say that those MVDs hold. So maybe some not in the transitive closure do too. So your example can't be solved. We can guess that you probably mean that this is a minimal cover. (It's not canonical.) Or that the MVDs that hold in the relation are those in the transitive closure of the given ones. (Which in this case are then a minimal cover.)

这篇关于4NF,不带功能依赖项的多值依赖项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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