使用 Boyce Codd 范式分解示例解释非加法 属性

Explain non additive propery using a Boyce Codd Normal Form decomposition example

我已经阅读了定义并且有点明白了 - 在无损连接之后你不应该丢失任何信息。但是为什么这个具体的例子会选择第三种分解解呢? 这个例子来自 Elmasri 和 Navathe 的数据库系统基础。

我们有一个名为 TEACH 的 table,包含 Student、Teacher 和 Course 列。它是第三范式,我们正试图将它变成 BCNF(Boyce Codd Normal Form)。

教(学生、课程、讲师)

STUDENT  COURSE    INSTRUCTOR
Nathan   Database  Mark
Smith    Database  Navathe
Smith    Op Sys    Ammar
Smith    Theory    Schulman
Wallace  Database  Mark
Wallace  Op Sys    Ahamad
Wong     Database  Omienscki
Zelaya   Database  Navathe

文中说TEACH关系有3种可能的分解

1) {Student, Instructor} and {Student, Course}
2) {Course, Instructor} and {Course, Student}
3) {Instructor, Course} and {Instructor, Student}

根据文中,只有两个FUnctional Dependencies

1) {学生,课程} -> 讲师

2) 讲师 -> 课程

根据文中,只有解法3有效,因为它不会生成伪元组,因此具有非加性属性。

虚假元组来自连接非主属性或非外键。学生不是主要属性吗?那么为什么解决方案 1 不起作用?

我对为什么是解决方案 3 的理解是,我们无法从解决方案 1 和 2 中检索 "I have an instructor, what course does the instructor teach?" 等信息。这将与原始 table 中的功能依赖相关,即讲师 -> 课程。

你好像没有掌握归一化。您需要学习和使用精确的定义。

规范化通过(losslessly/nonadditively)连接回它的投影替换关系。当它位于其中一个组件的超键的列上时,删除有问题的 FD(功能依赖性)的二进制分解是 lossless/nonadditive。 (超级密钥是 CK(候选密钥)的超集。)("Joining on non primary attributes or non foreign keys" 而不是 表征有损情况。你为什么这么认为?)一旦你有了组件,你必须确定他们的 CKs/superkeys 是什么。

想必你的意思是这两个 FD 构成了原版 table 的封面。 (即唯一持有的 FD 是持有的 FD,因为那些持有。)然后在组件中持有的唯一非平凡的 FD 是 Instructor -> Course,并且 {Instructor} 是组件 {Instructor, Course} 的 CK , 唯一的选择是连接组件的超键是 3).

Student是它出现的每一个组件的prime属性,也就是说它是一个CK的成员。但对无损而言重要的是联接是否 在超级键 上,并且 {student} 是否不是任何组件的超级键。

PS 1. 不是"after a lossless join you should not lose any information"。 根据定义无损连接是您不会丢失任何信息时。类似地,"will not generate spurious tuples" 根据定义 与 "has [the] non additive property".

的含义相同

PS 2、你的"understanding"没有解释清楚。假设原始关系包含 "instructor INSTRUCTOR teaches course COURSE to student STUDENT" 处的行。当FD Instructor -> Course hold在原来的时候也可以描述为holding the rows where "instructor INSTRUCTOR teaches course COURSE AND instructor INSTRUCTOR teaches student STUDENT"。由于table的JOIN的含义是table的含义的AND/conjunction,我们可以通过连接两个table来重构table s 为 "instructor INSTRUCTOR teaches course COURSE" & "instructor INSTRUCTOR teaches student STUDENT" 每 3)。但是那个 FD 不允许我们用 AND per 1) & 2) 重新表述原来的意思。因此在这些情况下用 JOIN 替换它是不合适的。