DOC PREVIEW
SJSU CS 157A - Functional Dependencies

This preview shows page 1-2-3-4 out of 12 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 12 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 12 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 12 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 12 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 12 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Functional Dependencies (Part 3)AgendaQuick ReviewFunctional Dependency TheorySlide 5The Closure of a SetDecompositionSlide 8Slide 9Slide 10Multivalued DependenciesThe EndFunctional Dependencies(Part 3)Presented by Nash RaghavanAll page numbers are in reference toDatabase System Concepts (5th Edition)AgendaQuick ReviewWhat is a functional dependencyDifferent normal formsFunctional Dependency TheoryClosure of a Set of DependenciesDecomposition using F.D.Multivalued dependenciesQuick ReviewWhat is a functional dependency?SSN → Name “Name is functionally dependent on SSN”Given a relation R, if   , then  must be the same whenever  is the same for all tuples in RFirst Normal FormDomains of all attributes in relation R are atomicPage 269Boyce-Codd Normal FormFor all functional dependencies   ,  is a superkeyPage 272Functional Dependency TheoryArmstrong’s axioms (page 279)Reflexivity rule: If   , then  holdsExample: A  A , BCD  BCAugmentation rule: If    , then   Example: A  B, therefore AC  BCTransitivity: If    and    then    Example: A  B and B  C then A  CFunctional Dependency TheoryAdditional rules (page 280)Union rule: If    and    then   Example: If A  B and A  C then A  BCDecomposition rule: If    , then    and   Example: A  BC, then A  B and A  CPseudo-transitivity: If    and    then    Example: A  B and BD  C then AD  CThe Closure of a SetWhy do we care about the axioms?Given a set of functional dependencies denoted by F{ A  B, A  C, CG  H, CG  I, B  H }We can now determine logically implied functional dependencies such as A  HThe set of all functional dependencies implied by F is denoted by F+ and is called the closure of FSee page 279 for more detailsDecompositionThe ability to compute F+ enables us to convert a relation R into any normal formExample: BCNF DecompositionSee pages 289 – 290lending = ( branch_name, branch_city, assets, customer_name, loan_number, amount )Candidate Key: { loan_number, customer_name }Functional Dependencies:branch_name  assets branch_cityloan_number  amount branch_nameDecompositionThe problembranch_name  assets branch_cityValid but branch_name is not a superkey, therefore it is not in BCNF!The solution – decomposition!lending = ( branch_name, branch_city, assets, customer_name, loan_number, amount )Decomposes to multiple relations:branch = ( branch_name, branch_city, assets )loan_info = ( branch_name, customer_name, loan_number, amount )Decompositionbranch relation is now in BCNF but loan_info is not because loan_number is not a superkey given the following dependency:loan_number  amount branch_nameSolution is to iteratively decompose relations until all relations are in desired form.To complete solution, decompose loan_info to:loanb = ( loan_number, branch_name, amount )borrower = ( customer_name, loan_number )DecompositionThe beginning:lending = ( branch_name, branch_city, assets, customer_name, loan_number, amount )The end result:branch = ( branch_name, branch_city, assets )loanb = ( loan_number, branch_name, amount )borrower = ( customer_name, loan_number )The Original Functional Dependencies:branch_name  assets branch_cityloan_number  amount branch_nameEverything is now in BCNF!Multivalued DependenciesA multivalued dependency, denoted:  Means a tuple must exist for every value in Example: class  booksClass = { CS 157, CS 46 }Books = { Manual, Solution }CID class books10 CS 46 Manual10 CS 46 Solution20 CS 157 Manual20 CS 157 SolutionMultivalued dependencies result in duplicate data and are considered “tuple-generating dependencies”.Formal definition – see page 295The EndThis information will become relevant … eventually.Makes more sense when we study:Database design/creationNormalizationBCNF, 1NF, 2NF, 3NF,


View Full Document

SJSU CS 157A - Functional Dependencies

Documents in this Course
SQL

SQL

18 pages

Lecture

Lecture

44 pages

Chapter 1

Chapter 1

56 pages

E-R Model

E-R Model

16 pages

Lecture

Lecture

48 pages

SQL

SQL

15 pages

SQL

SQL

26 pages

Lossless

Lossless

26 pages

SQL

SQL

16 pages

Final 3

Final 3

90 pages

Lecture 3

Lecture 3

22 pages

SQL

SQL

25 pages

Load more
Download Functional Dependencies
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Functional Dependencies and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Functional Dependencies 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?