当前位置:网站首页>6.2 normalization 6.2.6 BC normal form (BCNF) 6.2.9 normalization summary
6.2 normalization 6.2.6 BC normal form (BCNF) 6.2.9 normalization summary
2022-07-01 15:28:00 【Miss people】
6.2.6 BC normal form

Take a chestnut : Relationship model STJ(S, T, J) in ,S Students ,T It means that the teacher ,J Indicates the course
semantics :
Suppose each teacher can teach only one course T → J
Each course is taught by several teachers , But a student takes a course , I chose a fixed teacher (S, J) → T
When a student chooses a teacher's course, the name of the selected course is determined (S, T) → J
T → J,(S, J) → T,(S, T) → J
- Candidate code :(S, J) and (S, T)
- S T J It's all primary properties
- There are no non primary attribute pairs Part of the function depends on and The transfer function depends on
- STJ ∈ 3NF
although STJ(S, T, J)∈3NF, There are exceptions such as addition, deletion and modification in the single throw , It is not an ideal relationship model
(1) Insertion exception
If a teacher offers a course , But no students have yet taken , Then the relevant information cannot be stored in the database .
(2) Delete exception
If all the students who take a course graduate , When deleting these student tuples , The new news that the corresponding teacher opened the course was also lost .
(3) Large data redundancy
Although a teacher only teaches one subject , But every student tuple who elects the teacher's course records this information .
(4) The modification is complicated
After a teacher changed the name of a course , All student tuples that have taken the teacher's course should be modified accordingly
reason :
Main attribute J Part of the function depends on the code (S, T). because T → J
resolvent :
The projection decomposition method is used , take STJ Decompose into two relational patterns :SJ(S,J);TJ(T,J)
SJ The code of is (S,J),TJ The code of is T
In the decomposed relational schema There is no partial functional dependency and transfer functional dependency of any attribute on the code
He solved the above four problems :
(1)TJ The relationship can store the information of teachers whose courses have not been selected by students
(2) All the students who have taken a course have graduated , Just delete SJ Corresponding tuple of relation , Does not affect the TJ In the relationship, I want to use the information about the course offered by the teacher
(3) Information about the courses offered by each teacher is only available in TJ Store once in the relationship
(4) After a teacher changed the name of a course , Only need to modify TJ A corresponding tuple in the relationship can
BCNF(Boyce Codd Normal Form) By Boyce and Codd Proposed , Than 3NF A step further . It is commonly believed BCNF It's the revised third paradigm , Sometimes called extended third paradigm .
BCNF The definition of
Definition 6.8 Set the relational pattern R<U, F>∈1NF, If for R Every functional dependency of X→Y, And ⊉Y when ,X It must have a code , that R∈BCNF.
namely , In relation mode R<U, F> in , If Every determinant contains a code , be R∈BCNF
example :STJ(S, T, J)∈ 3NF, T→J,(S,J)→T,(S,T)→J
SJ(S, J)∈ BCNF, SJ The code of is (S, J),all-key
TJ(T, J)∈ BCNF, TJ The code of is T,T→J
BCNF The nature of the relational pattern of
- All non primary attributes are fully function dependent on each code
- All primary attributes are also fully function dependent on each code that does not contain it
- No attribute completely depends on any set of non code attributes
If the relationship pattern R∈BCNF, There must be R∈3NF
If the relationship pattern R∈3NF, Not necessarily R∈BCNF( Like the one above STJ(S, T, J))
If all relational schemas in a relational database belong to BCNF, So in function Depend on the range Inside , It has achieved a thorough decomposition of patterns , Reached the highest degree of standardization , Many problems of abnormal operation are eliminated .
A relational model as long as it Components are inseparable data items , He is the standardized relationship model , But this is just the most basic normalization
Degree of Standardization Too low The relationship model may not be a good description of the real world , There may be insertion exceptions 、 Delete exception 、 The modification is complicated 、 Data redundancy and so on , The solution is to standardize it , Convert to high-level paradigm
A low-level paradigm of relational patterns , Through schema decomposition, it can be transformed into a set of relational schemas of several higher-level paradigms , This process is called Normalization of relationship pattern
The normalization theory of relational database is a tool for database logic design
The basic steps of relational schema normalization :
The basic idea of Standardization :
Gradually eliminate inappropriate parts of data dependence , Make the relationship patterns in the pattern break down to a certain extent “ Separate ”
use “ One thing at a time ” Pattern design principles
● Let a relationship describe a concept 、 An entity or a connection between entities
● If there is more than one concept, put it “ Separate out ”
Standardization is essentially the simplification of concepts
边栏推荐
- TS reports an error don't use 'object' as a type The `object` type is currently hard to use
- 《QT+PCL第九章》点云重建系列2
- 项目中字符串判空总结
- 精益六西格玛项目辅导咨询:集中辅导和点对点辅导两种方式
- Demand prioritization method based on value quantification
- [cloud trend] new wind direction in June! Cloud store hot list announced
- 【天线】【3】CST一些快捷键
- 微信网页订阅消息实现
- Task.Run(), Task.Factory.StartNew() 和 New Task() 的行为不一致分析
- leetcode:329. Longest increasing path in matrix
猜你喜欢

opencv学习笔记四--银行卡号识别

Wechat applet 02 - Implementation of rotation map and picture click jump

cmake 基本使用过程

采集数据工具推荐,以及采集数据列表详细图解流程

STM32F4-TFT-SPI时序逻辑分析仪调试记录

Returning to the top of the list, the ID is still weak

opencv学习笔记五--文件扫描+OCR文字识别

微信网页订阅消息实现
![[advanced ROS] lesson 5 TF coordinate transformation in ROS](/img/4d/ae7d477bf6928005e16f046d461dcb.png)
[advanced ROS] lesson 5 TF coordinate transformation in ROS

Phpcms background upload picture button cannot be clicked
随机推荐
Fix the failure of idea global search shortcut (ctrl+shift+f)
These three online PS tools should be tried
The difference between arrow function and ordinary function in JS
[Cloudera][ImpalaJDBCDriver](500164)Error initialized or created transport for authentication
Flink 系例 之 TableAPI & SQL 与 MYSQL 数据查询
[lock] redis lock handles concurrency atomicity
Wechat applet 02 - Implementation of rotation map and picture click jump
Digital transformation: data visualization enables sales management
Flink 系例 之 TableAPI & SQL 与 MYSQL 分组统计
Task. Run(), Task. Factory. Analysis of behavior inconsistency between startnew() and new task()
将ABAP On-Premises系统连接到中央检查系统以进行自定义代码迁移
精益六西格玛项目辅导咨询:集中辅导和点对点辅导两种方式
Demand prioritization method based on value quantification
The last picture is seamlessly connected with the first picture in the swiper rotation picture
Basic use process of cmake
STM32F4-TFT-SPI时序逻辑分析仪调试记录
Filter & (login interception)
SQL常用的四个排序函数梳理
"Qt+pcl Chapter 6" point cloud registration ICP Series 6
Stm32f411 SPI2 output error, pb15 has no pulse debugging record [finally, pb15 and pb14 were found to be short circuited]