Case tool Relational Database Schema Designer Cai Xinlei Tang Ning Xu Chen Zhang Yichuan CS4221 P06.

Slides:



Advertisements
Similar presentations
Schema Refinement: Normal Forms
Advertisements

Schema Refinement: Canonical/minimal Covers
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 16 Relational Database Design Algorithms and Further Dependencies.
Announcements Read 6.1 – 6.3 for Wednesday Project Step 3, due now Homework 5, due Friday 10/22 Project Step 4, due Monday Research paper –List of sources.
Logical Database Design (3 of 3) John Ortiz. Lecture 7Logical Database Design (2)2 Normalization  If a relation is not in BCNF or 3NF, we refine it by.
CS 440 Database Management Systems Practice problems for normalization.
Review for Final Exam Lecture Week 14. Problems on Functional Dependencies and Normal Forms.
Normalization theory exercises Dr. Shiyong Lu Department of Computer Science Wayne State University ©copyright 2007, all rights reserved.
1 Design Theory. 2 Minimal Sets of Dependancies A set of dependencies is minimal if: 1.Every right side is a single attribute 2.For no X  A in F and.
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)
Properties of Armstrong’s Axioms Soundness All dependencies generated by the Axioms are correct Completeness Repeatedly applying these rules can generate.
CMU SCS Carnegie Mellon Univ. Dept. of Computer Science /615 - DB Applications Lecture #16: Schema Refinement & Normalization - Functional Dependencies.
CMPT 354, Simon Fraser University, Fall 2008, Martin Ester 227 Database Systems I Design Theory for Relational Databases.
CS Algorithm : Decomposition into 3NF  Obviously, the algorithm for lossless join decomp into BCNF can be used to obtain a lossless join decomp.
Classroom Exercise: Normalization
Normalization DB Tuning CS186 Final Review Session.
Multivalued Dependency Prepared by Tomasz Kaciak CS157A.
FDImplication: 1 Functional Dependencies (FDs) Let r(R) be a relation and let t  r, then the restriction of t to X  R, written t[X], is the projection.
Boyce-Codd Normal Form Kelvin Nishikawa SE157a-03 Fall 2006 Kelvin Nishikawa SE157a-03 Fall 2006.
Normal Form Design addendum by C. Zaniolo. ©Silberschatz, Korth and Sudarshan7.2Database System Concepts Normal Form Design Compute the canonical cover.
Design Theory.
1 CMSC424, Spring 2005 CMSC424: Database Design Lecture 9.
Schema Refinement and Normalization Nobody realizes that some people expend tremendous energy merely to be normal. Albert Camus.
Cs3431 Normalization Part II. cs3431 Attribute Closure : Example Consider R (A, B, C, D, E) with FDs A  B, B  C, CD  E Does A  E hold ? (Is A  E.
Boyce-Codd NF & Lossless Decomposition Professor Sin-Min Lee.
Fall 2001Arthur Keller – CS 1804–1 Schedule Today Oct. 4 (TH) Functional Dependencies and Normalization. u Read Sections Project Part 1 due. Oct.
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.
Introduction to Normalization CPSC 356 Database Ellen Walker Hiram College.
Normal Forms1. 2 The Problems of Redundancy Redundancy is at the root of several problems associated with relational schemas: Wastes storage Causes problems.
CS143 Review: Normalization Theory Q: Is it a good table design? We can start with an ER diagram or with a large relation that contain a sample of the.
SCUJ. Holliday - coen 1784–1 Schedule Today: u Normal Forms. u Section 3.6. Next u Relational Algebra. Read chapter 5 to page 199 After that u SQL Queries.
THIRD NORMAL FORM (3NF) A relation R is in BCNF if whenever a FD XA holds in R, one of the following statements is true: XA is a trivial FD, or X is.
Normal Forms through BCNF CPSC 356 Database Ellen Walker Hiram College (Includes figures from Database Systems by Connolly & Begg, © Addison Wesley 2002)
Functional Dependencies. FarkasCSCE 5202 Reading and Exercises Database Systems- The Complete Book: Chapter 3.1, 3.2, 3.3., 3.4 Following lecture slides.
Minimum Cover of F. Minimal Cover for a Set of FDs Minimal cover G for a set of FDs F: –Closure of F = closure of G. –Right hand side of each FD in G.
Rensselaer Polytechnic Institute CSCI-4380 – Database Systems David Goldschmidt, Ph.D.
1 Multivalued Dependencies Fourth Normal Form Reasoning About FD’s + MVD’s.
Multivalued Dependencies Fourth Normal Form Tony Palladino 157B.
Rensselaer Polytechnic Institute CSCI-4380 – Database Systems David Goldschmidt, Ph.D.
Functional dependencies CMSC 461 Michael Wilson. Designing tables  Now we have all the tools to build our databases  How should we actually go about.
CS 222 Database Management System Spring Lecture 4 Database Design Theory Korra Sathya Babu Department of Computer Science NIT Rourkela.
Rensselaer Polytechnic Institute CSCI-4380 – Database Systems David Goldschmidt, Ph.D.
© D. Wong Functional Dependencies (FD)  Given: relation schema R(A1, …, An), and X and Y be subsets of (A1, … An). FD : X  Y means X functionally.
Normalization.
Relational Database Schema Designer Using Bernstein’s Algorithm
Relational Database Schema Designer using Bernstein’s Algorithm
CS 440 Database Management Systems
Schedule Today: Next After that Normal Forms. Section 3.6.
Relational Database Design (Discussion Session)
Schema Refinement and Normal Forms
CS4221 Database Design Group P05 Name Matriculation Number
CS411 Database Systems 08: Midterm Review Kazuhiro Minami 1.
3.1 Functional Dependencies
CS4221 Project Relational Database Schema using Bernstein’s Algorithm
Relational Database Schema Designer: CASE tool
Lecture 6: Design Theory
How to test Whether Subschemes in BCNF??
Functional Dependencies and Normalization
Lecture 09: Functional Dependencies, Database Design
Normalization Part II cs3431.
Functional Dependencies
Lecture 07: E/R Diagrams and Functional Dependencies
Some slides are from Dr. Sara Cohen
3-Variable K-map AB/C AB/C A’B’ A’B AB AB’
Instructor: Mohamed Eltabakh
CS4222 Principles of Database System
Design Theory for Relational Databases
CS 201 Compiler Construction
Presentation transcript:

Case tool Relational Database Schema Designer Cai Xinlei Tang Ning Xu Chen Zhang Yichuan CS4221 P06

● Bernstein’s algorithm ● Find closure ● Find all keys ● Check normal form ● Save and load files ● Conclusion ● Demo Overview

Internal Data Structure ● Directed graph e.g. {A->B, AB->C, D->C} Advantages: ● Easy to find closure of a set of attributes ● Easy to eliminate transitive dependencies

Assume the set of attributes in the left/right hand side is represented by X/Y Conditions to be checked: 1.A subset S ⋤ X determines a subset of R ⋤ X with S ∩ R= ∅ e.g. {A->B, AB->C} 1.A subset S ⋤ X determines Y e.g. {A->BCD, AF->BCD} Eliminate Extraneous Attributes

Find Closure 1.Find starting graph node 2.Run bfs to add new attributes to closure 3.Repeat step 2, until no more new attributes can be found Example: ∑ = {A->B, C->D}, find closure of {A, C} {A, C} + = {A, B, C} {A, C} + = {A, B, C, D}

Find Minimum Cover ● Extraneous attributes have been removed in step 1 ● Eliminate all transitive dependencies using previous algorithm

Eliminate Transitive Dependencies 1.Temprarliy delete edge in between X->Y 2.Check reachability X to Y Example: ∑ = {A->B, A->C, B->C}, check A->C

Partition ● Partition by identical left hand side node and its neighbours ● No additional modification on graph

Merge Equivalent Keys ● Find equivalent groups ● Merge equivalent keys on graph ● Print intermediate output

Merge Equivalent Keys

Find All Keys ● Full closure - all the attributes in the relation ● Check if the closure of any combination of attributes is equal to the full closure. e.g. ∑ = {A->B, C->D}. Find {A} +,{B} +,{C} + … {A,B} +, {A,C} +....{A,C,D} +, {B,C,D} + => {A,C} + = {A,B,C,D} ● Before the above step, if there exists a proper subset of attribute that is a key, skip find closure of that combination.

Normal Form Checker ● 1NF ● 2NF ● 3NF ● BCNF

Save and Load File ● Format ● Convenience

Testing ● Unit Testing ● Bernstein’s Algorithm Test ● Test Normal Form Checker and Find Key

Conclusion ● Difficulties encountered ● Lessons learned

Demo