当前位置:网站首页>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
边栏推荐
- Redis single thread and multi thread
- Global and Chinese market of wall mounted kiosks 2022-2028: Research Report on technology, participants, trends, market size and share
- Plug - in Oil Monkey
- Analysis report on the development prospect and investment strategy of global and Chinese modular automation systems Ⓟ 2022 ~ 2027
- Blue Bridge Cup Guoxin Changtian single chip microcomputer -- software environment (II)
- pivot ROP Emporium
- Mysql database - Advanced SQL statement (I)
- China's coal industry investment strategic planning future production and marketing demand forecast report Ⓘ 2022 ~ 2028
- China's TPMS industry demand forecast and future development trend analysis report Ⓐ 2022 ~ 2028
- Collections SQL communes
猜你喜欢
Blue Bridge Cup Guoxin Changtian single chip microcomputer -- led lamp module (V)
gslb(global server load balance)技术的一点理解
Implementation principle of inheritance, encapsulation and polymorphism
Covariance
Awk getting started to proficient series - awk quick start
Bluebridge cup Guoxin Changtian single chip microcomputer -- detailed explanation of schematic diagram (IV)
Bluebridge cup Guoxin Changtian single chip microcomputer -- hardware environment (I)
1068. Consolidation of ring stones (ring, interval DP)
Décompiler et modifier un exe ou une DLL non source en utilisant dnspy
Preliminary analysis of smart microwave radar module
随机推荐
regular expression
Data consistency between redis and database
DOM light switch case
SDNU_ ACM_ ICPC_ 2022_ Winter_ Practice_ 4th [individual]
The 14th five year plan for the construction of Chinese Enterprise Universities and the feasibility study report on investment Ⓓ 2022 ~ 2028
Exclusive interview with the person in charge of openkruise: to what extent has cloud native application automation developed now?
Persistence of Nacos
Imitation Netease cloud music applet
How PHP gets all method names of objects
Investment analysis and prospect trend prediction report of China's boron nitride industry Ⓨ 2022 ~ 2028
Analysis report on the development prospect and investment strategy of global and Chinese modular automation systems Ⓟ 2022 ~ 2027
pivot ROP Emporium
Yyds dry goods inventory hands-on teach you to create a jigsaw puzzle using the canvasapi
On my first day at work, this API timeout optimization put me down!
English topic assignment (28)
Morning flowers and evening flowers
WFC900M-Network_ Card/Qualcomm-Atheros-AR9582-2T-2R-MIMO-802.11-N-900M-high-power-Mini-PCIe-Wi-Fi-Mod
JS Demo calcule combien de jours il reste de l'année
[dynamic programming] Ji Suan Ke: Suan tou Jun breaks through the barrier (variant of the longest increasing subsequence)
Bluebridge cup Guoxin Changtian single chip microcomputer -- hardware environment (I)