Chapter 10_part3 Functional Dependencies and Normalization for Relational Databases.

Slides:



Advertisements
Similar presentations
Schema Refinement: Normal Forms
Advertisements

Functional Dependencies and Normalization for Relational Databases
CS 440 Database Management Systems Practice problems for normalization.
Chapter 3 Notes. 3.1 Functional Dependencies A functional dependency is a statement that – two tuples of a relation that agree on some particular set.
Functional Dependencies and Normalization for Relational Databases.
Kingdom of Saudi Arabia Ministry of Higher Education Al-Imam Muhammad Ibn Saud Islamic University College of Computer and Information Sciences Normalization.
Ms. Hatoon Al-Sagri CCIS – IS Department Normalization.
Copyright © 2004 Pearson Education, Inc.. Chapter 10 Functional Dependencies and Normalization for Relational Databases.
Functional Dependencies and Normalization for Relational Databases
603 Database Systems Senior Lecturer: Laurie Webster II, M.S.S.E.,M.S.E.E., M.S.BME, Ph.D., P.E. Lecture 8 A First Course in Database Systems.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 15 Basics of Functional Dependencies and Normalization for Relational.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Slide
Functional Dependencies (Part 3) Presented by Nash Raghavan All page numbers are in reference to Database System Concepts (5 th Edition)
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Slide
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Slide
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Slide
Normalization. FarkasCSCE 5202 Reading Assignments  Database Systems The Complete Book: Chapters 3.6, 3.7, 3.8  Following lecture slides are modified.
CS 3630 Database Design and Implementation. First Normal Form (1NF) No multi-value attributes Done when mapping E-R model to relational schema DBDL 2.
Chapter 8 Normalization for Relational Databases Copyright © 2004 Pearson Education, Inc.
Functional Dependencies and Relational Schema Design.
Introduction to Schema Refinement
Normalization B Database Systems Normal Forms Wilhelm Steinbuss Room G1.25, ext. 4041
Daniel AdinugrohoDatabase Programming 1 DATABASE PROGRAMMING Lecture on 29 – 04 – 2005.
Chapter 10 Functional Dependencies and Normalization for Relational Databases.
Chapter 10 Functional Dependencies and Normalization for Relational Databases Copyright © 2004 Pearson Education, Inc.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 10 Functional Dependencies and Normalization for Relational Databases.
AL-MAAREFA COLLEGE FOR SCIENCE AND TECHNOLOGY INFO 232: DATABASE SYSTEMS CHAPTER 6 NORMALIZATION FOR RELATIONAL DATABASES Instructor Ms. Arwa Binsaleh.
 Th ờ i gian thi: 90 phút  Hình th ứ c thi: lý thuy ế t (tr ắ c nghi ệ m + tr ả l ờ i ng ắ n) + bài t ậ p (đ ề m ở )  C ấ u trúc bài thi: ◦ A. Lý thuy.
