MIS3053 Database Design And Applications The University Of Tulsa Professor: Akhilesh Bajaj Normal Forms Lecture 2 © Akhilesh Bajaj, 2000, 2002, 2003,2004.

Slides:



Advertisements
Similar presentations
Schema Refinement: Normal Forms
Advertisements

Normalization 1 Instructor: Mohamed Eltabakh Part II.
ALAK ROY. Assistant Professor Dept. of CSE NIT Agartala N ATIONAL I NSTITUTE OF T ECHNOLOGY A GARTALA Aug-Dec,2010 Normalization 2 CSE-503 :: D ATABASE.
Review for Final Exam Lecture Week 14. Problems on Functional Dependencies and Normal Forms.
CS 440 Database Management Systems Lecture 4: Constraints, Schema Design.
Temple University – CIS Dept. CIS616– Principles of Data Management V. Megalooikonomou Functional Dependencies (based on notes by Silberchatz,Korth, and.
Carnegie Mellon Carnegie Mellon Univ. Dept. of Computer Science Database Applications C. Faloutsos Integrity Constraints.
Relational Normalization Theory. Limitations of E-R Designs Provides a set of guidelines, does not result in a unique database schema Does not provide.
CS Algorithm : Decomposition into 3NF  Obviously, the algorithm for lossless join decomp into BCNF can be used to obtain a lossless join decomp.
The Relational Model System Development Life Cycle Normalisation
Normalization DB Tuning CS186 Final Review Session.
Normalization DB Tuning CS186 Final Review Session.
CMSC424: Database Design Instructor: Amol Deshpande
1 CMSC424, Spring 2005 CMSC424: Database Design Lecture 9.
1 Functional Dependency and Normalization Informal design guidelines for relation schemas. Functional dependencies. Normal forms. Normalization.
1 Schema Refinement and Normal Forms Chapter 19 Raghu Ramakrishnan and J. Gehrke (second text book) In Course Pick-up box tomorrow.
1 Triggers: Correction. 2 Mutating Tables (Explanation) The problems with mutating tables are mainly with FOR EACH ROW triggers STATEMENT triggers can.
Department of Computer Science and Engineering, HKUST Slide 1 7. Relational Database Design.
Boyce-Codd Normal Form By: Thanh Truong. Boyce-Codd Normal Form Eliminates all redundancy that can be discovered by functional dependencies But, we can.
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.
Chapter 10 Functional Dependencies and Normalization for Relational Databases.
CS 405G: Introduction to Database Systems 16. Functional Dependency.
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.
Relational Database Design by Relational Database Design by Dr.S.Sridhar, Ph.D.(JNUD), RACI(Paris, NICE), RMR(USA), RZFM(Germany) DIRECTOR ARUNAI ENGINEERING.
Chapter 8: Relational Database Design First Normal Form First Normal Form Functional Dependencies Functional Dependencies Decomposition Decomposition Boyce-Codd.
Database Management COP4540, SCS, FIU Relation Normalization (Chapter 14)
Your name here. Improving Schemas and Normalization What are redundancies and anomalies? What are functional dependencies and how are they related to.
CSC 411/511: DBMS Design Dr. Nan Wang 1 Schema Refinement and Normal Forms Chapter 19.
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.
Functional Dependencies An example: loan-info= Observe: tuples with the same value for lno will always have the same value for amt We write: lno  amt.
MIS 3053 Database Design & Applications The University of Tulsa Professor: Akhilesh Bajaj ER Model Lecture 1 © Akhilesh Bajaj, 2000, 2002, 2003, 2004.
MIS 3053 Database Design & Applications The University of Tulsa Professor: Akhilesh Bajaj RM/SQL Lecture 1 ©Akhilesh Bajaj, 2000, 2002, 2003, All.
Normal Forms through BCNF CPSC 356 Database Ellen Walker Hiram College (Includes figures from Database Systems by Connolly & Begg, © Addison Wesley 2002)
Functional Dependencies and Normalization for Relational Databases
Computing & Information Sciences Kansas State University Tuesday, 27 Feb 2007CIS 560: Database System Concepts Lecture 18 of 42 Tuesday, 27 February 2007.
MIS 3053 Database Design & Applications The University of Tulsa Professor: Akhilesh Bajaj ER Model Lecture 4 Mapping an ER model to tables © Akhilesh Bajaj,
CS 564 Database Management Systems: Design and Implementation Discussion Session Friday, Sept 18, Apul Jain.
MIS 7003 MIS Core Course The MBA Program The University of Tulsa Professor: Akhilesh Bajaj Introduction to Database Design All Slides in this presentation.
Logical Database Design (1 of 3) John Ortiz Lecture 6Logical Database Design (1)2 Introduction  The logical design is a process of refining DB schema.
11/07/2003Akbar Mokhtarani (LBNL)1 Normalization of Relational Tables Akbar Mokhtarani LBNL (HENPC group) November 7, 2003.
MIS 3053 Database Design & Applications The University of Tulsa Professor: Akhilesh Bajaj RM/SQL Lecture 5 © Akhilesh Bajaj, 2000, 2002, 2003, All.
Revisit FDs & BCNF Normalization 1 Instructor: Mohamed Eltabakh
IST 210 Normalization 2 Todd Bacastow IST 210. Normalization Methods Inspection Closure Functional dependencies are key.
1 Dept. of CIS, Temple Univ. CIS616/661 – Principles of Data Management V. Megalooikonomou Integrity Constraints (based on slides by C. Faloutsos at CMU)
MIS 3053 Database Design & Applications The University of Tulsa Professor: Akhilesh Bajaj RM/SQL Lecture 3 © Akhilesh Bajaj, 2000, 2002, All Rights.
CS 405G: Introduction to Database Systems
Normalization MIS335 Database Systems. Why Normalization? Optimizing database structure Removing duplications Accelerating the instructions Data integrity!
Lecture 3 Functional Dependency and Normal Forms Prof. Sin-Min Lee Department of Computer Science.
Relational Data Model DeSiaMore Powered by DeSiaMore.
CS 405G: Introduction to Database Systems Instructor: Jinze Liu Fall 2009.
MIS 3053 Database Design And Applications The University Of Tulsa Professor: Akhilesh Bajaj Normal Forms Lecture 1 © Akhilesh Bajaj, 2000, 2002, 2003.
MIS 3053 Database Design & Applications The University of Tulsa Professor: Akhilesh Bajaj RM/SQL Lecture 4 © Akhilesh Bajaj, 2000, 2002, 2004, All.
CS 338Database Design and Normal Forms9-1 Database Design and Normal Forms Lecture Topics Measuring the quality of a schema Schema design with normalization.
Ch 7: Normalization-Part 1
© 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.
Chapter 8 Relational Database Design. 2 Relational Database Design: Goals n Reduce data redundancy (undesirable replication of data values) n Minimize.
11/06/97J-1 Principles of Relational Design Chapter 12.
1 CS 430 Database Theory Winter 2005 Lecture 8: Functional Dependencies Second, Third, and Boyce-Codd Normal Forms.
Functional Dependencies Quiz. Project Relation Attributes project name – pname start date – start budget customer name – cname customer phone – cphone.
Logical Database Design and Relational Data Model Muhammad Nasir
Normalization and FUNctional Dependencies. Redundancy: root of several problems with relational schemas: –redundant storage, insert/delete/update anomalies.
MIS 3053 Database Design & Applications The University of Tulsa Professor: Akhilesh Bajaj ER Model Lecture 3 © Akhilesh Bajaj, 2000, 2002, All Rights.
Normal Forms Zachary G. Ives University of Pennsylvania CIS 550 – Database & Information Systems June 18, 2016 Some slide content courtesy of Susan Davidson.
Chapter 14 Functional Dependencies and Normalization Informal Design Guidelines for Relational Databases –Semantics of the Relation Attributes –Redundant.
Relational Database Design by Dr. S. Sridhar, Ph. D
The University of Tulsa Professor: Akhilesh Bajaj
Presentation transcript:

MIS3053 Database Design And Applications The University Of Tulsa Professor: Akhilesh Bajaj Normal Forms Lecture 2 © Akhilesh Bajaj, 2000, 2002, 2003,2004. All Rights Reserved.

Review of Lecture 1 Learnt about integrity constraints - domain constraints - referential integrity - introduction to triggers Learnt about functional dependencies - Definition - Armstrong’s axioms - 3 additional rules - Closure of an attribute set (useful in computing super keys and candidate keys) -Practiced formulating FDs from a description

Goals for today Boyce-Codd Normal Form (BCNF) Algorithm for deriving a BCNF schema Design algorithm for designing a relational schema without ER diagrams In-class assignments

Before we get started A relational schema is a group of tables that make up the database, i.e., represent data about a real world enterprise. Our goal is to end up with a “good schema”in terms of a definition that we will see next. The methodology we learn today can be used AT the end of the ER Diagram ----> Relational schema methodology we learnt in module 1 of this course, to check and make sure our relational schema is in BCNF. The methodology we learn today can be used if we need to re-engineer a relational schema that already exists. Note that our aim is to simplify learning the theory so we can solve real-world problems.

Boyce-Codd Normal Form A table is in BCNF if, for all FDs on the table, the following holds: (Left Hand Side of FD) LHS is a superkey for the table In general, BCNF is considered a good design, in the real world. A schema is in BCNF if every table in the schema is in BCNF. We shall not do 3NF (Third Normal Form) because BCNF is more restrictive and guarantees no redundancy. So our aim is to learn how to create BCNF schemas. NB: 3NF is defined as: For every FD on a table, either LHS is a superkey or the RHS-LHS is a part of the candidate key. It is less restrictive than BCNF. We just need to focus on BCNF.

Algorithm for decomposing a big table into smaller tables that are in BCNF Inspect the list of FDs on the table and remove obvious duplications. For each FD make sure that LHS INTERSECT RHS = NULL. FOR each table T that is remaining that is not in BCNF DO Take an FD such that LHS is not a superkey (if we have a choice, select an FD whose RHS is not on LHS of some other FD first) Create a table with the attributes (LHS,RHS) and remove the RHS from table T.Primary key of new table is LHS. /*Note that the new table we have created is in BCNF*/ END

Algorithm for decomposing a table into BCNF Example: Course-Section-Classroom (c_id, c_name, num_credits, s_id, time_held, week_days_held, date_began, date_ended, cl_id, capacity, location) Decompose into BCNF tables.

Algorithm for decomposing a table into BCNF Example: Professors-Courses-Sections-Classrooms (f_id, f_name, f_address, f_specialty, highest_degree, c_id, c_name, num_credits, s_id, time_held, week_days_held, date_began, date_ended, cl_id, capacity, location) Decompose into BCNF tables.

Design algorithm for designing a relational schema without ER diagrams -List all the attributes into ONE BIG TABLE. -List all FDs and reduce them by inspection so that no information is represented twice. -Create a BCNF decomposition -Inspect our decomposed tables to make sure each is in BCNF -Inspect design to make sure it is dependency preserving. If not, use our judgement to combine tables so that the design is dependency preserving.

In class assignments 1. Big table (A, B, C, D, E, F, G, H, I, J, K) FDs = { A --> BCD, D--> EFG, I-->JK } Re-engineer this, so it is a “good design” (BCNF).

In class assignments 2. Al’s motor shop (AMS) is an automobile repair facility owned by the Capone family. AMS has 5 repair bays. Each repair bay (place where car is repaired) has a bay_id and bay_location. AMS employs 14 employees. Each employee has an employee_id, address, phone and salary. Of these 14, 2 are office staff. They are further described by typing_speed and degree_held. The 12 mechanics are further described by tech_level. Each mechanic is assigned to work on one bay. AMS customers have a cust_id, name, address, phone. In addition, Mr. Capone also wants to capture information for each customer that lists the mechanic who last did a job for the customer, the date on which the job was done, and the amount the customer paid to AMS. Please create a relational schema, in BCNF, without an ER diagram.