SlideShare ist ein Scribd-Unternehmen logo
1 von 26
Relational Database Design  Functional Dependencies
Functional Dependencies (FD) - Definition ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Trivial FDs ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Functional Dependencies and Keys ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Superkeys and Candidate Keys ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Reasoning about Functional Dependencies ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Armstrong’s Axioms ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Properties of Armstrong’s Axioms ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Additional Rules based on Armstrong’s axioms ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Closure of a Set of Functional Dependencies ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Closure of a Set of Attributes ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Algorithm for Computing the Closure of a Set of Attributes  ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Closure of a Set of Attributes: Example ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Uses of Attribute Closure ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Redundancy of FDs ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Canonical Cover ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Example of Computing a Canonical Cover ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Pitfalls in Relational Database Design ,[object Object],[object Object],[object Object]
Problems of Bad Design Redundant storage Update anomaly Potential   deletion   anomaly Insertion anomaly Assume the position determines the salary: position  -> salary key T1 first_name last_name address department position salary Dewi Srijaya 12a Jln Lempeng Toys clerk 2000 Izabel Leong 10 Outram Park Sports trainee 1200 John Smith 107 Clementi Rd Toys clerk 2000 Axel Bayer 55 Cuscaden Rd Sports trainee 1200 Winny Lee 10 West Coast Rd Sports manager 2500 Sylvia Tok 22 East Coast Lane Toys manager 2600 Eric Wei 100 Jurong drive Toys assistant manager 2200 ? ? ? ? security guard 1500
Decomposition Example T2 T3 ,[object Object],[object Object],[object Object],[object Object],first_name last_name address department position Dewi Srijaya 12a Jln lempeng Toys clerk Izabel Leong 10 Outram Park Sports trainee John Smith 107 Clementi Rd Toys clerk Axel Bayer 55 Cuscaden Rd Sports trainee Winny Lee 10 West Coast Rd Sports manager Sylvia Tok 22 East Coast Lane Toys manager Eric Wei 100 Jurong drive Toys assistant manager position salary clerk 2000 trainee 1200 manager 2500 assistant manager 2200 security guard 1500
Normalization ,[object Object],[object Object],[object Object],[object Object]
Lossless Join Decomposition ,[object Object],[object Object],[object Object],[object Object],[object Object]
Lossy Decomposition Example Lossy-join decompositions result in information loss. Example: Decomposition of R= (A,B)   into R1=(A) and R2=(B) A B a a b 1 2 1 A a b B 1 2 R1=  A (R)  A (R)   B (R) A B a a b b 1 2 1 2 R1=  B (R) R
Dependency Preserving Decomposition ,[object Object],[object Object],[object Object],[object Object]
Non-Dependency Preserving  Decomposition Example R = (A, B, C), F = {{A}{B}, {B}{C},  {A}{C} }.  Key: A There is a dependency {B} {C}, where the LHS is not the key, meaning that there can be considerable redundancy in R.  Solution: Break it in two tables R1(A,B), R2(A,C) ( normalization ) The decomposition is  lossless  because the common attribute A is a key for R1 (and R2) The decomposition is  not dependency preserving  because F1={{A}{B}}, F2={{A}{C}} and (F1F2)+F+  We lost the FD {B}{C}.  In practical terms, each FD is implemented as a constraint or assertion, which it is checked when there are updates. In the above example, in order to find violations, we have to join R1 and R2. Can be very expensive.  A B C 1 2 3 2 2 3 3 2 3 4 2 4 A C 1 3 2 3 3 3 4 4 A B 1 2 2 2 3 2 4 2
Dependency Preserving  Decomposition Example R = (A, B, C), F = {{A}{B}, {B}{C},  {A}{C} }.  Key: A Break R in two tables R1(A,B), R2(B,C) The decomposition is  lossless  because the common attribute B is a key for R2 The decomposition is  dependency preserving  because F1={{A}{B}}, F2={{B}{C}} and (F1F2)+=F+  Violations can be found by inspecting the individual tables, without performing a join.  A B C 1 2 3 2 2 3 3 2 3 4 2 4 A B 1 2 2 2 3 2 4 2 B C 2 3 2 4

Weitere ähnliche Inhalte

Was ist angesagt?

Category Theory made easy with (ugly) pictures
Category Theory made easy with (ugly) picturesCategory Theory made easy with (ugly) pictures
Category Theory made easy with (ugly) picturesAshwin Rao
 
Integration material
Integration material Integration material
Integration material Surya Swaroop
 
Relations & functions
Relations & functionsRelations & functions
Relations & functionsindu thakur
 
Prerequisite for metric space
Prerequisite for metric spacePrerequisite for metric space
Prerequisite for metric spaceROHAN GAIKWAD
 
Computational logic First Order Logic
Computational logic First Order LogicComputational logic First Order Logic
Computational logic First Order Logicbanujahir1
 
