Relational Database Design by ER- and EER-to-Relational Mapping

Slides:



Advertisements
Similar presentations
3/25/2017.
Advertisements

Relational Database Design Via ER Modelling
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.
1 CSE 480: Database Systems Lecture 8: EER to Relational Mapping and DBDesigner Reference: Read Chapter 9 of the textbook.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 9 Relational Database Design by ER- and EER-to-Relational Mapping.
Dr. Dang Tran Khanh M.eng. Tran Minh Quang
ER- and EER-to-Relational Mapping
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Slide 7- 1.
Chapter 5: Logical Database Design and the Relational Model
Dr. Bernard Chen Ph.D. University of Central Arkansas Fall 2008
Relational Database Design by ER- and EER-to-Relational Mapping
1 CSE 880: Database Systems Lecture : EER to Relational Mapping Reference: Read Chapter 9 of the textbook.
Chapter 21 B Mapping to ODL Copyright © 2004 Pearson Education, Inc.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Chapter 7 Relational Database Design by ER- Mapping.
Relational Database Design by ER- and EER-to- Relational Mapping
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Chapter 4 Normalization.
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.
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,
Kingdom of Saudi Arabia Ministry of Higher Education Al-Imam Muhammad Ibn Saud Islamic University College of Computer and Information Sciences The Relational.
ER-TO-RELATIONAL MODEL MAPPING CONTENT SOURCES: ELAMSARI AND NAVATHE, FUNDAMENTALS OF DATABASE MANAGEMENT SYSTEMS.
Relational Data Model and ER-/EER-to-Relational Mapping.
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
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
Relational Database Design by ER- and EER-to-Relational Mapping
Chapter 7 Relational Database Design by ER- and EERR-to-Relational Mapping Copyright © 2004 Pearson Education, Inc.
Lecture # 21 Chapter # 7 Relational Database Design by ER- and EER-to-Relational Mapping Muhammad Emran Database Systems.
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
EER Model – Chapter
Enhanced Entity-Relationship (EER) Modeling
ER- and EER-to-Relational
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
ER-to-Relational Mapping Outline
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.
CS4222 Principles of Database System
Presentation transcript:

Relational Database Design by ER- and EER-to-Relational Mapping Chapter 7_part2 Relational Database Design by ER- and EER-to-Relational Mapping

Outline ER-to-Relational Mapping Algorithm Step 1: Mapping of Regular Entity Types Step 2: Mapping of Weak Entity Types Step 3: Mapping of Binary 1:1 Relation Types Step 4: Mapping of Binary 1:N Relationship Types. Step 5: Mapping of Binary M:N Relationship Types. Step 6: Mapping of Multivalued attributes. Step 7: Mapping of N-ary Relationship Types. Mapping EER Model Constructs to Relations Step 8: Options for Mapping Specialization or Generalization. Introduction to Databases

Mapping EER Model Constructs to Relations Step8: Options for Mapping Specialization or Generalization Convert each specialization with m subclasses {S1, S2,….,Sm} and generalized superclass C, where the attributes of C are {k,a1,…an} and k is the (primary) key, into relational schemas using one of the four following options: Option 8A: Multiple relations-Superclass and subclasses Create a relation L for C with attributes Attrs(L) = {k,a1,…an} and PK(L) = k. Create a relation Li for each subclass Si, 1 < i < m, with the attributes Attrs(Li) = {k} U {attributes of Si} and PK(Li)=k. This option works for any specialization (total or partial, disjoint of over-lapping). Option 8B: Multiple relations-Subclass relations only Create a relation Li for each subclass Si, 1 < i < m, with the attributes Attr(Li) = {attributes of Si} U {k,a1…,an} and PK(Li) = k. This option only works for a specialization whose subclasses are total (every entity in the superclass must belong to (at least) one of the subclasses). Introduction to Databases

Options for mapping specialization or generalization Options for mapping specialization or generalization. Mapping the EER schema using option 8A Introduction to Databases

Options for mapping specialization or generalization Options for mapping specialization or generalization. Mapping the EER schema using option 8B Introduction to Databases

Mapping EER Model Constructs to Relations Option 8C: Single relation with one type attribute. Create a single relation L with attributes Attrs(L) = {k,a1,…an} U {attributes of S1} U…U {attributes of Sm} U {t} and PK(L) = k. The attribute t is called a type (or discriminating) attribute that indicates the subclass to which each tuple belongs. This option works only for a specialization whose subclasses are disjoint. Option 8D: Single relation with multiple type attributes. Create a single relation schema L with attributes Attrs(L) = {k,a1,…an} U {attributes of S1} U…U {attributes of Sm} U {t1, t2,…,tm} and PK(L) = k. Each ti, 1 < I < m, is a Boolean type attribute indicating whether a tuple belongs to the subclass Si. This option works only for a specialization whose subclasses are overlapping. Introduction to Databases

Options for mapping specialization or generalization Options for mapping specialization or generalization. Mapping the EER schema using option 8C d Introduction to Databases

Options for mapping specialization or generalization Options for mapping specialization or generalization. Mapping the EER schema using option 8D; with Boolean type fields Mflag and Pflag. o Introduction to Databases

Mapping EER Model to Relations (contd.) Mapping of Shared Subclasses (Multiple Inheritance) A shared subclass, such as STUDENT_ASSISTANT, is a subclass of several classes, indicating multiple inheritance. These classes must all have the same key attribute. We can apply any of the options discussed in Step 8 to a shared subclass, subject to the restriction discussed in Step 8 of the mapping algorithm. both 8C and 8D are used for the shared class STUDENT_ASSISTANT. Introduction to Databases

A specialization lattice with multiple inheritance for a UNIVERSITY database. Introduction to Databases

Mapping the EER specialization lattice using multiple options. 8D 8D Mapping the EER specialization lattice using multiple options. Introduction to Databases

Summary ER-to-Relational Mapping Algorithm Step 1: Mapping of Regular Entity Types Step 2: Mapping of Weak Entity Types Step 3: Mapping of Binary 1:1 Relation Types Step 4: Mapping of Binary 1:N Relationship Types. Step 5: Mapping of Binary M:N Relationship Types. Step 6: Mapping of Multivalued attributes. Step 7: Mapping of N-ary Relationship Types. Mapping EER Model Constructs to Relations Step 8: Options for Mapping Specialization or Generalization. Introduction to Databases