SlideShare une entreprise Scribd logo
1  sur  12
Appendix C:
Advanced Normalization Theory
Reasoning with MVDs
Higher normal forms


Join dependencies and PJNF



DKNF

Database System Concepts

7.1

©Silberschatz, Korth and Sudarshan
Theory of Multivalued Dependencies
Let D denote a set of functional and multivalued dependencies.
The closure D+ of D is the set of all functional and multivalued
dependencies logically implied by D.
Sound and complete inference rules for functional and
multivalued dependencies:
1. Reflexivity rule. If α is a set of attributes and β ⊆ α, then α →β
holds.
2. Augmentation rule. If α → β holds and γ is a set of attributes,
then γ α→γ β holds.
3. Transitivity rule. If α → β holds and γ α→γ β holds, then α →γ
holds.

Database System Concepts

7.2

©Silberschatz, Korth and Sudarshan
Theory of Multivalued Dependencies
(Cont.)
4. Complementation rule. If α
holds.

β holds, then α

5. Multivalued augmentation rule. If α
δ ⊆ γ, then γ α
δ β holds.
6. Multivalued transitivity rule . If α
then α
γ – β holds.
7. Replication rule. If α

R–β–α

β holds and γ ⊆ R and
β holds and β

β holds, then α

γ holds,

β.

8. Coalescence rule. If α
β holds and γ ⊆ β and there is a δ
such that δ ⊆ R and δ ∩ β = ∅ and δ
γ, then α
γ holds.

Database System Concepts

7.3

©Silberschatz, Korth and Sudarshan
Simplification of the Computation of
D+
We can simplify the computation of the closure of D by using the
following rules (proved using rules 1-8).


Multivalued union rule. If α
α
βγ holds.



Intersection rule. If α
holds.



Difference rule. If If α
β holds and α
holds and α
γ – β holds.

Database System Concepts

β holds and α

β holds and α

7.4

γ holds, then

γ holds, then α
γ holds, then α

β∩γ
β–γ

©Silberschatz, Korth and Sudarshan
Example
R = (A, B, C, G, H, I)
D = {A
B
B
HI
CG H}
Some members of D+:


A
CGHI.
Since A
B, the complementation rule (4) implies that
A
R – B – A.
Since R – B – A = CGHI, so A
CGHI.



A
HI.
Since A
B and B
rule (6) implies that B
Since HI – B = HI, A

Database System Concepts

HI, the multivalued transitivity
HI – B.
HI.

7.5

©Silberschatz, Korth and Sudarshan
Example (Cont.)
Some members of D+ (cont.):


B
H.
Apply the coalescence rule (8); B
HI holds.
Since H ⊆ HI and CG
H and CG ∩ HI = Ø the
,
coalescence rule is satisfied with α being B, β being HI, δ being CG,
and γ being H. We conclude that B H.



A
CG.
A
CGHI and A
HI.
By the difference rule, A
Since CGHI – HI = CG, A

Database System Concepts

CGHI – HI.
CG.

7.6

©Silberschatz, Korth and Sudarshan
Normalization Using Join
Dependencies
Join dependencies constrain the set of legal relations over a schema
R to those relations for which a given decomposition is a lossless-join
decomposition.
Let R be a relation schema and R1 , R2 ,..., Rn be a decomposition of R.
If R = R1 ∪ R2 ∪ …. ∪ Rn, we say that a relation r(R) satisfies the join
dependency *(R1 , R2 ,..., Rn) if:
r =∏R1 (r) ⋈ ∏R2 (r) ⋈ …… ⋈ ∏Rn(r)
A join dependency is trivial if one of the Ri is R itself.
A join dependency *(R1, R2) is equivalent to the multivalued
dependency R1 ∩ R2
R2. Conversely, α
β is equivalent to
∪(R - β), α ∪ β)