2015 CMS Winter Meeting Poster
2015 CMS Winter Meeting Poster2015 CMS Winter Meeting Poster
2015 CMS Winter Meeting PosterChelsea Battell
 
Computational logic First Order Logic_part2
Computational logic First Order Logic_part2Computational logic First Order Logic_part2
Computational logic First Order Logic_part2banujahir1
 
mathematical functions
mathematical functions mathematical functions
mathematical functions Anshul gour
 
Computational logic Propositional Calculus proof system
Computational logic Propositional Calculus proof system Computational logic Propositional Calculus proof system
Computational logic Propositional Calculus proof system banujahir1
 
Finite automata intro
Finite automata introFinite automata intro
Finite automata introlavishka_anuj
 

Was ist angesagt? (18)

Category Theory made easy with (ugly) pictures
Category Theory made easy with (ugly) picturesCategory Theory made easy with (ugly) pictures
Category Theory made easy with (ugly) pictures
 
Integration material
Integration material Integration material
Integration material
 
Relations & functions
Relations & functionsRelations & functions
Relations & functions
 
Prerequisite for metric space
Prerequisite for metric spacePrerequisite for metric space
Prerequisite for metric space
 
Pl vol1
Pl vol1Pl vol1
Pl vol1
 
Functions limits and continuity
Functions limits and continuityFunctions limits and continuity
Functions limits and continuity
 
18560 lecture6
18560 lecture618560 lecture6
18560 lecture6
 
Computational logic First Order Logic
Computational logic First Order LogicComputational logic First Order Logic
Computational logic First Order Logic
 
2015 CMS Winter Meeting Poster
2015 CMS Winter Meeting Poster2015 CMS Winter Meeting Poster
2015 CMS Winter Meeting Poster
 
Math task 3
Math task 3Math task 3
Math task 3
 
Computational logic First Order Logic_part2
Computational logic First Order Logic_part2Computational logic First Order Logic_part2
Computational logic First Order Logic_part2
 
Task 4
Task 4Task 4
Task 4
 
mathematical functions
mathematical functions mathematical functions
mathematical functions
 
Computational logic Propositional Calculus proof system
Computational logic Propositional Calculus proof system Computational logic Propositional Calculus proof system
Computational logic Propositional Calculus proof system
 
Finite automata intro
Finite automata introFinite automata intro
Finite automata intro
 
Jeop game-final-review
Jeop game-final-reviewJeop game-final-review
Jeop game-final-review
 
Lesson 5: Continuity
Lesson 5: ContinuityLesson 5: Continuity
Lesson 5: Continuity
 
Functions (Theory)
Functions (Theory)Functions (Theory)
Functions (Theory)
 

Ähnlich wie test

2.1 Basics of Functions and Their Graphs
2.1 Basics of Functions and Their Graphs2.1 Basics of Functions and Their Graphs
2.1 Basics of Functions and Their Graphssmiller5
 
7. Relational Database Design in DBMS
7. Relational Database Design in DBMS7. Relational Database Design in DBMS
7. Relational Database Design in DBMSkoolkampus
 
MODULE 4 -Normalization_1.ppt
MODULE 4 -Normalization_1.pptMODULE 4 -Normalization_1.ppt
MODULE 4 -Normalization_1.pptBelkinAntony1
 
3.1 Functions and Function Notation
3.1 Functions and Function Notation3.1 Functions and Function Notation
3.1 Functions and Function Notationsmiller5
 
Functional dependencies in Database Management System
Functional dependencies in Database Management SystemFunctional dependencies in Database Management System
Functional dependencies in Database Management SystemKevin Jadiya
 
Relations and function class xii copy
Relations and function class xii   copyRelations and function class xii   copy
Relations and function class xii copycsanjeive
 
Introduction to database-Normalisation
Introduction to database-NormalisationIntroduction to database-Normalisation
Introduction to database-NormalisationAjit Nayak
 
DBMS Unit 3.pptx
DBMS Unit 3.pptxDBMS Unit 3.pptx
DBMS Unit 3.pptxAmitDrKhare
 
Relations & functions.pps
Relations  &  functions.ppsRelations  &  functions.pps
Relations & functions.ppsindu psthakur
 
2.3 Functions
2.3 Functions2.3 Functions
2.3 Functionssmiller5
 
Database Management System [DBMS]
Database Management System [DBMS]Database Management System [DBMS]
Database Management System [DBMS]Shalabh Chaudhary
 

Ähnlich wie test (20)

Cs501 fd nf
Cs501 fd nfCs501 fd nf
Cs501 fd nf
 
2.1 Basics of Functions and Their Graphs
2.1 Basics of Functions and Their Graphs2.1 Basics of Functions and Their Graphs
2.1 Basics of Functions and Their Graphs
 
