当前位置:网站首页>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
边栏推荐
猜你喜欢

OpenSSL client programming: SSL session failure caused by an insignificant function

S32K1xx 微控制器的硬件设计指南

【STM32学习】 基于STM32 USB存储设备的w25qxx自动判断容量检测

张驰课堂:六西格玛数据的几种类型与区别

MySQL 服务正在启动 MySQL 服务无法启动解决途径

Basic use process of cmake

"Qt+pcl Chapter 6" point cloud registration ICP Series 6

STM32ADC模拟/数字转换详解

【显存优化】深度学习显存优化方法

STM32F411 SPI2输出错误,PB15无脉冲调试记录【最后发现PB15与PB14短路】
随机推荐
Zhang Chi Consulting: household appliance enterprises use Six Sigma projects to reduce customers' unreasonable return cases
《QT+PCL第九章》点云重建系列2
SAP CRM organization Model(组织架构模型)自动决定的逻辑分析
MySQL service is starting. MySQL service cannot be started. Solution
Tableapi & SQL and Kafka message insertion in Flink
Photoshop插件-HDR(二)-脚本开发-PS插件
Go zero actual combat demo (I)
Fix the failure of idea global search shortcut (ctrl+shift+f)
JS中箭头函数和普通函数的区别
"Qt+pcl Chapter 6" point cloud registration ICP Series 6
Research on manually triggering automatic decision of SAP CRM organization model with ABAP code
Digital transformation: data visualization enables sales management
采集数据工具推荐,以及采集数据列表详细图解流程
Wechat applet 02 - Implementation of rotation map and picture click jump
Introduction to MySQL audit plug-in
张驰咨询:家电企业用六西格玛项目减少客户非合理退货案例
What are the test items of juicer ul982
Summary of empty string judgment in the project
Hardware design guide for s32k1xx microcontroller
Implementation of wechat web page subscription message