范式
Learn Boyce-Codd Normal Form (BCNF) - YouTube Boyce-Codd Normal Form (BCNF) | Database Normalization | DBMS - YouTube
1 NF
Rules
- 不允许用行顺序传达信息
- 不允许在同一列中混合数据类型
- 不允许没有
primary key
的table
- 不允许重复的组
2 NF
- 关于
non-key attributes
和prime key attributes
的关系) - 所有的
non-key attributes
必须依赖于整个primary key
(候选码) - 等价于:have no
partial dependency
3 NF
non-key attributes
不依赖于non-key attributes
,即没有间接传递- Each
non-key attribute
in a table should depend on thekey
, the wholekey
, and nothing but thekey
. (key
: everycandidate key
)
BCNF
- 3 NF 的漏洞:01:49
- BCNF 的定义:every functional dependency in a table must be a dependency on a
super key
. 11:21 - Each
attribute
in a table should depend on thekey
, the wholekey
, and nothing but thekey
. (key
:every candidate key
) - 所有的函数依赖集中左端的属性一定包含候选码
范式分解
无损连接性(内容是否等价)
- 分解后的关系自然连接的结果与分解前的关系相等
保持函数依赖(依赖是否等价)
NF 分解
BCNF 分解
BCNF Decomposition - YouTube 02:18