当前位置:网站首页>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
边栏推荐
- Lean Six Sigma project counseling: centralized counseling and point-to-point counseling
- Stm32f411 SPI2 output error, pb15 has no pulse debugging record [finally, pb15 and pb14 were found to be short circuited]
- 微信小程序03-文字一左一右显示,行内块元素居中
- Description | Huawei cloud store "commodity recommendation list"
- Flink 系例 之 TableAPI & SQL 与 MYSQL 数据查询
- Storage form of in-depth analysis data in memory
- Raytheon technology rushes to the Beijing stock exchange and plans to raise 540million yuan
- TS报错 Don‘t use `object` as a type. The `object` type is currently hard to use
- 竣达技术丨多台精密空调微信云监控方案
- Intelligent operation and maintenance practice: banking business process and single transaction tracking
猜你喜欢

Implementation of wechat web page subscription message

【一天学awk】函数与自定义函数

竣达技术丨室内空气环境监测终端 pm2.5、温湿度TVOC等多参数监测

Lean Six Sigma project counseling: centralized counseling and point-to-point counseling

A unifying review of deep and shallow anomaly detection

Fix the failure of idea global search shortcut (ctrl+shift+f)

Task.Run(), Task.Factory.StartNew() 和 New Task() 的行为不一致分析

JS中箭头函数和普通函数的区别

雷神科技冲刺北交所,拟募集资金5.4亿元
![opencv学习笔记六--图像特征[harris+SIFT]+特征匹配](/img/50/5c8adacea78e470c255070c8621ddd.png)
opencv学习笔记六--图像特征[harris+SIFT]+特征匹配
随机推荐
[cloud trend] new wind direction in June! Cloud store hot list announced
Using swiper to make mobile phone rotation map
The difference between arrow function and ordinary function in JS
Task. Run(), Task. Factory. Analysis of behavior inconsistency between startnew() and new task()
《性能之巅第2版》阅读笔记(五)--file-system监测
S32K1xx 微控制器的硬件設計指南
【天线】【3】CST一些快捷键
《QT+PCL第六章》点云配准icp系列4
【云动向】6月上云新风向!云商店热榜揭晓
STM32F4-TFT-SPI时序逻辑分析仪调试记录
Raytheon technology rushes to the Beijing stock exchange and plans to raise 540million yuan
[Cloudera][ImpalaJDBCDriver](500164)Error initialized or created transport for authentication
MySQL审计插件介绍
[leetcode] 16. The sum of the nearest three numbers
榨汁机UL982测试项目有哪些
Tableapi & SQL and Kafka message acquisition of Flink example
[one day learning awk] conditions and cycles
张驰咨询:家电企业用六西格玛项目减少客户非合理退货案例
Recommendation of data acquisition tools and detailed graphic process of data acquisition list
采集数据工具推荐,以及采集数据列表详细图解流程