Slide 11-1 Elmasri and Navathe, Fundamentals of Database Systems, Fourth Edition Revised by IB & SAM, Fasilkom UI, 2005 Exercise – T/F The columns of a.
Copyright © Curt Hill Schema Refinement III 4 th NF and 5 th NF.
Database Management COP4540, SCS, FIU Relation Normalization (Chapter 14)
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Normalization for Relational Databases.
CSC 411/511: DBMS Design Dr. Nan Wang 1 Schema Refinement and Normal Forms Chapter 19.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Slide
Topic 10 Functional Dependencies and Normalization for Relational Databases Faculty of Information Science and Technology Mahanakorn University of Technology.
Instructor: Churee Techawut Functional Dependencies and Normalization for Relational Databases Chapter 4 CS (204)321 Database System I.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Chapter 4 Normalization.
CSCI 4333 Database Design and Implementation – Exercise (3) Xiang Lian The University of Texas – Pan American Edinburg, TX
Functional Dependencies and Normalization for Relational Databases.
Chapter 10 Functional Dependencies and Normalization for Relational Databases Copyright © 2004 Pearson Education, Inc.
Functional Dependencies and Normalization for Relational Databases
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 15 Basics of Functional Dependencies and Normalization for Relational.
Chapter Functional Dependencies and Normalization for Relational Databases.
CSE314 Database Systems Basics of Functional Dependencies and Normalization for Relational Databases Doç. Dr. Mehmet Göktürk src: Elmasri & Navanthe 6E.
IST 210 Normalization 2 Todd Bacastow IST 210. Normalization Methods Inspection Closure Functional dependencies are key.
Functional Dependencies. Outline Functional dependencies (3.4) Rules about FDs (3.5) Design of a Relational schema (3.6)
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Slide
Third Normal Form (3NF) Zaki Malik October 23, 2008.
1 CSE 480: Database Systems Lecture 18: Normal Forms and Normalization.
ANN.1 CSE4701 Problem th ed  Consider the table:  Consider the table: Orders (O#,I#,Odate, Cust#, Total_amount, Qty_ordered, Total_price, Discount%)
Normalization MIS335 Database Systems. Why Normalization? Optimizing database structure Removing duplications Accelerating the instructions Data integrity!
Functional Dependencies and Relational Schema Design.
Chapter 5.1 and 5.2 Brian Cobarrubia Database Management Systems II January 31, 2008.
CS 405G: Introduction to Database Systems Instructor: Jinze Liu Fall 2009.
Second Normal Form (2NF) A relation R is in 1NF, and every non-primary-key attribute is fully functionally dependent on the primary key Then R is in 2NF.
Riyadh Philanthropic Society For Science Prince Sultan College For Woman Dept. of Computer & Information Sciences CS 340 Introduction to Database Systems.
Riyadh Philanthropic Society For Science Prince Sultan College For Woman Dept. of Computer & Information Sciences CS 340 Introduction to Database Systems.
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.
Al-Imam University Girls Education Center Collage of Computer Science 1 nd Semester, 1432/1433H Chapter 10_part2 Functional Dependencies and Normalization.
Copyright © Curt Hill Schema Refinement II 2 nd NF to 3 rd NF to BCNF.
Normalization Or theoretical and common sense approaches to redesigning a database.
Relational Data Model, Review Relation Tuple Attribute Domains Candidate key, primary key Key attribute, non-key attribute.
Normal Forms Zachary G. Ives University of Pennsylvania CIS 550 – Database & Information Systems June 18, 2016 Some slide content courtesy of Susan Davidson.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Slide
Chapter 14 Functional Dependencies and Normalization Informal Design Guidelines for Relational Databases –Semantics of the Relation Attributes –Redundant.
Functional Dependencies and Normalization for Relational Databases تنبيه : شرائح العرض (Slides) هي وسيلة لتوضيح الدرس واداة من الادوات في ذلك. حيث المرجع.
Study group exercises In attendance: 1. Suppose you have a relation P ( A, B, C, D, E, F ), with functional dependencies (FDs) A  B, BCD  E, E  F Suppose.
Normalization Boyce-Codd Normal Form Presented by: Dr. Samir Tartir
Presentation transcript:

Chapter 10_part3 Functional Dependencies and Normalization for Relational Databases

Introduction to Databases 2 BCNF (Boyce-Codd Normal Form) A relation schema R is in Boyce-Codd Normal Form (BCNF) if whenever an FD X  A holds in R, then X is a superkey of R  Each normal form is strictly stronger than the previous one: Every 2NF relation is in 1NF Every 3NF relation is in 2NF Every BCNF relation is in 3NF  There exist relations that are in 3NF but not in BCNF  The goal is to have each relation in BCNF (or 3NF)

Introduction to Databases 3 BCNF R1(A,C) R2(C,B)

Introduction to Databases 4

5 BCNF FDs: {Student,course}  Instructor Instructor  Course It is in 3NF not in BCNF Decomposing into 2 schemas {Student, Instructor} {Instructor, Course}

Introduction to Databases 6 Examples BCNF R ( Client#, Problem, Consultant _name) R1 (Client#, Consultant _name) R2 (Consultant _name, Problem) ■R (Stud#, Class#, Instructor, Grade) R1 (Stud#, Instructor, Grade) R2 (Instructor, Class#)

Introduction to Databases 7 Example Consider the following relation for published books: BOOK (Book_title, Author_name, Book_type, Listprice, Author_affil, Publisher) - Author_affil referes to the affiliation of the author. Suppose thefollowing dependencies exist: Book_title -> Publisher, Book_type Book_type -> Listprice Author_name -> Author-affil (a) What normal form is the relation in? Explain your answer. (b) Apply normalization until you cannot decompose the relations further. State the reasons behind each decomposition.

Introduction to Databases 8 Answer BOOK (Book_title, Authorname, Book_type, Listprice, Author_affil, Publisher) (a) The key for this relation is (Book_title, Authorname). This relation is in 1NF and not in 2NF as no attributes are Full FD on the key. It is also not in 3NF. (b) 2NF decomposition: Book0(Book_title, Authorname) Book1(Book_title, Publisher, Book_type, Listprice) Book2(Authorname, Author_affil) This decomposition eliminates the partial dependencies. 3NF decomposition: Book0(Book_title, Authorname) Book1-1(Book_title, Publisher, Book_type) Book1-2(Book_type, Listprice) Book2(Authorname, Author_affil) This decomposition eliminates the transitive dependency of Listprice

Introduction to Databases 9 Example Given the relation schema Car_Sale (Car#, Salesman#, Date_sold, Commission%, Discount_amt) with the functional dependencies Date_sold -> Discount_amt Salesman# -> Commission% Car# -> Date_sold This relation satisfies 1NF but not 2NF (Car# -> Date_sold and Salesman# -> Commission%) so these two attributes are not Full FD on the primary key and not 3NF

Introduction to Databases 10 To normalize, 2NF: Car_Sale1 (Car#, Salesman#) Car_Sale2 (Car#, Date_sold, Discount_amt) Car_Sale3 (Salesman#,Commission%) 3NF: Car_Sale1(Car#, Salesman#) Car_Sale2-1(Car#, Date_sold) Car_Sale2-2(Date_sold, Discount_amt) Car_Sale3(Salesman#,Commission%) Answer