SlideShare a Scribd company logo
1 of 11
Closure of an Attribute Set
Closure of an attribute set 
Given a set of attributes A and a set of FDs F, closure of A under F is 
the set of all attributes implied by A 
In other words, the largest B such that: 
 A  B 
Redefining super keys: 
 The closure of a super key is the entire relation schema 
Redefining candidate keys: 
1. It is a super key 
2. No subset of it is a super key
Computing the closure for A 
Simple algorithm 
1. Start with B = A. 
2. Go over all functional dependencies, b ® g , in F+ 
3. If b Í B, then 
 Add g to B 
4. Repeat till B changes
Example 
 R = (A, B, C, G, H, I) 
F = { A ® B 
A ® C 
CG ® H 
CG ® I 
B ® H} 
 (AG) + ? 
 1. result = AG 
2. result = ABCG (A ® C and A ® B) 
3. result = ABCGH (CG ® H and CG Í AGBC) 
4. result = ABCGHI (CG ® I and CG Í AGBCH 
 Is (AG) a candidate key ? 
 1. It is a super key. 
 2. (A+) = BC, (G+) = G. 
 YES.
Uses of attribute set closures 
 Determining superkeys and candidate keys 
 Determining if A  B is a valid FD 
 Check if A+ contains B 
 Can be used to compute F+
Computing Canonical Cover
Canonical Cover 
A canonical cover for F is a set of dependencies Fc such that 
F logically implies all dependencies in Fc, and 
Fc logically implies all dependencies in F, and 
No functional dependency in Fc contains an extraneous 
attribute, and 
Each left side of functional dependency in Fc is unique 
Intuitively, a canonical cover of F is a “minimal” set of 
functional dependencies equivalent to F, having no 
redundant dependencies or redundant parts of dependencies
Extraneous Attributes 
Consider F, and a functional dependency, A  B. 
“Extraneous”: Are there any attributes in A or B that can be 
safely removed ? 
Without changing the constraints implied by F
Testing if an Attribute is Extraneous 
 Consider a set F of functional dependencies and the 
functional dependency a ® b in F. 
 To test if attribute A Î a is extraneous in a 
1. compute ({a} – A)+ using the dependencies in F 
2. check that ({a} – A)+ contains A; if it does, A is extraneous 
 To test if attribute A Î b is extraneous in b 
1. compute a+ using only the dependencies in 
F’ = (F – {a ® b}) È {a ®(b – A)}, 
2. check that a+ contains A; if it does, A is extraneous
Example1: Computing a Canonical Cover 
 R = (A, B, C) 
F = {A ® BC 
B ® C 
A ® B 
AB ® C} 
 Combine A ® BC and A ® B into A ® BC 
Set is now {A ® BC, B ® C, AB ® C} 
 A is extraneous in AB ® C 
Check if the result of deleting A from AB ® C is implied by the other 
dependencies 
Yes: in fact, B ® C is already present! 
Set is now {A ® BC, B ® C} 
 C is extraneous in A ® BC 
Check if A ® C is logically implied by A ® B and the other dependencies 
Yes: using transitivity on A ® B and B ® C. 
 Can use attribute closure of A in more complex cases 
 The canonical cover is: A ® B 
B ® C
Example2: Computing a Canonical Cover 
Given F = {A ® C, AB ® C } 
B is extraneous in AB ® C because {A ® C, AB ® C} is 
equivalent to {A ® C, A ® C } = {A ® C} 
Given F = {A ® C, AB ® CD} 
C is extraneous in AB ® CD because {A ® C, AB ® CD} is 
equivalent to {A ® C, AB ® D}

More Related Content

What's hot

Time and space complexity
Time and space complexityTime and space complexity
Time and space complexityAnkit Katiyar
 
Biconnected components (13024116056)
Biconnected components (13024116056)Biconnected components (13024116056)
Biconnected components (13024116056)Akshay soni
 
Data mining Measuring similarity and desimilarity
Data mining Measuring similarity and desimilarityData mining Measuring similarity and desimilarity
Data mining Measuring similarity and desimilarityRushali Deshmukh
 
0 1 knapsack using branch and bound
0 1 knapsack using branch and bound0 1 knapsack using branch and bound
0 1 knapsack using branch and boundAbhishek Singh
 
Performance analysis(Time & Space Complexity)
Performance analysis(Time & Space Complexity)Performance analysis(Time & Space Complexity)
Performance analysis(Time & Space Complexity)swapnac12
 
daa-unit-3-greedy method
daa-unit-3-greedy methoddaa-unit-3-greedy method
daa-unit-3-greedy methodhodcsencet
 
Bayseian decision theory
Bayseian decision theoryBayseian decision theory
Bayseian decision theorysia16
 
Push Down Automata (PDA) | TOC (Theory of Computation) | NPDA | DPDA
Push Down Automata (PDA) | TOC  (Theory of Computation) | NPDA | DPDAPush Down Automata (PDA) | TOC  (Theory of Computation) | NPDA | DPDA
Push Down Automata (PDA) | TOC (Theory of Computation) | NPDA | DPDAAshish Duggal
 
Symbol table in compiler Design
Symbol table in compiler DesignSymbol table in compiler Design
Symbol table in compiler DesignKuppusamy P
 
Shortest path (Dijkistra's Algorithm) & Spanning Tree (Prim's Algorithm)
Shortest path (Dijkistra's Algorithm) & Spanning Tree (Prim's Algorithm)Shortest path (Dijkistra's Algorithm) & Spanning Tree (Prim's Algorithm)
Shortest path (Dijkistra's Algorithm) & Spanning Tree (Prim's Algorithm)Mohanlal Sukhadia University (MLSU)
 
I. AO* SEARCH ALGORITHM
I. AO* SEARCH ALGORITHMI. AO* SEARCH ALGORITHM
I. AO* SEARCH ALGORITHMvikas dhakane
 
Dag representation of basic blocks
Dag representation of basic blocksDag representation of basic blocks
Dag representation of basic blocksJothi Lakshmi
 
Semantic net in AI
Semantic net in AISemantic net in AI
Semantic net in AIShahDhruv21
 
Code optimization in compiler design
Code optimization in compiler designCode optimization in compiler design
Code optimization in compiler designKuppusamy P
 

What's hot (20)

Time and space complexity
Time and space complexityTime and space complexity
Time and space complexity
 
Biconnected components (13024116056)
Biconnected components (13024116056)Biconnected components (13024116056)
Biconnected components (13024116056)
 
Asymptotic notation
Asymptotic notationAsymptotic notation
Asymptotic notation
 
Data mining Measuring similarity and desimilarity
Data mining Measuring similarity and desimilarityData mining Measuring similarity and desimilarity
Data mining Measuring similarity and desimilarity
 
0 1 knapsack using branch and bound
0 1 knapsack using branch and bound0 1 knapsack using branch and bound
0 1 knapsack using branch and bound
 
Performance analysis(Time & Space Complexity)
Performance analysis(Time & Space Complexity)Performance analysis(Time & Space Complexity)
Performance analysis(Time & Space Complexity)
 
Functional dependency
Functional dependencyFunctional dependency
Functional dependency
 
daa-unit-3-greedy method
daa-unit-3-greedy methoddaa-unit-3-greedy method
daa-unit-3-greedy method
 
Asymptotic Notation
Asymptotic NotationAsymptotic Notation
Asymptotic Notation
 
Bayseian decision theory
Bayseian decision theoryBayseian decision theory
Bayseian decision theory
 
Push Down Automata (PDA) | TOC (Theory of Computation) | NPDA | DPDA
Push Down Automata (PDA) | TOC  (Theory of Computation) | NPDA | DPDAPush Down Automata (PDA) | TOC  (Theory of Computation) | NPDA | DPDA
Push Down Automata (PDA) | TOC (Theory of Computation) | NPDA | DPDA
 
Symbol table in compiler Design
Symbol table in compiler DesignSymbol table in compiler Design
Symbol table in compiler Design
 
Specification-of-tokens
Specification-of-tokensSpecification-of-tokens
Specification-of-tokens
 
B and B+ tree
B and B+ treeB and B+ tree
B and B+ tree
 
Shortest path (Dijkistra's Algorithm) & Spanning Tree (Prim's Algorithm)
Shortest path (Dijkistra's Algorithm) & Spanning Tree (Prim's Algorithm)Shortest path (Dijkistra's Algorithm) & Spanning Tree (Prim's Algorithm)
Shortest path (Dijkistra's Algorithm) & Spanning Tree (Prim's Algorithm)
 
I. AO* SEARCH ALGORITHM
I. AO* SEARCH ALGORITHMI. AO* SEARCH ALGORITHM
I. AO* SEARCH ALGORITHM
 
Dag representation of basic blocks
Dag representation of basic blocksDag representation of basic blocks
Dag representation of basic blocks
 
Semantic net in AI
Semantic net in AISemantic net in AI
Semantic net in AI
 
Code optimization in compiler design
Code optimization in compiler designCode optimization in compiler design
Code optimization in compiler design
 
Recognition-of-tokens
Recognition-of-tokensRecognition-of-tokens
Recognition-of-tokens
 

Similar to DBMS Canonical cover

DBMS FDs and Normalization.pptx
DBMS FDs and Normalization.pptxDBMS FDs and Normalization.pptx
DBMS FDs and Normalization.pptxSakshamLal3
 
DBMS-Normalization.ppt
DBMS-Normalization.pptDBMS-Normalization.ppt
DBMS-Normalization.pptKalpanaThakre2
 
7. Relational Database Design in DBMS
7. Relational Database Design in DBMS7. Relational Database Design in DBMS
7. Relational Database Design in DBMSkoolkampus
 
FUNCTION M05 THEOREMS WITH PROOFS FOR BOARD LEVEL
FUNCTION  M05 THEOREMS WITH PROOFS FOR BOARD LEVELFUNCTION  M05 THEOREMS WITH PROOFS FOR BOARD LEVEL
FUNCTION M05 THEOREMS WITH PROOFS FOR BOARD LEVELMohanSonawane
 
8functions
8functions8functions
8functionsmanrak
 
mathematical functions
mathematical functions mathematical functions
mathematical functions Anshul gour
 
Functional dependencies in Database Management System
Functional dependencies in Database Management SystemFunctional dependencies in Database Management System
Functional dependencies in Database Management SystemKevin Jadiya
 
The concept of functions.pptx
The concept of functions.pptxThe concept of functions.pptx
The concept of functions.pptxMTiti1
 
CMSC 56 | Lecture 9: Functions Representations
CMSC 56 | Lecture 9: Functions RepresentationsCMSC 56 | Lecture 9: Functions Representations
CMSC 56 | Lecture 9: Functions Representationsallyn joy calcaben
 
Composition of functions
Composition of functions Composition of functions
Composition of functions Tyler Murphy
 
Database normalization
Database normalizationDatabase normalization
Database normalizationVARSHAKUMARI49
 
Switching theory and logic design.
Switching theory and logic design.Switching theory and logic design.
Switching theory and logic design.Anto Jose Moyalan
 
Ch 2 lattice & boolean algebra
Ch 2 lattice & boolean algebraCh 2 lattice & boolean algebra
Ch 2 lattice & boolean algebraRupali Rana
 

Similar to DBMS Canonical cover (18)

Assignment#16
Assignment#16Assignment#16
Assignment#16
 
DBMS FDs and Normalization.pptx
DBMS FDs and Normalization.pptxDBMS FDs and Normalization.pptx
DBMS FDs and Normalization.pptx
 
Micro teaching junior high school
Micro teaching junior high schoolMicro teaching junior high school
Micro teaching junior high school
 
Micro teaching
Micro teachingMicro teaching
Micro teaching
 
DBMS-Normalization.ppt
DBMS-Normalization.pptDBMS-Normalization.ppt
DBMS-Normalization.ppt
 
7. Relational Database Design in DBMS
7. Relational Database Design in DBMS7. Relational Database Design in DBMS
7. Relational Database Design in DBMS
 
FUNCTION M05 THEOREMS WITH PROOFS FOR BOARD LEVEL
FUNCTION  M05 THEOREMS WITH PROOFS FOR BOARD LEVELFUNCTION  M05 THEOREMS WITH PROOFS FOR BOARD LEVEL
FUNCTION M05 THEOREMS WITH PROOFS FOR BOARD LEVEL
 
18560 lecture6
18560 lecture618560 lecture6
18560 lecture6
 
8functions
8functions8functions
8functions
 
mathematical functions
mathematical functions mathematical functions
mathematical functions
 
Functional dependencies in Database Management System
Functional dependencies in Database Management SystemFunctional dependencies in Database Management System
Functional dependencies in Database Management System
 
The concept of functions.pptx
The concept of functions.pptxThe concept of functions.pptx
The concept of functions.pptx
 
Cs501 fd nf
Cs501 fd nfCs501 fd nf
Cs501 fd nf
 
CMSC 56 | Lecture 9: Functions Representations
CMSC 56 | Lecture 9: Functions RepresentationsCMSC 56 | Lecture 9: Functions Representations
CMSC 56 | Lecture 9: Functions Representations
 
Composition of functions
Composition of functions Composition of functions
Composition of functions
 
Database normalization
Database normalizationDatabase normalization
Database normalization
 
Switching theory and logic design.
Switching theory and logic design.Switching theory and logic design.
Switching theory and logic design.
 
Ch 2 lattice & boolean algebra
Ch 2 lattice & boolean algebraCh 2 lattice & boolean algebra
Ch 2 lattice & boolean algebra
 

Recently uploaded

Introduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaIntroduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaOmar Fathy
 
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxS1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxSCMS School of Architecture
 
Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxJuliansyahHarahap1
 
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptxA CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptxmaisarahman1
 
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills KuwaitKuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwaitjaanualu31
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXssuser89054b
 
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
COST-EFFETIVE  and Energy Efficient BUILDINGS ptxCOST-EFFETIVE  and Energy Efficient BUILDINGS ptx
COST-EFFETIVE and Energy Efficient BUILDINGS ptxJIT KUMAR GUPTA
 
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments""Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"mphochane1998
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . pptDineshKumar4165
 
Minimum and Maximum Modes of microprocessor 8086
Minimum and Maximum Modes of microprocessor 8086Minimum and Maximum Modes of microprocessor 8086
Minimum and Maximum Modes of microprocessor 8086anil_gaur
 
kiln thermal load.pptx kiln tgermal load
kiln thermal load.pptx kiln tgermal loadkiln thermal load.pptx kiln tgermal load
kiln thermal load.pptx kiln tgermal loadhamedmustafa094
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueBhangaleSonal
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapRishantSharmaFr
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startQuintin Balsdon
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayEpec Engineered Technologies
 
Bridge Jacking Design Sample Calculation.pptx
Bridge Jacking Design Sample Calculation.pptxBridge Jacking Design Sample Calculation.pptx
Bridge Jacking Design Sample Calculation.pptxnuruddin69
 
Online food ordering system project report.pdf
Online food ordering system project report.pdfOnline food ordering system project report.pdf
Online food ordering system project report.pdfKamal Acharya
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfJiananWang21
 

Recently uploaded (20)

Introduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaIntroduction to Serverless with AWS Lambda
Introduction to Serverless with AWS Lambda
 
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxS1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
 
Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptx
 
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptxA CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
 
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills KuwaitKuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
COST-EFFETIVE  and Energy Efficient BUILDINGS ptxCOST-EFFETIVE  and Energy Efficient BUILDINGS ptx
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
 
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments""Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
 
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . ppt
 
Minimum and Maximum Modes of microprocessor 8086
Minimum and Maximum Modes of microprocessor 8086Minimum and Maximum Modes of microprocessor 8086
Minimum and Maximum Modes of microprocessor 8086
 
kiln thermal load.pptx kiln tgermal load
kiln thermal load.pptx kiln tgermal loadkiln thermal load.pptx kiln tgermal load
kiln thermal load.pptx kiln tgermal load
 
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced LoadsFEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torque
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leap
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the start
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
 
Bridge Jacking Design Sample Calculation.pptx
Bridge Jacking Design Sample Calculation.pptxBridge Jacking Design Sample Calculation.pptx
Bridge Jacking Design Sample Calculation.pptx
 
Online food ordering system project report.pdf
Online food ordering system project report.pdfOnline food ordering system project report.pdf
Online food ordering system project report.pdf
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdf
 

DBMS Canonical cover

  • 1. Closure of an Attribute Set
  • 2. Closure of an attribute set Given a set of attributes A and a set of FDs F, closure of A under F is the set of all attributes implied by A In other words, the largest B such that:  A  B Redefining super keys:  The closure of a super key is the entire relation schema Redefining candidate keys: 1. It is a super key 2. No subset of it is a super key
  • 3. Computing the closure for A Simple algorithm 1. Start with B = A. 2. Go over all functional dependencies, b ® g , in F+ 3. If b Í B, then  Add g to B 4. Repeat till B changes
  • 4. Example  R = (A, B, C, G, H, I) F = { A ® B A ® C CG ® H CG ® I B ® H}  (AG) + ?  1. result = AG 2. result = ABCG (A ® C and A ® B) 3. result = ABCGH (CG ® H and CG Í AGBC) 4. result = ABCGHI (CG ® I and CG Í AGBCH  Is (AG) a candidate key ?  1. It is a super key.  2. (A+) = BC, (G+) = G.  YES.
  • 5. Uses of attribute set closures  Determining superkeys and candidate keys  Determining if A  B is a valid FD  Check if A+ contains B  Can be used to compute F+
  • 7. Canonical Cover A canonical cover for F is a set of dependencies Fc such that F logically implies all dependencies in Fc, and Fc logically implies all dependencies in F, and No functional dependency in Fc contains an extraneous attribute, and Each left side of functional dependency in Fc is unique Intuitively, a canonical cover of F is a “minimal” set of functional dependencies equivalent to F, having no redundant dependencies or redundant parts of dependencies
  • 8. Extraneous Attributes Consider F, and a functional dependency, A  B. “Extraneous”: Are there any attributes in A or B that can be safely removed ? Without changing the constraints implied by F
  • 9. Testing if an Attribute is Extraneous  Consider a set F of functional dependencies and the functional dependency a ® b in F.  To test if attribute A Î a is extraneous in a 1. compute ({a} – A)+ using the dependencies in F 2. check that ({a} – A)+ contains A; if it does, A is extraneous  To test if attribute A Î b is extraneous in b 1. compute a+ using only the dependencies in F’ = (F – {a ® b}) È {a ®(b – A)}, 2. check that a+ contains A; if it does, A is extraneous
  • 10. Example1: Computing a Canonical Cover  R = (A, B, C) F = {A ® BC B ® C A ® B AB ® C}  Combine A ® BC and A ® B into A ® BC Set is now {A ® BC, B ® C, AB ® C}  A is extraneous in AB ® C Check if the result of deleting A from AB ® C is implied by the other dependencies Yes: in fact, B ® C is already present! Set is now {A ® BC, B ® C}  C is extraneous in A ® BC Check if A ® C is logically implied by A ® B and the other dependencies Yes: using transitivity on A ® B and B ® C.  Can use attribute closure of A in more complex cases  The canonical cover is: A ® B B ® C
  • 11. Example2: Computing a Canonical Cover Given F = {A ® C, AB ® C } B is extraneous in AB ® C because {A ® C, AB ® C} is equivalent to {A ® C, A ® C } = {A ® C} Given F = {A ® C, AB ® CD} C is extraneous in AB ® CD because {A ® C, AB ® CD} is equivalent to {A ® C, AB ® D}