当前位置:网站首页>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
边栏推荐
- Dahua series books
- China's Call Center Industry 14th five year plan direction and operation analysis report Ⓔ 2022 ~ 2028
- Blue Bridge Cup Guoxin Changtian single chip microcomputer -- software environment (II)
- 2022 electrician (elementary) examination questions and electrician (elementary) registration examination
- Why should enterprises do more application activities?
- How to obtain opensea data through opensea JS
- Cognitive fallacy: what is Fredkin's paradox
- DR-NAS26-Qualcomm-Atheros-AR9582-2T-2R-MIMO-802.11-N-5GHz-high-power-Mini-PCIe-Wi-Fi-Module
- Asynchronous artifact: implementation principle and usage scenario of completable future
- JS Demo calcule combien de jours il reste de l'année
猜你喜欢

Covariance

Introduction to kubernetes

The latest analysis of R1 quick opening pressure vessel operation in 2022 and the examination question bank of R1 quick opening pressure vessel operation

QGIS grid processing DEM data reclassification

Dahua series books

Morning flowers and evening flowers

常用sql集合

Exness: the Central Bank of England will raise interest rates again in March, and inflation is coming
![[dynamic planning] counting garlic customers: the log of garlic King (the longest increasing public subsequence)](/img/29/543dce2f24130d22c1824385fbfa8f.jpg)
[dynamic planning] counting garlic customers: the log of garlic King (the longest increasing public subsequence)

Cesium terrain clipping draw polygon clipping
随机推荐
Collection | pytoch common loss function disassembly
Yyds dry inventory Chapter 4 of getting started with MySQL: data types that can be stored in the data table
6.0 kernel driver character driver
Implementation principle of inheritance, encapsulation and polymorphism
Plug - in Oil Monkey
Exclusive interview with the person in charge of openkruise: to what extent has cloud native application automation developed now?
How PHP adds two numbers
Redis concludes that the second pipeline publishes / subscribes to bloom filter redis as a database and caches RDB AOF redis configuration files
Compréhension de la technologie gslb (Global Server load balance)
Development trend and market demand analysis report of China's energy storage battery industry Ⓩ 2022 ~ 2028
Supply and demand situation and market scale calculation report of China's portable energy storage power PES industry Ⓛ 2022 ~ 2028
Buuctf, misc: n solutions
Blue Bridge Cup Guoxin Changtian single chip microcomputer -- led lamp module (V)
Summary of basic knowledge of exception handling
Redis single thread and multi thread
Bluebridge cup Guoxin Changtian single chip microcomputer -- hardware environment (I)
IPhone development swift foundation 08 encryption and security
LeetCode 1646. Get the maximum value in the generated array
使用dnSpy对无源码EXE或DLL进行反编译并且修改
Luogu deep foundation part 1 Introduction to language Chapter 7 functions and structures