当前位置:网站首页>6.2 normalization 6.2.5 third normal form (3NF)
6.2 normalization 6.2.5 third normal form (3NF)
2022-07-03 22:16:00 【Miss people】
6.2 Normalization
2NF What else is the problem ?
The projection decomposition method is used , hold S-L-C Decompose into two relational patterns :SC and S-L, Eliminated S-L-C Partial functional dependence of non primary attribute on code
General , If so 1NF The relational schema is decomposed by projection , Eliminate partial functional dependence of non primary attributes on codes , Break down into several 2NF Relationship model of
It can reduce the original 1NF Insert exception in relation pattern 、 Delete exception 、 Data redundancy marking 、 Modify complex problems
But it cannot be completely eliminated Various exceptions and data redundancy in relational patterns
2NF Relationship model S-L(Sno, Sdept, Sloc) in
Function dependency :Sloc The transfer function depends on Sno, namely S-L Since the transfer function of non primary attribute pair code exists in Sno - Pass on -> Sloc
S-L Relationship problems :
(1) Insertion exception
If one is for various reasons ( For example, it has just been established ), Currently, there are no students in school , We will Unable to send the information of this department , Store in database .
(2) Delete exception
If all the students in a department graduate , While deleting the student information of the Department , Put the information of this department (Sdept、Sloc) Also lost .
(3) Large data redundancy
Students in every department live in the same place , The information about the Department's residence is repeated , The number of repetitions and the number of students in the Department identical
(4) The modification is complicated
When the school adjusts students' accommodation , Because the information about the residence of each department is repeatedly stored , When modifying All students in the Department must be updated at the same time Sloc Property value
reason :
S-L in Sloc The transfer function depends on On Sno, That is, non primary attribute == Transfer function by code
resolvent :
The projection decomposition method is used , hold S-L Decompose into two relational patterns , To eliminate transfer function dependencies :
S-D(Sno, Sdept)
D-L(Sdept, Sloc)
S-D The code of is Sno,D-L The code of is Sdept
In the decomposed relational schema There are no non primary attribute pairs Part of the function depends on , There are no non primary attribute pairs The transfer function depends on , It further solves the above four problems
The abnormal situation has been improved :
(1)D-L The information of the system can be inserted into the relationship , Even if there are no students in school
(2) All the students in a department have graduated , Just delete S-D The corresponding tuple in the relationship ,D-L Information about the Department in the relationship still exists .
(3) Information about the Department's residence is just D-L In relationship Store once
(4) When the school adjusts the residence of students in a department , Only need to modify D-L In relationship One Of a tuple Sloc Property value
3NF The definition of
Definition 6.7 Relationship model R<U, F>∈1NF, if R There is no such code in X、 Attribute group Y And non primary properties Z(Y⊉Z), Yes X → Y,Y → Z,Y ↛ X establish , Then the layer R<U, F> ∈ 3NF( There is no delivery dependency )
chestnuts :
S-D(Sno, Sdept) ∈ 3NF
D-L(Sdept, Sloc) ∈ 3NF
Divide again without a column , Second, there is no partial dependence , Three non transitive dependencies
3NF Some properties of :
if R∈3NF, be R Of Every non primary attribute Neither partial function depends on candidate code nor transfer function depends on candidate code
If R∈3NF, be R∈2NF
Using the projection decomposition method 2NF The relationship is decomposed into multiple 3NF The relationship between , Can be in a certain extent solve primary 2NF Insert exception in relation 、 Delete exception 、 Large data redundancy 、 Modify complex problems
Will a 2NF The relationship is decomposed into multiple 3NF After the relationship , It can't completely eliminate Various exceptions and data redundancy in relational patterns
边栏推荐
- [SRS] build a specified version of SRS
- [dynamic planning] counting garlic customers: the log of garlic King (the longest increasing public subsequence)
- Introduction to kubernetes
- Luogu deep foundation part 1 Introduction to language Chapter 6 string and file operation
- Miscellaneous things that don't miss the right business
- Team collaborative combat penetration tool CS artifact cobalt strike
- Electronic tube: Literature Research on basic characteristics of 6j1
- Analysis report on the development trend and Prospect of global and Chinese supercontinuum laser source industry Ⓚ 2022 ~ 2027
- Morning flowers and evening flowers
- 油猴插件
猜你喜欢

Niuke winter vacation training camp 4 g (enumeration optimization, Euler power reduction)

4 environment construction -standalone ha

How PHP gets all method names of objects

Control loop of program (while loop)

Code in keil5 -- use the code formatting tool astyle (plug-in)

2022 electrician (elementary) examination questions and electrician (elementary) registration examination

IPhone development swift foundation 09 assets

常用sql集合

Decompile and modify the non source exe or DLL with dnspy

Common SQL sets
随机推荐
DR882-Qualcomm-Atheros-QCA9882-2T2R-MIMO-802.11ac-Mini-PCIe-Wi-Fi-Module-5G-high-power
What is the difference between res.send() and res.end() in the node express framework
IPhone development swift foundation 09 assets
What is the content of the securities practice examination?
Pooling idea: string constant pool, thread pool, database connection pool
[dynamic programming] Ji Suan Ke: Suan tou Jun breaks through the barrier (variant of the longest increasing subsequence)
Mysql database - Advanced SQL statement (I)
Are the top ten securities companies safe to open accounts and register? Is there any risk?
Go Technology Daily (2022-02-13) - Summary of experience in database storage selection
The 14th five year plan for the construction of Chinese Enterprise Universities and the feasibility study report on investment Ⓓ 2022 ~ 2028
The 14th five year plan and investment feasibility study report of China's industry university research cooperation Ⓧ 2022 ~ 2028
Mindmanager2022 serial number key decompression installer tutorial
2022 safety officer-b certificate examination summary and safety officer-b certificate simulation test questions
Yyds dry goods inventory hands-on teach you to create a jigsaw puzzle using the canvasapi
1 Introduction to spark Foundation
Global and Chinese market of wall mounted kiosks 2022-2028: Research Report on technology, participants, trends, market size and share
2022 free examination questions for safety management personnel of hazardous chemical business units and reexamination examination for safety management personnel of hazardous chemical business units
股票炒股开户注册安全靠谱吗?有没有风险的?
Decompile and modify the non source exe or DLL with dnspy
2022 high altitude installation, maintenance and removal of examination question bank and high altitude installation, maintenance and removal of examination papers