EER to Relation Models Mapping

Slides:



Advertisements
Similar presentations
3/25/2017.
Advertisements

National Seminar on Developing a Program for the Implementation of the 2008 SNA and Supporting Statistics in Turkey Arzu TOKDEMİR 10 September 2013 Ankara.
Welcome Welcome to the next session in the professional development program focused around the 9-12 Mathematics Standards. 3/1/20141Geometry.
SAP-Customizing SAP-Customizing.

Week 5 Relational Database Design by ER- -to-Relational Mapping.
Relational Database Design Via ER Modelling
10/12/20141Chem-160. Covalent Bonds 10/12/20142Chem-160.
MarcEdit "A Closer Look at Productivity Tools” NETSL 2014 Apr. 11, pm.
Mapping ER to Relational Model
1 Class Number – CS 304 Class Name - DBMS Instructor – Sanjay Madria Instructor – Sanjay Madria Lesson Title – EER Model –21th June.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Slide 7- 1.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Slide 7- 1.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Chapter 7 Relational Database Design by ER- and EER-to-Relational Mapping.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Chapter 7 Relational Database Design by ER- Mapping.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 9 Relational Database Design by ER- and EER-to- Relational Mapping.
Database Systems Chapter 7 ITM 354. Chapter Outline ER-to-Relational Schema Mapping Algorithm –Step 1: Mapping of Regular Entity Types –Step 2: Mapping.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 9 Relational Database Design by ER- and EER-to- Relational Mapping.
Summary of Mapping constructs and constraints
Chapter 7 Relational Database Design by ER- and EER-to-Relational Mapping Copyright © 2004 Pearson Education, Inc.
Database Systems ER and EER to Relational Mapping Toqir Ahmad Rana Database Management Systems 1 Lecture 18.
Dr. Bernard Chen Ph.D. University of Central Arkansas
Chapter 91 ER & EER to Relational Mapping. Chapter 92 ER to Relational Mapping Step 1: For each regular entity type E in the ER schema, create a relation.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 9 Relational Database Design by ER- and EER-to-Relational Mapping.
ER- and EER-to-Relational Mapping
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Slide 7- 1.
Dr. Bernard Chen Ph.D. University of Central Arkansas Fall 2008
Relational Database Design by ER- and EER-to-Relational Mapping
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 9 Relational Database Design by ER- and EER-to- Relational Mapping.
METU Department of Computer Eng Ceng 302 Introduction to DBMS Relational Database Design by ER to Relational Mapping by Pinar Senkul resources: mostly.
Slide Chapter 7 Relational Database Design by ER- to-Relational Mapping.
Logical Design database design. Dr. Mohamed Osman Hegaz2 Conceptual Database Designing –Provides concepts that are close to the way many users perceive.
1 CS 430 Database Theory Winter 2005 Lecture 15: How to Convert an ER Model to Relations.
Relational Database Design by ER- and EERR-to-Relational Mapping.
Chapter 6 Relational Database Design by ER- and EERR-to-Relational Mapping Copyright © 2004 Pearson Education, Inc.
Relational Database Design by ER- and EER-to-Relational Mapping The main reference of this presentation is the textbook and PPT from : Elmasri & Navathe,
Chapter 5 ER-to- Relational Mapping HUANG XUEHUA.
DatabaseIM ISU1 Chapter 7 ER- and EER-to-Relational Mapping Fundamentals of Database Systems.
ER/EER to Relational Mapping Chapter 9. STEP 1 ENTITY TYPE E (non weak) -> NEW RELATION T RELATION T: – includes all simple attributes (non composite,
ER-TO-RELATIONAL MODEL MAPPING CONTENT SOURCES: ELAMSARI AND NAVATHE, FUNDAMENTALS OF DATABASE MANAGEMENT SYSTEMS.
Copyright © 2016 Ramez Elmasri and Shamkant B. Navathe CHAPTER 9 Relational Database Design by ER- and EERR-to-Relational Mapping Slide 9- 1.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Slide 7- 1.
ER- Relational Mapping (Based on Chapter 9 in Fundamentals of Database Systems by Elmasri and Navathe, Ed. 3)
Introduction to Database Systems
Lecture (8) 1. Relational Database Design by ER- and EERR- to-Relational Mapping 2.
Relational Database Design by ER- and EER-to-Relational Mapping
Relational Database Design by ER- and EER-to-Relational Mapping
Chapter 7 Relational Database Design by ER- and EERR-to-Relational Mapping.
Databases (CS507) CHAPTER 8
Chapter 7 Relational Database Design by ER- and EERR-to-Relational Mapping Copyright © 2004 Pearson Education, Inc.
Relational Database Design by ER- and ERR-to-Relational Mapping
Relational Database Design by ER- and EER-to- Relational Mapping
Relational Database Design by ER- and EER-to- Relational Mapping
Relational Database Design by ER- and EER-to-Relational Mapping
ER- and EER-to-Relational
Relational Database Design by ER- and EERR-to-Relational Mapping
Relational Database Design by ER-to-Relational Mapping
9/5/2018.
11/15/2018.
Chapter 8: Mapping a Conceptual Design into a Logical Design
Relational Database Design by ER- and EER-to-Relational Mapping
EER to Relational Mapping
Relational Database Design by ER- and EER-to-Relational Mapping
Relational Database Design by ER- and EER-to- Relational Mapping
Relational Database Design by ER- and EERR-to-Relational Mapping
4/11/2019.
Relational Database Design by ER- and EER-to-Relational Mapping
CS4222 Principles of Database System
7/19/2019.
Relational Database Design by ER-to-Relational Mapping
Presentation transcript:

EER to Relation Models Mapping 3/25/2017 Sumitha C.H, SFIT

Outline ER to relations model mapping – review Summary 3/25/2017 Sumitha C.H, SFIT

3/25/2017 Sumitha C.H, SFIT

ER to relations model mapping – Steps 3/25/2017 Sumitha C.H, SFIT

ER to relations model mapping – Steps Step 1: Mapping of Regular Entity Types. For each regular (strong) entity type in the ER schema, create a relation R that includes all the simple attributes of E. Choose one of the key attributes of E as the primary key for the relation. 3/25/2017 Sumitha C.H, SFIT

Employee Project Department Fname Minit Lname Ssn Bdate Sex Address Salary Pname Pnumber PLocation Dname Dnumber ER 3/25/2017 Sumitha C.H, SFIT

ER to relations mapping – Steps Step 2: Mapping of Weak Entity Types For each weak entity type W in the ER schema with owner entity type E, create a relation R and include all attributes of the weak entity as attributes of the new relation R. Then, include the primary key of the owner entity as foreign key attributes of R. The primary key of R is the combination of the primary key(s) of the owner(s) and the partial key of the weak entity type W, if any. 3/25/2017 Sumitha C.H, SFIT

Employee Dependent Fname Minit Lname Ssn Bdate Sex Address Salary Essn Dep_name Sex Bdate Relationship ER 3/25/2017 Sumitha C.H, SFIT

ER to Relational Mapping steps Step 3: Mapping of 1:1 Relation Types (1) Foreign Key approach: Choose one of the relations and include as foreign key in one relation (S) which is the primary key of the other relation (T). S  an entity type with total participation in the relationship (2) Merged relation option: Merge the two entity types and the relationship into a single relation. Appropriate when both participations are total. 3/25/2017 Sumitha C.H, SFIT

Employee Department Fname Minit Lname Ssn Bdate Sex Address Salary Dname Dnumber MgrSsn MgrStartDate ER 3/25/2017 Sumitha C.H, SFIT

ER to Relational Mapping steps Step 4: Mapping of Binary 1:N Relationship Types. For each regular 1:N relationship type R, identify the relation S, which is the entity on the N-side of the relationship. Include as foreign key in S the primary key of the relation which is on the 1 side of the relationship. Include any simple attributes of the 1:N relation type as attributes of S. 3/25/2017 Sumitha C.H, SFIT

Employee Department Project Dependent Fname Minit Lname Ssn Bdate Sex Address Salary SuperSsn DNo Dname Dnumber MGrSSN MgrStartDate Pname Pnumber PLocation Dnum Essn Dep_name Sex Bdate Relationship ER 3/25/2017 Sumitha C.H, SFIT

ER to Relational Mapping steps Step 5: Mapping of Binary M:N Relationship Types. For each M:N relationship type, create a new relation S to represent the relationship. Include as foreign key attributes in S the primary keys of the entities on each side of the relationship; the combination of the two primary keys will form the primary key of S. Also include any simple attributes of the M:N relationship type as attributes of S. 3/25/2017 Sumitha C.H, SFIT

Employee Department Project Dependent Works_On Fname Minit Lname Ssn Bdate Sex Address Salary SuperSsn DNo Dname Dnumber MGrSSN MgrStartDate Pname Pnumber PLocation Dnum Essn Dep_name Sex Bdate Relationship Essn Pno Hours ER 3/25/2017 Sumitha C.H, SFIT

ER to Relational Mapping steps Step 6: Mapping of Multivalued attributes. For each multivalued attribute A, create a new relation. contains an attribute corresponding to the multi-valued attribute, plus the primary key attribute of the relation that has the multi-valued attribute, K. The primary key of R is the combination of A and K. 3/25/2017 Sumitha C.H, SFIT

Employee Department Project Dependent Works_On Dept_Locations Fname Minit Lname Ssn Bdate Sex Address Salary SuperSsn DNo Dname Dnumber MGrSSN MgrStartDate Pname Pnumber PLocation Dnum Essn Dep_name Sex Bdate Relationship Essn Pno Hours ER Dnumber DLocation 3/25/2017 Sumitha C.H, SFIT

Result of mapping the COMPANY ER schema into a relational schema. 3/25/2017 Sumitha C.H, SFIT

EER to Relational Mapping steps Step 7: Mapping of N-ary Relationship Types. (Non-binary relationships) For each n-ary relationship type R, where n>2, create a new relation S to represent the relationship. Include as foreign key attributes in S the primary keys of the relations that represent the participating entities. Also include any simple attributes of the n-ary relationship type as attributes of S. 3/25/2017 Sumitha C.H, SFIT

Ternary relationship types. (a) The SUPPLY relationship. 3/25/2017 Sumitha C.H, SFIT

Mapping the n-ary relationship type SUPPLY 3/25/2017 Sumitha C.H, SFIT

EER to Relational Mapping steps Step8: Options for Mapping Specialization or Generalization. Option 8A: Multiple relations, Super class and subclasses. Create a relation for the super class, including the super class attributes. Create a relation for each subclass, which includes the primary key of the super class (which acts as the foreign key) and the attributes of the subclass specialization. This works for any specialization (partial, total, disjoint, overlapping) 3/25/2017 Sumitha C.H, SFIT

3/25/2017 Sumitha C.H, SFIT

EER to Relational Mapping steps Step8: Options for Mapping Specialization or Generalization. Option 8B: Multiple relations, Subclass relations only Create a relation for each subclass, with the attributes of both the super class and the attributes of the subclass. works for total specializations 3/25/2017 Sumitha C.H, SFIT

3/25/2017 Sumitha C.H, SFIT

EER to Relational Mapping steps Step8: Options for Mapping Specialization or Generalization. Option 8C: Single relation with one type attribute. Create a single relation, with all the attributes of the super class and all the attributes of a subclass. Include a ‘Type’ attribute, which is the discriminating attribute which indicates which subclass the row belongs to. This only works if the specialization is disjoint, meaning the super class entity cannot be a member of more than one subclass. 3/25/2017 Sumitha C.H, SFIT

EngType 3/25/2017 Sumitha C.H, SFIT

EER to Relational Mapping steps Step8: Options for Mapping Specialization or Generalization. Option 8D: Single relation with multiple type attributes. Create a single relation with all the attributes of the super class and all the attributes of the subclass. Include a Boolean “Type” attribute for each subclass, which indicates whether the row belongs to that subclass. This works with overlapping specializations, to indicate if the super class entity belongs to more than one subclass. 3/25/2017 Sumitha C.H, SFIT

3/25/2017 Sumitha C.H, SFIT

EER to Relational Mapping steps Step 9: Mapping of Union Types (Categories). For mapping a category whose defining super classes have different keys, you can specify a new key attribute, called a surrogate key, when creating a relation to correspond to the category. Then create a relation for each category, which includes the attributes of the category, and the surrogate key, which acts as the foreign key. 3/25/2017 Sumitha C.H, SFIT

Two categories (union types): OWNER and REGISTERED_VEHICLE. 3/25/2017 Sumitha C.H, SFIT

Mapping the EER categories (union types) to relations. OwnerId CYear 3/25/2017 Sumitha C.H, SFIT

THANK YOU !!! 3/25/2017 Sumitha C.H, SFIT