Chapter Three Functional Dependency Objectives: -Characteristics of a good design -Functional dependency -Converting an ER model to relational model.

Slides:



Advertisements
Similar presentations
primary key constraint foreign key constraint
Advertisements

Chapter Three Objectives Identification of Keys Application of primary and foreign keys Converting a database design to Relational DB. What is a good DBMS.
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.
Manipulating Functional Dependencies Zaki Malik September 30, 2008.
Chapter 11 Functional Dependencies. Copyright © 2004 Pearson Addison-Wesley. All rights reserved.11-2 Topics in this Chapter Basic Definitions Trivial.
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.
Database Management COP4540, SCS, FIU Functional Dependencies (Chapter 14)
CMU SCS Carnegie Mellon Univ. Dept. of Computer Science /615 - DB Applications Lecture #16: Schema Refinement & Normalization - Functional Dependencies.
Normalization DB Tuning CS186 Final Review Session.
Normalization DB Tuning CS186 Final Review Session.
Multivalued Dependency Prepared by Tomasz Kaciak CS157A.
1 Database Design Theory Which tables to have in a database Normalization.
1 Functional Dependency and Normalization Informal design guidelines for relation schemas. Functional dependencies. Normal forms. Normalization.
Databases 6: Normalization
1 Schema Refinement and Normal Forms Yanlei Diao UMass Amherst April 10, 2007 Slides Courtesy of R. Ramakrishnan and J. Gehrke.
Functional Dependencies CS 186, Spring 2006, Lecture 21 R&G Chapter 19 Science is the knowledge of consequences, and dependence of one fact upon another.
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.
FUNCTIONAL DEPENDENCIES. Chapter Outline 1 Informal Design Guidelines for Relational Databases 1.1Semantics of the Relation Attributes 1.2 Redundant Information.
Normal Forms1. 2 The Problems of Redundancy Redundancy is at the root of several problems associated with relational schemas: Wastes storage Causes problems.
Chapter 13 Normalization Transparencies. 2 Last Class u Access Lab.
Your name here. Improving Schemas and Normalization What are redundancies and anomalies? What are functional dependencies and how are they related to.
Schema Refinement and Normal Forms Chapter 19 1 Database Management Systems 3ed, R.Ramakrishnan & J.Gehrke.
Normalization Ioan Despi 2 The basic objective of logical modeling: to develop a “good” description of the data, its relationships and its constraints.
Functional Dependencies and Normalization Jose M. Peña
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.
Functional Dependencies. FarkasCSCE 5202 Reading and Exercises Database Systems- The Complete Book: Chapter 3.1, 3.2, 3.3., 3.4 Following lecture slides.
CMU SCS Carnegie Mellon Univ. Dept. of Computer Science /615 - DB Applications C. Faloutsos – A. Pavlo Lecture#16: Schema Refinement & Normalization.
1 Dept. of CIS, Temple Univ. CIS616/661 – Principles of Data Management V. Megalooikonomou Integrity Constraints (based on slides by C. Faloutsos at CMU)
CSC 411/511: DBMS Design Dr. Nan Wang 1 Schema Refinement and Normal Forms Chapter 19.
1 Schema Refinement and Normal Forms Week 6. 2 The Evils of Redundancy  Redundancy is at the root of several problems associated with relational schemas:
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Slide
Schema Refinement SHIRAJ MOHAMED M | MIS 1. Learning Objectives  Identify update, insertion and deletion anomalies  Identify possible keys given an.
1 Functional Dependencies. 2 Motivation v E/R  Relational translation problems : –Often discover more “detailed” constraints after translation (upcoming.
Database Management Systems, R. Ramakrishnan and J. Gehrke1 Schema Refinement and Normal Forms Chapter 15.
Chapter Three ( Relational Data Model) Objectives Introduction to Relational Data Models. Advantages of Relational Data Models. Restriction of Relational.
Functional Dependencies R&G Chapter 19 Science is the knowledge of consequences, and dependence of one fact upon another. Thomas Hobbes ( )
Rensselaer Polytechnic Institute CSCI-4380 – Database Systems David Goldschmidt, Ph.D.
Database Management Systems, 3ed, R. Ramakrishnan and J. Gehrke1 Schema Refinement and Normal Forms Chapter 19.
CMU SCS Carnegie Mellon Univ. Dept. of Computer Science /615 - DB Applications Lecture #16: Schema Refinement & Normalization - Functional Dependencies.
Databases Illuminated Chapter 6 Normalization. Objectives of Normalization Develop a good description of the data, its relationships and constraints Produce.
CS 405G: Introduction to Database Systems Instructor: Jinze Liu Fall 2009.
Functional Dependencies CIS 4301 Lecture Notes Lecture 8 - 2/7/2006.
Rensselaer Polytechnic Institute CSCI-4380 – Database Systems David Goldschmidt, Ph.D.
CS542 1 Schema Refinement Chapter 19 (part 1) Functional Dependencies.
CS411 Database Systems Kazuhiro Minami 04: Relational Schema Design.
Database Management Systems, 3ed, R. Ramakrishnan and J. Gehrke1 Schema Refinement and Normal Forms Chapter 19.
Databases 1 Sixth lecture. 2 Functional Dependencies X -> A is an assertion about a relation R that whenever two tuples of R agree on all the attributes.
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.
Normalization and FUNctional Dependencies. Redundancy: root of several problems with relational schemas: –redundant storage, insert/delete/update anomalies.
Functional Dependencies and Normalization for Relational Databases 1 Chapter 15 تنبيه : شرائح العرض (Slides) هي وسيلة لتوضيح الدرس واداة من الادوات في.
Chapter 10 Functional Dependencies and Normalization for Relational Databases Copyright © 2004 Pearson Education, Inc.
CSC 411/511: DBMS Design Dr. Nan Wang 1 Schema Refinement and Normal Forms Chapter 19.
1 Normalization Theory. 2 Limitations of E-R Designs Provides a set of guidelines, does not result in a unique database schema Does not provide a way.
Database Management Systems (CS 564)
Handout 4 Functional Dependencies
Schema Refinement & Normalization Theory
Functional Dependencies
Faloutsos & Pavlo SCS /615 Carnegie Mellon Univ. Dept. of Computer Science /615 - DB Applications Lecture #16: Schema Refinement & Normalization.
Functional Dependencies
Functional Dependencies
Schema Refinement and Normal Forms
Chapter 19 (part 1) Functional Dependencies
Relational Database Theory
Presentation transcript:

Chapter Three Functional Dependency Objectives: -Characteristics of a good design -Functional dependency -Converting an ER model to relational model

2 What is Good design? Faculty Name IDYear Exper. Dep. Name No. Facul. No. Students F1112Cosc3141 F2125Cosc3141 F3131Math155 F4143Cosc??

3 What is Good design? (Continued) Repeat of Info. Waste of space Update problem Loss of Info. Dept. with one faculty? What happens to the students in that dept if faculty leaves. Unable to represent Info. Dept with no faculty? Redundancy, Inconsistency, ….

4 What is Good design? (Continued) DeptDept Name Num FacultyNum Students Cosc3141 Math155

5 What is Good design? (Continued) FacultyFaculty Name IDYear Exper. Dept. Name F1I12Cosc F2I25Cosc F3I31Math F4143Cosc

6 What is the primary key? R (A, B, C, D) R(ABCD ) a1b1c1d1 a1b2c1d2 a2b2c2d2 a2b3c2d3 a3b3c2d4 A ---> B A ---> C A ---> D AB ---> C CB ---> A AB ---> D CB ---> D ABC--> D ACD --> B

7 Functional Dependency (FD): R (Pilot, Flight, Date, Time_Depart) Restrictions: For each flight there is exactly one Time_Depart For any given pilot, Date, Time_Depart there is only one Flight For a given Flight, Date, there is only one Pilot

8 Informal Definition of FD: Values of Tuple(s) on a set of attributes uniquely determines the value of another set of attributes

9 Informal Definition of FD: (Continued) FD: 1. Time_Depart FD on Flight 2. Flight FD on {Pilot, Date, Time_Depart} 3. Pilot FD on {Flight, Date} FD: 1. Flight ---> Time_depart 2. Pilot, Date, Time_Depart ---> Flight 3. Flight, Date ---> Pilot

10 Informal Definition of FD: (Continued) So… Given the FD, we know the Extension Example: 1. Name ---> Address NameAddress N1A1 N2A1 N3A2

11 Informal Definition of FD: (Continued) 3. Name ---> Address NameAddress Address ---> Name N1A1 N2A2 N3A3 2. Address ---> Name A1N1 A2N3

12 Functional Dependency (FD) Example: For every student there exists one advisor. Student ---> Advisor Example: R(A,B,C …)FD: A ---> B R ( AB ) a1b1 a1?

13 Functional Dependency (FD) (Continued) Students (Name, ID, GPA) ID ---> Name ID ---> GPA

14 Functional Dependency (FD) (Continued) R(Pilot, Flight, Date, Time_Depart) Flight ---> Time_Depart Pilot, Date, Time_Depart ---> Flight Flight, Date ---> Pilot PilotFlightDateTime_Depart John4501/14:00 John4503/14:00 Mary4502/14:00 Mary4504/14:00 Larry4603/16:00

15 Facts: The set of FD is dependent on semantic knowledge There are a finite set of FD So…It is possible to find all FD To find all FD is lengthy, so we use Armstrong Axiom (Inference Axiom)

16 Armstrong Axiom (Inference Axiom) If a relation satisfies certain FD It must satisfy other FD 1.Reflexivity: X ---> X 2.Augmentation: X ---> y Implies xz ---> y

17 Armstrong Axiom (Inference Axiom) 3.Additivity: x ---> y x ---> z Then x ---> zy 4.Pseudotransitivity: x ---> y yz ---> w Then xz ---> w

18 Armstrong Axiom (Inference Axiom) 5.Transitivity: x ---> y y ---> z Then x ---> z 6.Projectivity (Reveres of additivity) x ---> yz Then x ---> y