review——database (1)CH8-Relational Database Design

时间:2021-07-15 12:46:09

1.1NF(P328、P215)

In the relationalmodel, we formalize this idea that attributes do not have any
substructure. A domain is atomic if elements of the domain are considered to be
indivisible units. We say that a relation schema R is in first normal form (1NF) if
the domains of all attributes of R are atomic.

非第一范式的例子:

review——database (1)CH8-Relational Database Design

review——database (1)CH8-Relational Database Design

 

2.Boyce-Codd Normal Form

review——database (1)CH8-Relational Database Design

一般的分解为BCNF的方法:

review——database (1)CH8-Relational Database Design

 

 创建第三范式的原因:(BCNF的缺陷)

review——database (1)CH8-Relational Database Design

 

 3.3NF(Third Normal Form)

 review——database (1)CH8-Relational Database Design

 

 4.函数依赖集的闭包

逻辑蕴含的定义:

review——database (1)CH8-Relational Database Design

闭包的定义:

review——database (1)CH8-Relational Database Design

 

Armstrong公理及其进一步推出的规则

review——database (1)CH8-Relational Database Design

进行求解的伪代码:

review——database (1)CH8-Relational Database Design

 

 

5.属性集的闭包

伪代码

review——database (1)CH8-Relational Database Design

 

6.正则覆盖

无关属性的定义:

review——database (1)CH8-Relational Database Design

 

正则覆盖的定义:

review——database (1)CH8-Relational Database Design

求解算法:

review——database (1)CH8-Relational Database Design

 

采用正则覆盖可以使得验证更加容易。

 

7.无损分解

review——database (1)CH8-Relational Database Design

 

判定将F分解为R1、R2是否是无损分解:

review——database (1)CH8-Relational Database Design

 

8.保持依赖

review——database (1)CH8-Relational Database Design

 

 检测是否保持依赖的算法1:

review——database (1)CH8-Relational Database Design

 

各种分解算法鉴于不在期末范围内,暂时用不到,使用时再现查。

 9.分解算法

(1)BCNF分解

part1:检验是否为BCNF的方法1

review——database (1)CH8-Relational Database Design

其中需要注意,如图片中所说,第二条对于分解的结果不适用,即对于分解的需要检查F+而非仅仅F。

 part2:检验是否为BCNF的方法2

review——database (1)CH8-Relational Database Design

review——database (1)CH8-Relational Database Design

 

 part3:BCNF分解算法

review——database (1)CH8-Relational Database Design

BCNF分解算法的伪代码:

review——database (1)CH8-Relational Database Design

 part4 3NF的分解算法的伪代码

review——database (1)CH8-Relational Database Design

 

8.5.4 比较BCNF和3NF