`

数据库范式

阅读更多

 

第一范式

 

转自百度百科: http://baike.baidu.com/view/176725.htm

 

如果一个关系模式R的所有属性都是不可分的基本数据项,则R1NF。  第一范式(1NF)是指数据库表的每一列都是不可分割的基本数据项,同一列中不能有多个值,即实体中的某个属性不能有多个值或者不能有重复的属性。

 

 

第二范式

转自百度百科:http://baike.baidu.com/view/176736.htm

 

 

若关系模式R1NF,并且每一个非主属性都完全函数依赖R的主码,则R2NF


第二范式(2NF)是在第一范式1NF)的基础上建立起来的,即满足第二范式(2NF)必须先满足第一范式(1NF)。第二范式(2NF)要求数据库表中的每个实例或行必须可以被唯一地区分。为实现区分通常需要为表加上一个列,以存储各个实例的唯一标识。这个唯一属性列被称为主关键字或主键、主码。

 

  第二范式(2NF)要求实体的属性完全依赖于主关键字。所谓完全依赖是指不能存在仅依赖主关键字一部分的属性,如果存在,那么这个属性和主关键字的这一部分应该分离出来形成一个新的实体,新实体与原实体之间是一对多的关系。为实现区分通常需要为表加上一个列,以存储各个实例的唯一标识。简而言之,第二范式就是非主属性非部分依赖于主关键字。

 

第三范式

转自: Beginning.Database.Design.Solutions

 

A table is in 3NF if:

1. It is in 2NF.

2. It contains no transitive dependencies.

A transitive dependency is when one non-key field’s value depends on another non-key field’s value.

 

BCNF

转自: Beginning.Database.Design.Solutions

 

A table is in BCNF if:

1. It is in 3NF.

2. Every determinant is a candidate key.

 

第四范式

Employee implies Skill and Employee implies Tool but Skill and

Tool are independent. This situation is called an unrelated multi-valued dependency.

A table is in 4NF if:

1. It is in BCNF.

2. It does not contain an unrelated multi-valued dependency.

 

第五范式

table is in 5NF (also called ‘‘Project-Join Normal Form’’) if:

1. It is in 4NF.

2. It contains no related multi-valued dependencies.

 

DKNF

table is in DKNF if:

1. The table contains no constraints except domain constraints and key constraints.

 

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics