当前位置:网站首页>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
边栏推荐
- 项目中字符串判空总结
- [Cloudera][ImpalaJDBCDriver](500164)Error initialized or created transport for authentication
- 如何实现时钟信号分频?
- Junda technology - wechat cloud monitoring scheme for multiple precision air conditioners
- Wechat applet 03 - text is displayed from left to right, and the block elements in the line are centered
- 榨汁机UL982测试项目有哪些
- 《QT+PCL第九章》点云重建系列2
- These three online PS tools should be tried
- MySQL审计插件介绍
- A unifying review of deep and shallow anomaly detection
猜你喜欢
opencv学习笔记六--图像拼接
《QT+PCL第九章》点云重建系列2
Opencv learning notes 5 -- document scanning +ocr character recognition
It's settled! 2022 Hainan secondary cost engineer examination time is determined! The registration channel has been opened!
【ROS进阶篇】第五讲 ROS中的TF坐标变换
微服务追踪SQL(支持Isto管控下的gorm查询追踪)
张驰咨询:锂电池导入六西格玛咨询降低电池容量衰减
Wechat applet 01 bottom navigation bar settings
[stm32-usb-msc problem help] stm32f411ceu6 (Weact) +w25q64+usb-msc flash uses SPI2 to read out only 520kb
微信公众号订阅消息 wx-open-subscribe 的实现及闭坑指南
随机推荐
智能运维实战:银行业务流程及单笔交易追踪
Tableapi & SQL and Kafka message insertion in Flink
微信网页订阅消息实现
Is JPMorgan futures safe to open an account? What is the account opening method of JPMorgan futures company?
摩根大通期货开户安全吗?摩根大通期货公司开户方法是什么?
做空蔚来的灰熊,以“碰瓷”中概股为生?
重回榜首的大众,ID依然乏力
《QT+PCL第六章》点云配准icp系列2
Recommendation of data acquisition tools and detailed graphic process of data acquisition list
Stm32f411 SPI2 output error, pb15 has no pulse debugging record [finally, pb15 and pb14 were found to be short circuited]
雷神科技冲刺北交所,拟募集资金5.4亿元
Zhang Chi's class: several types and differences of Six Sigma data
Connect the ABAP on premises system to the central inspection system for custom code migration
Demand prioritization method based on value quantification
leetcode:329. Longest increasing path in matrix
Tableapi & SQL and MySQL insert data of Flink
MySQL 服务正在启动 MySQL 服务无法启动解决途径
Research on manually triggering automatic decision of SAP CRM organization model with ABAP code
精益六西格玛项目辅导咨询:集中辅导和点对点辅导两种方式
【300+精选大厂面试题持续分享】大数据运维尖刀面试题专栏(三)