7. Relational Database Design in DBMS
7. Relational Database Design in DBMS7. Relational Database Design in DBMS
7. Relational Database Design in DBMS
 
MODULE 4 -Normalization_1.ppt
MODULE 4 -Normalization_1.pptMODULE 4 -Normalization_1.ppt
MODULE 4 -Normalization_1.ppt
 
Unit05 dbms
Unit05 dbmsUnit05 dbms
Unit05 dbms
 
3.1 Functions and Function Notation
3.1 Functions and Function Notation3.1 Functions and Function Notation
3.1 Functions and Function Notation
 
Functional dependencies in Database Management System
Functional dependencies in Database Management SystemFunctional dependencies in Database Management System
Functional dependencies in Database Management System
 
Relations and function class xii copy
Relations and function class xii   copyRelations and function class xii   copy
Relations and function class xii copy
 
Introduction to database-Normalisation
Introduction to database-NormalisationIntroduction to database-Normalisation
Introduction to database-Normalisation
 
7 functions
7   functions7   functions
7 functions
 
DBMS Unit 3.pptx
DBMS Unit 3.pptxDBMS Unit 3.pptx
DBMS Unit 3.pptx
 
Dbms3
Dbms3Dbms3
Dbms3
 
Functional dependency
Functional dependencyFunctional dependency
Functional dependency
 
Relation and function_xii
Relation and function_xiiRelation and function_xii
Relation and function_xii
 
Relations & functions.pps
Relations  &  functions.ppsRelations  &  functions.pps
Relations & functions.pps
 
UNIT 2 -PPT.pptx
UNIT 2 -PPT.pptxUNIT 2 -PPT.pptx
UNIT 2 -PPT.pptx
 
Ra Revision
Ra RevisionRa Revision
Ra Revision
 
2.3 Functions
2.3 Functions2.3 Functions
2.3 Functions
 
Database Management System [DBMS]
Database Management System [DBMS]Database Management System [DBMS]
Database Management System [DBMS]
 
Functional dependency
Functional dependencyFunctional dependency
Functional dependency
 

Kürzlich hochgeladen

Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelDeepika Singh
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024The Digital Insurer
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024The Digital Insurer
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusZilliz
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 

Kürzlich hochgeladen (20)

Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 

test

  • 1. Relational Database Design Functional Dependencies
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19. Problems of Bad Design Redundant storage Update anomaly Potential deletion anomaly Insertion anomaly Assume the position determines the salary: position -> salary key T1 first_name last_name address department position salary Dewi Srijaya 12a Jln Lempeng Toys clerk 2000 Izabel Leong 10 Outram Park Sports trainee 1200 John Smith 107 Clementi Rd Toys clerk 2000 Axel Bayer 55 Cuscaden Rd Sports trainee 1200 Winny Lee 10 West Coast Rd Sports manager 2500 Sylvia Tok 22 East Coast Lane Toys manager 2600 Eric Wei 100 Jurong drive Toys assistant manager 2200 ? ? ? ? security guard 1500
  • 20.
  • 21.
  • 22.
  • 23. Lossy Decomposition Example Lossy-join decompositions result in information loss. Example: Decomposition of R= (A,B) into R1=(A) and R2=(B) A B a a b 1 2 1 A a b B 1 2 R1=  A (R)  A (R)  B (R) A B a a b b 1 2 1 2 R1=  B (R) R
  • 24.
  • 25. Non-Dependency Preserving Decomposition Example R = (A, B, C), F = {{A}{B}, {B}{C}, {A}{C} }. Key: A There is a dependency {B} {C}, where the LHS is not the key, meaning that there can be considerable redundancy in R. Solution: Break it in two tables R1(A,B), R2(A,C) ( normalization ) The decomposition is lossless because the common attribute A is a key for R1 (and R2) The decomposition is not dependency preserving because F1={{A}{B}}, F2={{A}{C}} and (F1F2)+F+ We lost the FD {B}{C}. In practical terms, each FD is implemented as a constraint or assertion, which it is checked when there are updates. In the above example, in order to find violations, we have to join R1 and R2. Can be very expensive. A B C 1 2 3 2 2 3 3 2 3 4 2 4 A C 1 3 2 3 3 3 4 4 A B 1 2 2 2 3 2 4 2
  • 26. Dependency Preserving Decomposition Example R = (A, B, C), F = {{A}{B}, {B}{C}, {A}{C} }. Key: A Break R in two tables R1(A,B), R2(B,C) The decomposition is lossless because the common attribute B is a key for R2 The decomposition is dependency preserving because F1={{A}{B}}, F2={{B}{C}} and (F1F2)+=F+ Violations can be found by inspecting the individual tables, without performing a join. A B C 1 2 3 2 2 3 3 2 3 4 2 4 A B 1 2 2 2 3 2 4 2 B C 2 3 2 4