当前位置:网站首页>First Normal Form, Second Normal Form, Third Normal Form
First Normal Form, Second Normal Form, Third Normal Form
2022-07-29 23:53:00 【Westbrook Championship】
Excerpted from https://www.zhihu.com/question/24696366
- Functional dependency: If in a table, when the value of attribute (or attribute group) X is determined, the value of attribute Y must be determined, thenIt can be said that the Y function depends on X, written X → Y (one X does not correspond to two Y, Y = f(X))
- Complete functional dependency: attribute set X → Y, for any proper subset X' of X, there is X' ! → Y, then Y is said to be completely functionally dependent on X
- Partial functional dependency: attribute set X → Y, there is a proper subset X' of X, and X' → Y, then Y is said to be partially functionally dependent on X
- The transfer function depends on: X → Y, Y → Z (premise: Y is not included in X, and Y ! → X), then we say that the transfer function of Z depends on X

- Student ID → Name, Department Name → Department Chair
- Score fully functionally dependent on name+course; grade entirely dependent on student number+course
- Department nameSome functions depend on student number + name; because the student number can be used to determine the department name (the function of the department name depends on the student number); the name can also be determined by the name
- Department Chair The transfer function depends on the student number; the student number determines the department name, and the department name determines the department chair
Note: if the second normal form is satisfied, the first normal form must be satisfied; if the third normal form is satisfied, the second normal form must be satisfied
- First Normal Form: Columns are inseparable
First Normal Form is the most basic normal form. All fields in the data table are inseparable atomic values, which means that the data table satisfies the First Normal Form
Subscripts are notFirst normal form:
- Second normal form: there is no partial dependence of non-primary attributes on candidate codes
- Find all candidate codes (minimum set of attributes that can identify the uniqueness of a set of data)
- The attributes included in all candidate codes are called primary attributes
- Attributes other than primary attributes are called non-primary attributes
- Determine whether there is a partial functional dependence of non-primary attributes on the candidate code

Analyze the above image:
- Candidate code: student number + course ((minimum attribute set that can identify the uniqueness of a set of data))
Check all individual attributes, when its value is determined, whether all the remaining attribute values arecan be determined.
View all attribute groups that contain two attributes, when its value is determined, whether all remaining attribute values can be determined.
……
View all attribute groups that contain six attributes, that is, all attributes. When its value is determined, whether all the remaining attribute values can be determined.- Main attributes: student ID, course
- Non-Primary Attributes: Name, Department Name, Department Chair, Score
- Judgment: name, department name, department chair are all part of the function depends on the candidate code
- Conclusion: Not in Second Normal Form
Split the table, both tables are in second normal form
- The first table:
Candidate code: student number + course
Main attribute: student number, course
Non-main attribute: score
Judgment: the score is completely functionally dependent on (student number +course)- The second table:
Candidate code: student number (considering the same name, name will not be listed as a candidate key)
Primary attribute: student number
Non-primary attribute: name, department name, departmentDirector
Judgment: The non-primary attribute is completely functionally dependent on the candidate code
- Third normal form: there is no transfer function dependence of non-attribute codes on candidate keys

Observe the table above,
- Candidate code: student number
- Main attribute: student ID
- Non-primary attributes: name, department name, department chair
- Judgment: student number → department name, department name → department chair
- Not in third normal form

- BCNF is an improvement on third normal form
A condition that satisfies the relational schema of BCNF:
- All non-primary properties are fully functionally dependent on each code.
- All main properties are also fully functionally dependent on every code that does not contain it.
- No attribute is fully functionally dependent on any set of attributes that are not code.
Water moisturizing goose song Ecological Guangping
Hebei Handan
边栏推荐
- devops学习(三) K8环境部署jenkins
- Android 11 : 隐私和安全
- 437. The total path III low low
- [leetcode] 80. Delete duplicates in sorted array II (medium) (double pointer, in-place modification)
- The basic parallel I/O port of single chip microcomputer development
- Getting Started with Sentinel
- 环形链表(LeetCode 141、142)
- Gao Shu Xia|Triple Integral Exercises|Uncle Gao Shu|Handwritten Notes
- mysql使用on duplicate key update批量更新数据
- devops学习(四) Jenkins CI 持续集成
猜你喜欢
随机推荐
重庆OI 2005 新年好
C陷阱与缺陷 第5章 库函数 5.2更新顺序文件
卧槽,2行代码,让接口性能提升10倍
Elephant Swap:借助ePLATO提供加密市场的套利空间
深度学习的随机种子
学会使用MySQL的Explain执行计划,SQL性能调优从此不再困难
全国双非院校考研信息汇总整理 Part.5
Windows 安装 MySQL 5.7详细步骤
MySQL【基本select语句】
idea设置自动去除未引用(不再引用)的引用
devops学习(十) Jenkins 流水线
接口测试的概念、目的、流程、测试方法有哪些?
The latest Gansu construction welder (construction special operation) simulation question bank and answer analysis in 2022
Design for failure常见的12种设计思想
高数下|三重积分习题课|高数叔|手写笔记
线上无序的
Add, delete, modify and query the database
彻底搞懂kubernetes调度框架与插件
很遗憾,没有一篇文章能讲清楚分布式事务
2022年最新甘肃建筑八大员(材料员)模拟考试试题及答案










