The transformation of an ER or EER model into a relational model

Slides:



Advertisements
Similar presentations
Conceptual / semantic modelling
Advertisements

ER to Relational Mapping. Logical DB Design: ER to Relational Entity sets to tables. CREATE TABLE Employees (ssn CHAR (11), name CHAR (20), lot INTEGER,
Convert ER to Relational Database Entity relation Entity relation Attributes attributes Attributes attributes Primary key primary key Primary key primary.
Transform an ER Model into a Relational Database Schema
Week 5 Relational Database Design by ER- -to-Relational Mapping.
Relational Database Design Via ER Modelling
Lecture plan Outline of DB design process Entity-relationship model
Logical Database Design
Database Processing: Fundamentals, Design, and Implementation, 9/e by David M. KroenkeChapter 5/1 Copyright © 2004 Please……. No Food Or Drink in the class.
1 Class Number – CS 304 Class Name - DBMS Instructor – Sanjay Madria Instructor – Sanjay Madria Lesson Title – EER Model –21th June.
Chapter 6 Methodology Logical Database Design for the Relational Model Transparencies © Pearson Education Limited 1995, 2005.
Systems Development Life Cycle
Fundamentals, Design, and Implementation, 9/e Chapter 5 Database Design.
1 Methodology : Conceptual Databases Design © Pearson Education Limited 1995, 2005.
Methodology Logical Database Design for the Relational Model
Chapter 4 Entity Relationship (ER) Modeling
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 9 Relational Database Design by ER- and EER-to- Relational Mapping.
LOGICAL DATABASE DESIGN
Database Design & ER Diagrams
Michael F. Price College of Business Chapter 6: Logical database design and the relational model.
Chapter 14 & 15 Conceptual & Logical Database Design Methodology
ER- and EER-to-Relational Mapping
Entity-Relationship modeling Transparencies
Chapter 5 1 © Prentice Hall, 2002 Chapter 5: Transforming EER Diagrams into Relations Mapping Regular Entities to Relations 1. Simple attributes: E-R attributes.
MIS 385/MBA 664 Systems Implementation with DBMS/ Database Management Dave Salisbury ( )
ER to Relational Translation COMSATS INSTITUTE OF INFORMATION TECHNOLOGY, VEHARI.
CSCI 3140 Module 3 – Logical Database Design for the Relational Model Theodore Chiasson Dalhousie University.
CS 370 Database Systems Lecture 9 The Relational model.
Chapter 11 & 12 Entity-Relationship (E-R) Model Characteristics of E-R Model Components of E-R Model Example of E-R Model Enhanced E-R Model.
3 & 4 1 Chapters 3 and 4 Drawing ERDs October 16, 2006 Week 3.
Chapter 9: Logical Database Design and the Relational Model (ERD Mapping)
1 © Prentice Hall, 2002 Chapter 5: Logical Database Design and the Relational Model Modern Database Management 6 th Edition Jeffrey A. Hoffer, Mary B.
In this session, you will learn to: Map an ER diagram to a table Objectives.
Mapping from conceptual model (EER-M)
Logical Design database design. Dr. Mohamed Osman Hegaz2 Conceptual Database Designing –Provides concepts that are close to the way many users perceive.
1 Chapter 17 Methodology - Local Logical Database Design.
Databases Illuminated Chapter 3 The Entity Relationship Model.
Chapter 9 Logical Database Design : Mapping ER Model To Tables.
Chapter 17 Logical Database Design for the Relational Model Pearson Education © 2009.
Lecture 03 Entity-Relationship Diagram. Chapter Outline.
DatabaseIM ISU1 Fundamentals of Database Systems Chapter 3 Data Modeling Using Entity-Relationship Model.
Week 7-8 DBMS ER-Relational Mapping. ER-Relational Mapping.
1 ER Modeling BUAD/American University Mapping ER modeling to Relationships.
1 © Prentice Hall, 2002 ITD1312 Database Principles Chapter 4B: Logical Design for Relational Systems -- Transforming ER Diagrams into Relations Modern.
Entity-Relationship Modeling. 2 Entity Type u Entity type –Group of objects with same properties, identified by enterprise as having an independent existence.
Database Design Slide 1 Database Design Lecture 7 part 2 Mapping ERD to Tables.
ER- Relational Mapping (Based on Chapter 9 in Fundamentals of Database Systems by Elmasri and Navathe, Ed. 3)
© 2009 Pearson Education, Inc. Publishing as Prentice Hall 1 Chapter 5 (Part a): Logical Database Design and the Relational Model Modern Database Management.
Logical Design 12/10/2009GAK1. Learning Objectives How to remove features from a local conceptual model that are not compatible with the relational model.
Methodology - Logical Database Design. 2 Step 2 Build and Validate Local Logical Data Model To build a local logical data model from a local conceptual.
Lecture # 14 Chapter # 5 The Relational Data Model and Relational Database Constraints Database Systems.
IT 5433 LM3 Relational Data Model. Learning Objectives: List the 5 properties of relations List the properties of a candidate key, primary key and foreign.
April 20022/CS/3X1 Database Design Design method John Wordsworth Department of Computer Science The University of Reading Room.
Logical Database Design and the Rational Model
Methodology Logical Database Design for the Relational Model
Relational Database Design by ER- and EER-to- Relational Mapping
Chapter 4: Part B Logical Database Design and the Relational Model
Chapter 5: Logical Database Design and the Relational Model
Logical Database Design for the Relational Model
Entity-Relationship Modelling
Relational Database Design by ER- and EER-to-Relational Mapping
Chapter (9) ER and EER-to-Relational Mapping, and other Relational Languages Objectives How a relational database schema can be created from a conceptual.
Chapter (9) ER and EER-to-Relational Mapping, and other Relational Languages Objectives How a relational database schema can be created from a conceptual.
Database Management System
Entity-Relationship Modelling
CHAPTER 4: LOGICAL DATABASE DESIGN AND THE RELATIONAL MODEL
Relational Database Design by ER- and EER-to-Relational Mapping
Mapping an ERD to a Relational Database
Mapping an ERD to a Relational Database
Relational Database Design by ER-to-Relational Mapping
Presentation transcript:

The transformation of an ER or EER model into a relational model

Transforming an ER model into a relational model ER model - not supported directly by any DBMS needs to be translated into a model that is supported by DBMSs transformation / mapping process non-deterministic certain ER configurations can be expressed in more than one way in the relational model certain aspects related to the relational model are not specified in the ER model transformation guidelines (rules) some approaches propose two phases ER model to translatable ER model (this can be optional/implicit) translatable ER model into relational model

ER model  relational model entities strong entity  base relation simple, single valued base attributes - ok composite - flatten multi-valued - introduce entity and link with 1:M relationship calculated attributes - eliminate weak entity  base relation primary key contains part of the strong entity primary key foreign key referencing the base relation corresponding to the strong entity how is the “weak entity” information modelled in the relational model? cannot have SET NULL or SET DEFAULT

ER model  relational model binary relationships one to one one partial and one total participation  foreign key from the base relation corresponding to the entity with partial participation to the one with total participation two partial participations  one foreign key from one base relation to another two total participations  as above or merge why would you want to keep them separate? one to many FK from the “many entity” relationship to the “one entity” relationship does it matter whether the “many entity” is weak or strong?

ER model  relational model binary relationships many to many no attributes relationship  relation consisting of two foreign keys, one for each relation corresponding to the two entities involved the two foreign keys  primary key alternatively, change the ER model with attributes transform relationship into entity implement the two resulting 1:M relationships

ER model  relational model binary relationships Activity: how are the participation constraints represented? e.g.: Student Student No No 1 0..1 takes takes 0..* 1..* Project Project Title Supervisor Title Supervisor

ER model  relational model complex relationships with attributes transform into entity no attributes relationship  relation consisting of foreign keys, one for each relation corresponding to the entities involved alternatively, transform complex relationship into binary relationships

ER model  relational model recursive relationships introduce new entity Staff staff Staff staff manager manager 0..* 0..1 1 1 natIns natIns IsAllocatedTo HasAllocation Allocation 0..1 IsManaged 0..*

ER model  relational model recursive relationships Activity: what is the difference between (a) and (b)? (a) (b)

EER model  relational model Activity: translate type hierarchies

Conclusion conceptual model  logical model is the resulting logical model the model that is going to be implemented? logical design  expressing further constraints on data functional dependencies multi-valued dependencies join dependencies if they are not correctly expressed - the logical model can lead to update anomalies