*(α

However, there are join dependencies that are not equivalent to any
multivalued dependency.

Database System Concepts

7.7

©Silberschatz, Korth and Sudarshan
Project-Join Normal Form (PJNF)
A relation schema R is in PJNF with respect to a set D of functional,
multivalued, and join dependencies if for all join dependencies in D+
of the form
*(R1 , R2 ,..., Rn ) where each Ri ⊆ R
and R =R1∪ R2 ∪ ... ∪ Rn

at least one of the following holds:


*(R1 , R2 ,..., Rn ) is a trivial join dependency.



Every Ri is a superkey for R.

Since every multivalued dependency is also a join dependency,
every PJNF schema is also in 4NF.

Database System Concepts

7.8

©Silberschatz, Korth and Sudarshan
Example
Consider Loan-info-schema = (branch-name, customer-name, loannumber, amount).
Each loan has one or more customers, is in one or more branches
and has a loan amount; these relationships are independent, hence
we have the join dependency
*(=(loan-number, branch-name), (loan-number, customer-name),
(loan-number, amount))
Loan-info-schema is not in PJNF with respect to the set of
dependencies containing the above join dependency. To put Loaninfo-schema into PJNF, we must decompose it into the three
schemas specified by the join dependency:


(loan-number, branch-name)



(loan-number, customer-name)



(loan-number, amount)

Database System Concepts

7.9

©Silberschatz, Korth and Sudarshan
Domain-Key Normal Form (DKNY)
Domain declaration. Let A be an attribute, and let dom be a
set of values. The domain declaration A ⊆ dom requires that the
A value of all tuples be values in dom.
Key declaration. Let R be a relation schema with K ⊆ R. The
key declaration key (K) requires that K be a superkey for
schema R (K → R). All key declarations are functional
dependencies but not all functional dependencies are key
declarations.
General constraint. A general constraint is a predicate on the
set of all relations on a given schema.
Let D be a set of domain constraints and let K be a set of key
constraints for a relation schema R. Let G denote the general
constraints for R. Schema R is in DKNF if D ∪ K logically imply
G.

Database System Concepts

7.10

©Silberschatz, Korth and Sudarshan
Example
Accounts whose account-number begins with the digit 9 are
special high-interest accounts with a minimum balance of 2500.
General constraint: ``If the first digit of t [account-number] is 9,
then t [balance] ≥ 2500.''
DKNF design:
Regular-acct-schema = (branch-name, account-number, balance)
Special-acct-schema = (branch-name, account-number, balance)

Domain constraints for {Special-acct-schema} require that for
each account:


The account number begins with 9.



The balance is greater than 2500.

Database System Concepts

7.11

©Silberschatz, Korth and Sudarshan
DKNF rephrasing of PJNF Definition
Let R = (A1 , A2 ,..., An) be a relation schema. Let dom(Ai ) denote
the domain of attribute Ai, and let all these domains be infinite.
Then all domain constraints D are of the form Ai ⊆ dom (Ai ).
Let the general constraints be a set G of functional, multivalued,
or join dependencies. If F is the set of functional dependencies in
G, let the set K of key constraints be those nontrivial functional
dependencies in F+ of the form α → R.
Schema R is in PJNF if and only if it is in DKNF with respect to
D, K, and G.

Database System Concepts

7.12

©Silberschatz, Korth and Sudarshan

Contenu connexe

En vedette (15)

E3 chap-04
E3 chap-04E3 chap-04
E3 chap-04
 
Imk pertemuan-1
Imk pertemuan-1Imk pertemuan-1
Imk pertemuan-1
 
E3 chap-11
E3 chap-11E3 chap-11
E3 chap-11
 
Ch15
Ch15Ch15
Ch15
 
Ch13 protection
Ch13   protectionCh13   protection
Ch13 protection
 
Peubah acak-kontinu
Peubah acak-kontinuPeubah acak-kontinu
Peubah acak-kontinu
 
Hci [6]interaction design
Hci [6]interaction designHci [6]interaction design
Hci [6]interaction design
 
Ch2
Ch2Ch2
Ch2
 
E3 chap-06
E3 chap-06E3 chap-06
E3 chap-06
 
Ch22
Ch22Ch22
Ch22
 
E3 chap-03
E3 chap-03E3 chap-03
E3 chap-03
 
Ch6 cpu scheduling
Ch6   cpu schedulingCh6   cpu scheduling
Ch6 cpu scheduling
 
Ch12
Ch12Ch12
Ch12
 
Ch17
Ch17Ch17
Ch17
 
Ch1
Ch1Ch1
Ch1
 

Similaire à App c

Lecture_W9_Normalization.ppt
Lecture_W9_Normalization.pptLecture_W9_Normalization.ppt
Lecture_W9_Normalization.pptSadiaArifinSmrity
 
VNSISPL_DBMS_Concepts_AppC
VNSISPL_DBMS_Concepts_AppCVNSISPL_DBMS_Concepts_AppC
VNSISPL_DBMS_Concepts_AppCsriprasoon
 
DBMS-Ch7-MKB (1).pdf
DBMS-Ch7-MKB (1).pdfDBMS-Ch7-MKB (1).pdf
DBMS-Ch7-MKB (1).pdfAnikDas86
 
7. Relational Database Design in DBMS
7. Relational Database Design in DBMS7. Relational Database Design in DBMS
7. Relational Database Design in DBMSkoolkampus
 
Relational Algebra and relational queries .ppt
Relational Algebra and relational queries .pptRelational Algebra and relational queries .ppt
Relational Algebra and relational queries .pptShahidSultan24
 
Database System Concepts, 6th Ed.©Silberschatz, Korth and .docx
Database System Concepts, 6th Ed.©Silberschatz, Korth and .docxDatabase System Concepts, 6th Ed.©Silberschatz, Korth and .docx
Database System Concepts, 6th Ed.©Silberschatz, Korth and .docxrandyburney60861
 
Introduction to database-Normalisation
Introduction to database-NormalisationIntroduction to database-Normalisation
Introduction to database-NormalisationAjit Nayak
 
Intro to Relational Model
Intro to Relational ModelIntro to Relational Model
Intro to Relational ModelHazemWaheeb1
 
ch7.ppt ER Model lecture 102 slides set in ppt
ch7.ppt ER Model lecture 102 slides set in pptch7.ppt ER Model lecture 102 slides set in ppt
ch7.ppt ER Model lecture 102 slides set in pptFerdazdemir
 
DATABASE MANAGEMENT SYSTEMS ER MODEL.ppt
DATABASE MANAGEMENT SYSTEMS ER MODEL.pptDATABASE MANAGEMENT SYSTEMS ER MODEL.ppt
DATABASE MANAGEMENT SYSTEMS ER MODEL.pptYashShirude1
 
jhbuhbhujnhyubhbuybuybuybbuhyybuybuybuybybyubyubybybb
jhbuhbhujnhyubhbuybuybuybbuhyybuybuybuybybyubyubybybbjhbuhbhujnhyubhbuybuybuybbuhyybuybuybuybybyubyubybybb
jhbuhbhujnhyubhbuybuybuybbuhyybuybuybuybybyubyubybybbWrushabhShirsat3
 
DBMS_intermediate sql
DBMS_intermediate sqlDBMS_intermediate sql
DBMS_intermediate sqlAzizul Mamun
 

Similaire à App c (20)

App C
App CApp C
App C
 
Lecture_W9_Normalization.ppt
Lecture_W9_Normalization.pptLecture_W9_Normalization.ppt
Lecture_W9_Normalization.ppt
 
VNSISPL_DBMS_Concepts_AppC
VNSISPL_DBMS_Concepts_AppCVNSISPL_DBMS_Concepts_AppC
VNSISPL_DBMS_Concepts_AppC
 
DBMS-Ch7-MKB (1).pdf
DBMS-Ch7-MKB (1).pdfDBMS-Ch7-MKB (1).pdf
DBMS-Ch7-MKB (1).pdf
 
Ch7
Ch7Ch7
Ch7
 
7. Relational Database Design in DBMS
7. Relational Database Design in DBMS7. Relational Database Design in DBMS
7. Relational Database Design in DBMS
 
Relational Algebra and relational queries .ppt
Relational Algebra and relational queries .pptRelational Algebra and relational queries .ppt
Relational Algebra and relational queries .ppt
 
Database System Concepts, 6th Ed.©Silberschatz, Korth and .docx
Database System Concepts, 6th Ed.©Silberschatz, Korth and .docxDatabase System Concepts, 6th Ed.©Silberschatz, Korth and .docx
Database System Concepts, 6th Ed.©Silberschatz, Korth and .docx
 
Introduction to database-Normalisation
Introduction to database-NormalisationIntroduction to database-Normalisation
Introduction to database-Normalisation
 
Intro to Relational Model
Intro to Relational ModelIntro to Relational Model
Intro to Relational Model
 
Dbms unit-3
Dbms unit-3Dbms unit-3
Dbms unit-3
 
ch7-clean.ppt
ch7-clean.pptch7-clean.ppt
ch7-clean.ppt
 
Ch4
Ch4Ch4
Ch4
 
ER Models.ppt
ER Models.pptER Models.ppt
ER Models.ppt
 
ch7.ppt ER Model lecture 102 slides set in ppt
ch7.ppt ER Model lecture 102 slides set in pptch7.ppt ER Model lecture 102 slides set in ppt
ch7.ppt ER Model lecture 102 slides set in ppt
 
DATABASE MANAGEMENT SYSTEMS ER MODEL.ppt
DATABASE MANAGEMENT SYSTEMS ER MODEL.pptDATABASE MANAGEMENT SYSTEMS ER MODEL.ppt
DATABASE MANAGEMENT SYSTEMS ER MODEL.ppt
 
jhbuhbhujnhyubhbuybuybuybbuhyybuybuybuybybyubyubybybb
jhbuhbhujnhyubhbuybuybuybbuhyybuybuybuybybyubyubybybbjhbuhbhujnhyubhbuybuybuybbuhyybuybuybuybybyubyubybybb
jhbuhbhujnhyubhbuybuybuybbuhyybuybuybuybybyubyubybybb
 
ch2.ppt
ch2.pptch2.ppt
ch2.ppt
 
erfrombook.ppt
erfrombook.ppterfrombook.ppt
erfrombook.ppt
 
DBMS_intermediate sql
DBMS_intermediate sqlDBMS_intermediate sql
DBMS_intermediate sql
 

Dernier

POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppCeline George
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 

Dernier (20)

POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website App
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 

App c

  • 1. Appendix C: Advanced Normalization Theory Reasoning with MVDs Higher normal forms  Join dependencies and PJNF  DKNF Database System Concepts 7.1 ©Silberschatz, Korth and Sudarshan
  • 2. Theory of Multivalued Dependencies Let D denote a set of functional and multivalued dependencies. The closure D+ of D is the set of all functional and multivalued dependencies logically implied by D. Sound and complete inference rules for functional and multivalued dependencies: 1. Reflexivity rule. If α is a set of attributes and β ⊆ α, then α →β holds. 2. Augmentation rule. If α → β holds and γ is a set of attributes, then γ α→γ β holds. 3. Transitivity rule. If α → β holds and γ α→γ β holds, then α →γ holds. Database System Concepts 7.2 ©Silberschatz, Korth and Sudarshan
  • 3. Theory of Multivalued Dependencies (Cont.) 4. Complementation rule. If α holds. β holds, then α 5. Multivalued augmentation rule. If α δ ⊆ γ, then γ α δ β holds. 6. Multivalued transitivity rule . If α then α γ – β holds. 7. Replication rule. If α R–β–α β holds and γ ⊆ R and β holds and β β holds, then α γ holds, β. 8. Coalescence rule. If α β holds and γ ⊆ β and there is a δ such that δ ⊆ R and δ ∩ β = ∅ and δ γ, then α γ holds. Database System Concepts 7.3 ©Silberschatz, Korth and Sudarshan
  • 4. Simplification of the Computation of D+ We can simplify the computation of the closure of D by using the following rules (proved using rules 1-8).  Multivalued union rule. If α α βγ holds.  Intersection rule. If α holds.  Difference rule. If If α β holds and α holds and α γ – β holds. Database System Concepts β holds and α β holds and α 7.4 γ holds, then γ holds, then α γ holds, then α β∩γ β–γ ©Silberschatz, Korth and Sudarshan
  • 5. Example R = (A, B, C, G, H, I) D = {A B B HI CG H} Some members of D+:  A CGHI. Since A B, the complementation rule (4) implies that A R – B – A. Since R – B – A = CGHI, so A CGHI.  A HI. Since A B and B rule (6) implies that B Since HI – B = HI, A Database System Concepts HI, the multivalued transitivity HI – B. HI. 7.5 ©Silberschatz, Korth and Sudarshan
  • 6. Example (Cont.) Some members of D+ (cont.):  B H. Apply the coalescence rule (8); B HI holds. Since H ⊆ HI and CG H and CG ∩ HI = Ø the , coalescence rule is satisfied with α being B, β being HI, δ being CG, and γ being H. We conclude that B H.  A CG. A CGHI and A HI. By the difference rule, A Since CGHI – HI = CG, A Database System Concepts CGHI – HI. CG. 7.6 ©Silberschatz, Korth and Sudarshan
  • 7. Normalization Using Join Dependencies Join dependencies constrain the set of legal relations over a schema R to those relations for which a given decomposition is a lossless-join decomposition. Let R be a relation schema and R1 , R2 ,..., Rn be a decomposition of R. If R = R1 ∪ R2 ∪ …. ∪ Rn, we say that a relation r(R) satisfies the join dependency *(R1 , R2 ,..., Rn) if: r =∏R1 (r) ⋈ ∏R2 (r) ⋈ …… ⋈ ∏Rn(r) A join dependency is trivial if one of the Ri is R itself. A join dependency *(R1, R2) is equivalent to the multivalued dependency R1 ∩ R2 R2. Conversely, α β is equivalent to ∪(R - β), α ∪ β) *(α However, there are join dependencies that are not equivalent to any multivalued dependency. Database System Concepts 7.7 ©Silberschatz, Korth and Sudarshan
  • 8. Project-Join Normal Form (PJNF) A relation schema R is in PJNF with respect to a set D of functional, multivalued, and join dependencies if for all join dependencies in D+ of the form *(R1 , R2 ,..., Rn ) where each Ri ⊆ R and R =R1∪ R2 ∪ ... ∪ Rn at least one of the following holds:  *(R1 , R2 ,..., Rn ) is a trivial join dependency.  Every Ri is a superkey for R. Since every multivalued dependency is also a join dependency, every PJNF schema is also in 4NF. Database System Concepts 7.8 ©Silberschatz, Korth and Sudarshan
  • 9. Example Consider Loan-info-schema = (branch-name, customer-name, loannumber, amount). Each loan has one or more customers, is in one or more branches and has a loan amount; these relationships are independent, hence we have the join dependency *(=(loan-number, branch-name), (loan-number, customer-name), (loan-number, amount)) Loan-info-schema is not in PJNF with respect to the set of dependencies containing the above join dependency. To put Loaninfo-schema into PJNF, we must decompose it into the three schemas specified by the join dependency:  (loan-number, branch-name)  (loan-number, customer-name)  (loan-number, amount) Database System Concepts 7.9 ©Silberschatz, Korth and Sudarshan
  • 10. Domain-Key Normal Form (DKNY) Domain declaration. Let A be an attribute, and let dom be a set of values. The domain declaration A ⊆ dom requires that the A value of all tuples be values in dom. Key declaration. Let R be a relation schema with K ⊆ R. The key declaration key (K) requires that K be a superkey for schema R (K → R). All key declarations are functional dependencies but not all functional dependencies are key declarations. General constraint. A general constraint is a predicate on the set of all relations on a given schema. Let D be a set of domain constraints and let K be a set of key constraints for a relation schema R. Let G denote the general constraints for R. Schema R is in DKNF if D ∪ K logically imply G. Database System Concepts 7.10 ©Silberschatz, Korth and Sudarshan
  • 11. Example Accounts whose account-number begins with the digit 9 are special high-interest accounts with a minimum balance of 2500. General constraint: ``If the first digit of t [account-number] is 9, then t [balance] ≥ 2500.'' DKNF design: Regular-acct-schema = (branch-name, account-number, balance) Special-acct-schema = (branch-name, account-number, balance) Domain constraints for {Special-acct-schema} require that for each account:  The account number begins with 9.  The balance is greater than 2500. Database System Concepts 7.11 ©Silberschatz, Korth and Sudarshan
  • 12. DKNF rephrasing of PJNF Definition Let R = (A1 , A2 ,..., An) be a relation schema. Let dom(Ai ) denote the domain of attribute Ai, and let all these domains be infinite. Then all domain constraints D are of the form Ai ⊆ dom (Ai ). Let the general constraints be a set G of functional, multivalued, or join dependencies. If F is the set of functional dependencies in G, let the set K of key constraints be those nontrivial functional dependencies in F+ of the form α → R. Schema R is in PJNF if and only if it is in DKNF with respect to D, K, and G. Database System Concepts 7.12 ©Silberschatz, Korth and Sudarshan