{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Lecture14Slides501.ppt

Lecture14Slides501.ppt - CSC 355 Database Systems

Info icon This preview shows pages 1–8. Sign up to view the full content.

View Full Document Right Arrow Icon
CSC 355 Database Systems Lecture 14 Eric J. Schwabe School of Computing, DePaul University Winter 2018
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Today: Relational Database Design Review minimal basis and 3NF decomposition Last decomposition examples Constraints Triggers? 2
Image of page 2
Minimal Basis A minimal basis of F is a set G that is equivalent to F and is “as small as possible”: 1. The right side of every dependency is a single attribute 2. No X A can be replaced with Y A, where Y is a proper subset of X, and still be equivalent to F 3. No X A can be removed and still be equivalent to F 3
Image of page 3

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Constructing a Minimal Basis Start with a set of functional dependencies… 1. Split each X Z into an equivalent set with only one attribute on the right side of each f.d. 2. For each X {a}, replace it with Y {a} (where Y is a proper subset of X) as long as the resulting set is equivalent 3. Remove every X {a} that can be removed as long as the resulting set is equivalent 4
Image of page 4
3NF Decomposition Algorithm 1. Find a minimal basis G of F 2. For each set X that appears as the determinant of some functional dependency in G: Find all k dependencies of the form X A i in G, and create a relation in D with the attributes in X and A 1 ,…,A k . 3. If none of the relations in D contains a candidate key of R, find a candidate key K of R and create a relation in D whose attributes are the attributes of K. 4. Remove any redundant relations. (A relation Q 1 in D is redundant if all of its attributes are included in another relation Q 2 in D.) 5
Image of page 5

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Comparison of Algorithms BCNF decomposition algorithm: No redundancy in relations Dependency preservation not guaranteed Lossless join guaranteed 3NF decomposition algorithm: Some redundancy may remain in relations that have multiple candidate keys Dependency preservation guaranteed Lossless join guaranteed 6
Image of page 6
Final Decomposition Example INVOICE ( OrderID, OrderDate, CustomerID,
Image of page 7

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 8
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern