Functional Dependency

Slides:



Advertisements
Similar presentations
Manipulating Functional Dependencies Zaki Malik September 30, 2008.
Advertisements

Temple University – CIS Dept. CIS616– Principles of Data Management V. Megalooikonomou Functional Dependencies (based on notes by Silberchatz,Korth, and.
Database Management COP4540, SCS, FIU Functional Dependencies (Chapter 14)
Topics to be discusses Functional Dependency Key
©Silberschatz, Korth and Sudarshan Relational Database Design First Normal Form Pitfalls in Relational Database Design Functional Dependencies Decomposition.
7.1 Chapter 7: Relational Database Design. 7.2 Chapter 7: Relational Database Design Features of Good Relational Design Atomic Domains and First Normal.
Chapter 7: Relational Database Design. ©Silberschatz, Korth and Sudarshan7.2Database System Concepts Chapter 7: Relational Database Design First Normal.
Chapter 7: Relational Database Design. ©Silberschatz, Korth and Sudarshan7.2Database System Concepts Chapter 7: Relational Database Design First Normal.
CMSC424: Database Design Instructor: Amol Deshpande
1 CMSC424, Spring 2005 CMSC424: Database Design Lecture 9.
Chapter 8: Relational Database Design First Normal Form First Normal Form Functional Dependencies Functional Dependencies Decomposition Decomposition Boyce-Codd.
©Silberschatz, Korth and Sudarshan7.1Database System Concepts Chapter 7: Relational Database Design First Normal Form Pitfalls in Relational Database Design.
Department of Computer Science and Engineering, HKUST Slide 1 Comp 231 Database Management Systems Comp 231 Database Management Systems 6. Integrity Constraints.
Computing & Information Sciences Kansas State University Monday, 13 Oct 2008CIS 560: Database System Concepts Lecture 18 of 42 Monday, 13 October 2008.
Chapter 7: Relational Database Design. 7.2Unite International CollegeDatabase Management Systems Chapter 7: Relational Database Design Features of Good.
Database System Concepts, 5th Ed. ©Silberschatz, Korth and Sudarshan See for conditions on re-usewww.db-book.com Chapter 7: Relational.
BCNF & Lossless Decomposition Prof. Sin-Min Lee Department of Computer Science.
Computing & Information Sciences Kansas State University Tuesday, 27 Feb 2007CIS 560: Database System Concepts Lecture 18 of 42 Tuesday, 27 February 2007.
Computing & Information Sciences Kansas State University Wednesday, 04 Oct 2006CIS 560: Database System Concepts Lecture 17 of 42 Wednesday, 04 October.
Functional Dependencies. FarkasCSCE 5202 Reading and Exercises Database Systems- The Complete Book: Chapter 3.1, 3.2, 3.3., 3.4 Following lecture slides.
1 Dept. of CIS, Temple Univ. CIS616/661 – Principles of Data Management V. Megalooikonomou Integrity Constraints (based on slides by C. Faloutsos at CMU)
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Slide
Functional Dependencies CIS 4301 Lecture Notes Lecture 8 - 2/7/2006.
Rensselaer Polytechnic Institute CSCI-4380 – Database Systems David Goldschmidt, Ph.D.
Computing & Information Sciences Kansas State University Friday, 03 Oct 2007CIS 560: Database System Concepts Lecture 16 of 42 Wednesday, 03 October 2007.
©Silberschatz, Korth and Sudarshan6.1Database System Concepts Chapter 6: Integrity Constraints Domain Constraints Referential Integrity Assertions Triggers.
Functional Dependencies and Normalization 1 Instructor: Mohamed Eltabakh Part 2.
Lecture 11: Functional Dependencies
Relational Database Design
Relational Database Design
Module 5: Overview of Database Design -- Normalization
Chapter 7: Relational Database Design
Relational Database Design
Relational Database Design
Chapter 8: Relational Database Design
Chapter 7: Relational Database Design
Chapter 7: Relational Database Design
Chapter 8: Relational Database Design
Chapter 7: Relational Database Design
Functional Dependencies and Normalization for Relational Databases
Functional Dependencies and Normalization
Functional Dependencies and Normalization
Temple University – CIS Dept. CIS331– Principles of Database Systems
Functional Dependencies and Relational Schema Design
Appendix C: Advanced Normalization Theory
Normal Form: 4 & 5.
Chapter 8: Relational Database Design
Functional Dependencies
Chapter 7: Normalization
Normalization cs3431.
Chapter 7: Relational Database Design
Instructor: Mohamed Eltabakh
Chapter 8: Relational Database Design
Functional Dependencies
Chapter 7: Relational Database Design
Chapter 19 (part 1) Functional Dependencies
Chapter 7: Relational Database Design
Relational Database Design
Chapter 7: Relational Database Design
Chapter 7: Relational Database Design
Relational Database Theory
Appendix C: Advanced Relational Database Design
Chapter 28: Advanced Relational Database Design
Chapter 7: Relational Database Design
Lecture 6: Functional Dependencies
Chapter 7: Normalization
Lecture 6 Relational Database Design
Chapter 7: Relational Database Design
Lecture 09: Functional Dependencies
Presentation transcript:

Functional Dependency Murat Kantarcioglu

Functional Dependencies Let R be a relation schema   R and   R The functional dependency    holds on R if and only if for any legal relations r(R), whenever any two tuples t1 and t2 of r agree on the attributes , they also agree on the attributes . That is, t1[] = t2 []  t1[ ] = t2 [ ]

Example Example: Consider r(A,B ) with the following instance of r. On this instance, A  B does NOT hold, but B  A does hold. A B 1 3 6 2 7

Example A B C D a1 b1 c1 d1 d2 b2 c2 a2 c3 Does AB  C hold? Does ABC  D hold ? Does BC  D hold?

Example SSN LastName FirstName City 111111111 Smith John Richardson 222222222 Li Peng 333333333 Kant Plano 444444444 Mark Does {ssn}  {LastName} hold? Does {ssn}  {LastName,FirstName} hold ? Does {LastName, FirstName} {City} hold? Does {City}  {FirstName} hold?

Procedure for Computing F+ F + = F repeat for each functional dependency f in F+ apply reflexivity and augmentation rules on f add the resulting functional dependencies to F + for each pair of functional dependencies f1and f2 in F + if f1 and f2 can be combined using transitivity then add the resulting functional dependency to F + until F + does not change any further

Example R = (A, B, C, G, H, I) F = { A  B, A  C, CG  H, CG  I, B  H} some members of F+ A  H by transitivity from A  B and B  H AG  I by augmenting A  C with G, to get AG  CG and then transitivity with CG  I CG  HI by augmenting CG  I to infer CG  CGI, and augmenting of CG  H to infer CGI  HI, and then transitivity

Closure of Attribute Sets Given a set of attributes a, define the closure of a under F (denoted by a+) as the set of attributes that are functionally determined by a under F Algorithm to compute a+, the closure of a under F result := a; while (changes to result) do for each    in F do begin if   result then result := result   end

Example of Attribute Set Closure 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? Is AG a super key? Does AG  R? == Is (AG)+  R Is any subset of AG a superkey? Does A  R? == Is (A)+  R Does G  R? == Is (G)+  R