Mapping E/R to Relational

Slides:



Advertisements
Similar presentations
Convert ER to Relational Database Entity relation Entity relation Attributes attributes Attributes attributes Primary key primary key Primary key primary.
Advertisements

Week 5 Relational Database Design by ER- -to-Relational Mapping.
Relational Database Design Via ER Modelling
CS34311 Translating ER Schema to Relational Model.
Fundamentals, Design, and Implementation, 9/e Chapter 5 Database Design.
1 © Prentice Hall, 2002 Chapter 5: Logical Database Design and the Relational Model Modern Database Management 6 th Edition Jeffrey A. Hoffer, Mary B.
Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 1 Data Models: Degrees of Data Abstraction l Modified ANSI/SPARC Framework.
Mapping ERM to relational database
Ch 6: ER to Relational Mapping
 Keys are special fields that serve two main purposes: ◦ Primary keys are unique identifiers of the relation in question. Examples include employee numbers,
ER- and EER-to-Relational Mapping
Chapter 5 1 © Prentice Hall, 2002 Chapter 5: Transforming EER Diagrams into Relations Mapping Regular Entities to Relations 1. Simple attributes: E-R attributes.
Converting ER model Into Relational Table
Conversion from ER diagram to relational model
1 E/R to relational mapping algorithm – overview Mapping algorithm step 1-7 Steen Jensen, autumn 2013.
EXAMPLE. Subclasses and Superclasses Entity type may have sub-grouping that need to be represented explicitly. –Example: Employee may grouped into.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 6-1 David M. Kroenke’s Chapter Six: Transforming Data Models into Database.
DESIGN AND IMPLEMENTATION DATA MODELING TOOLS Indah Puspa Sari ( ) Advisor : Adi Wibowo, M.T. Andreas Handojo, M.MT.
CS 370 Database Systems Lecture 9 The Relational model.
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.
3 & 4 1 Database Systems: Design, Implementation, & Management, 7 th Edition, Rob & Coronel Keys Consists of one or more attributes that determine other.
E-R to Relational - Basic
1 CS 430 Database Theory Winter 2005 Lecture 15: How to Convert an ER Model to Relations.
Software School of Hunan University Database Systems Design Part III : Mapping ER Diagram to Relational Schema.
Week 7-8 DBMS ER-Relational Mapping. ER-Relational Mapping.
1 © Prentice Hall, 2002 ITD1312 Database Principles Chapter 4B: Logical Design for Relational Systems -- Transforming ER Diagrams into Relations Modern.
Logical Database Design and the Relational Model.
ER- Relational Mapping (Based on Chapter 9 in Fundamentals of Database Systems by Elmasri and Navathe, Ed. 3)
Transforming ER models to relational schemas
Mapping ER to Relational Model Each strong entity set becomes a table. Each weak entity set also becomes a table by adding primary key of owner entity.
Conversion from ER diagram to relational model 1 ER is a visual model The relational model is a matemathical model.
Relational Database Design by ER- and EER-to-Relational Mapping
Chapter 2: Entity-Relationship Model
COP Introduction to Database Structures
Chapter 3 Data Modeling Using the Entity-Relationship Model
Entity- Relationship (ER) Model
Chapter 5 Database Design
Entity-Relationship Model
Relational Database Design by ER- and EER-to- Relational Mapping
Chapter 4 Logical Database Design and the Relational Model
Chapter 4: Logical Database Design and the Relational Model
Chapter 4: Part B Logical Database Design and the Relational Model
Chapter 5: Logical Database Design and the Relational Model
Entity-Relationship Model
Tables and Their Characteristics
Database Design – Lecture 4
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
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.
الفصل الخامس قواعد البيانات Databases
Data Modeling Concepts
Session 2 Welcome: The seventh learning sequence
The Relational Model Textbook /7/2018.
CHAPTER 4: LOGICAL DATABASE DESIGN AND THE RELATIONAL MODEL
Relational Database Design (Top Down)
Database Systems Instructor Name: Lecture-11.
Database Processing: David M. Kroenke’s Chapter Six:
Review of Week 1 Database DBMS File systems vs. database systems
Relational Database Design by ER- and EER-to-Relational Mapping
Data Modeling Concepts
Entity-Relationship Diagram (ERD)
DBMS ER-Relational Mapping
Chapter (7) ER-to-Relational Mapping, and other Relational Languages
ER MODELING Instructor: SAMIA ARSHAD
Data Analysis 3 Unit 2.3 Dr Gordon Russell, Napier University
Relational Database Design by ER-to-Relational Mapping
Presentation transcript:

Mapping E/R to Relational Textbook Ch. 6.8 @1997 UW CSE 10/7/97

Big Picture E/R is better for design than relational Better semantics, closer to user view Relational is better for implementation RDBMS's are widely available Mapping E/R to relational is pretty mechanical Roughly: entities map to entities; relationships show up as foreign keys or new relations; all attributes end up somewhere 10/7/97

Entities Strong entities (i.e., having a key) Weak entities map unchanged Weak entities add to the entity the (foreign) key of its owner As we'll soon see, additional attributes may get added... 10/7/97

Relationships Entities S and T are 1:1 in the relationship Add T's key as foreign key to S Add any relationship attributes to S If one of the entities is total, use it as S Entities S and T are N:1 (S is the N side) 10/7/97

N:M relationships Create a new relation contains the keys of both S and T as attributes contains a row for each pair of related S and T entities contains the relationship attributes Ternary and higher relationships proceed as for binary N:M relationships: create a new relation with as many foreign keys as there are entities in the relationship, etc. 10/7/97

Attributes Simple attributes map unchanged Compound attributes As noted, relationship attributes migrate to an entity (usually the "weaker" or "smaller" one) Compound attributes Break into individual items "address" -> "street", "city", "state", "zip" Multivalued attributes Create a relation which joins primary key with each occurring value of the attribute 10/7/97