First Normal Form
A table is not in first normal form if it is keeping multiple values for a piece of
information.
Second Normal Form
(确定主键)
A table is in second normal form if it is in first normal form AND we need all the fields in the key to determine the values of the non-key fields.
第二范式含义就是主键确定表里余下行的所有字段。例如如果是联合主键,不能是联合主键里的某一部分就能确定余下的字段值,例如联合主键是empID and
projNum
,想要知道proName,
只要知道
projNum
就可以了,不需要知道empID
。
If a table is not in second normal form, remove those non-key fields that are not dependent on the whole of the primary key. Create another table with these fields
and the part of the primary key that they do depend on.
如果一个表不满足第二范式,移动那些不依存主键的字段到其它表去。
Third Normal Form
(确定外键,把字段依存一个非主键的移走,这个被依存的非主键就是外键了,例如员工表里有部门id,部门名称,就不满足第三范式,部门名称依存部门
id,
其实部门
id
可以作为外键
)
A table is in third normal form if it is in second normal form AND no non-key fields
depend on a field(s) that is not the primary key.
第三范式是满足第二范式,并且没有其它非主键字段依存其它非主键字段。意思就是
非主键字段必须预存主键字段,如果依存另个非主键字段,则不满足,应该把这两个字段都移走,然后被依赖的非主键字段在新表是主键,在原表是外键!
If a table is not in third normal form, remove the non-key fields that are dependent
on a field(s) that is not the primary key. Create another table with these fields and
the field that they do depend on.
三范式
来源:这里教程网
时间:2026-03-01 14:56:14
作者:
编辑推荐:
下一篇:
相关推荐
-
雷神推出 MIX PRO II 迷你主机:基于 Ultra 200H,玻璃上盖 + ARGB 灯效
2 月 9 日消息,雷神 (THUNDEROBOT) 现已宣布推出基于英
-
制造商 Musnap 推出彩色墨水屏电纸书 Ocean C:支持手写笔、第三方安卓应用
2 月 10 日消息,制造商 Musnap 现已在海外推出一款 Oce
热文推荐
- 三范式
三范式
26-03-01 - 2019香港动作片《叶问4:完结篇》高清1080P/720P免费下载
2019香港动作片《叶问4:完结篇》高清1080P/720P免费下载
26-03-01 - MySQL:理解MDL Lock
MySQL:理解MDL Lock
26-03-01 - MySQL:5.6 大事务show engine innodb status故障一例
- MySQL:Table_open_cache_hits/Table_open_cache_misses/Table_open_cache_overflows
- 深度 | 解析InnoDB引擎
深度 | 解析InnoDB引擎
26-03-01 - MySQL 8.0源码学习日记——redo log的一生
MySQL 8.0源码学习日记——redo log的一生
26-03-01 - Word简历模板分享,需要的伙伴可以收藏哦!
Word简历模板分享,需要的伙伴可以收藏哦!
26-03-01 - MySQL内核大牛解密腾讯数据库关键技术点
MySQL内核大牛解密腾讯数据库关键技术点
26-03-01 - 腾讯黑科技:删大表不抖动,自动补充虚拟隐藏主键
腾讯黑科技:删大表不抖动,自动补充虚拟隐藏主键
26-03-01
