INF385T: Information Modeling — Class 11 Relational Database Design from ER Models Presented November 2 Karen Wickett, wickett@ischool.utexas.edu.

Slides:



Advertisements
Similar presentations
3/25/2017.
Advertisements

Week 5 Relational Database Design by ER- -to-Relational Mapping.
Relational Database Design Via ER Modelling
Mapping ER to Relational Model
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Slide 7- 1.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Slide 7- 1.
Mapping the ER Model to Relations(1)1 Overview  Mapping entity types  Mapping relationship types  One-to-one  One-to-many  Many-to-many.
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.
Database Systems Chapter 7 ITM 354. Chapter Outline ER-to-Relational Schema Mapping Algorithm –Step 1: Mapping of Regular Entity Types –Step 2: Mapping.
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
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
Dr. Bernard Chen Ph.D. University of Central Arkansas Fall 2008
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- to-Relational Mapping.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Chapter 7 Relational Database Design by ER- Mapping.
1 CSE 480: Database Systems Lecture 4: Enhanced Entity-Relationship Modeling Reference: Read Chapter 8.1 – 8.5 of the textbook.
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.
Software School of Hunan University Database Systems Design Part III : Mapping ER Diagram to Relational Schema.
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.
Lecture 03 Entity-Relationship Diagram. Chapter Outline.
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)
Transforming ER models to relational schemas
Lecture (8) 1. Relational Database Design by ER- and EERR- to-Relational Mapping 2.
Relational Database Design by ER- and EER-to-Relational Mapping
Chapter 7 Relational Database Design by ER- and EERR-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.
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.
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
Entity- Relationship (ER) Model
Relational Database Design by ER- and EER-to- Relational Mapping
Entity-Relationship Model
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.
9/5/2018.
Chapter (9) ER and EER-to-Relational Mapping, and other Relational Languages Objectives How a relational database schema can be created from a conceptual.
Mapping ER Diagrams to Tables
11/15/2018.
Order Database – ER Diagram
Chapter 8: Mapping a Conceptual Design into a Logical Design
Relational Database Design by ER- and EER-to-Relational Mapping
Initial Design of Entity Types: EMPLOYEE, DEPARTMENT, PROJECT, DEPENDENT Gender.
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.
Mapping an ERD to a Relational Database
Relational Database Design by ER- and EER-to-Relational Mapping
Chapter (7) ER-to-Relational Mapping, and other Relational Languages
7/19/2019.
Relational Database Design by ER-to-Relational Mapping
Presentation transcript:

INF385T: Information Modeling — Class 11 Relational Database Design from ER Models Presented November 2 Karen Wickett, wickett@ischool.utexas.edu School of Information University of Texas at Austin Fall 2016

Agenda An example database design exercise to work through together Mapping from an E-R model to a relational DB schema entities, 1:N relationships, M:N relationships

MOVIE Database Design Exercise Requirements Each movie is identified by title and year of release, has a length in minutes. Each movie has one or more directors and one or more actors appear in it. Each movie was produced by a production company. Each movie has a plot outline and is classified under a genre (e.g. horror, comedy, action, etc.) Each movie has zero or more quotable quotes, each spoken by a particular actor in the movie. Actors are identified by name and date of birth, and appear in one or more movies. Each actor has a role in each movie in which they appear. Directors are identified by name and date of birth and direct one or more movies. Production companies are identified by name and each has an address. A production company produces one or more movies.

Mapping

Example

Mapping (strong) Entity Types For each entity type, create a relation schema (empty table) that includes the attributes of the entity (as the columns of the table). For example, for the EMPLOYEE entity type we create the EMPLOYEE relation schema

Mapping Weak Entity Types For each weak entity W with owner entity type E, create a relation R and include all attributes of W as attributes of R. In addition, include as foreign key attributes of R, the primary key attributes of the owner entity type E. The primary key of R is the combination of the primary of the owner relations and the partial key of W, if any. For example, DEPENDENT is a weak entity type with the owner type EMPLOYEE

Mapping: I:N Relationship Types For each 1:N relationship, take the relation schema corresponding to the entity type on the N-side of the relationship and include as a foreign key attribute, the primary key of the relation schema that corresponds to the other entity type.

Mapping: M:N Relationship Types Create a new relation schema S (empty table) that will act to connect the primary keys on each side of the relationship. Include as foreign keys, the primary keys of each participating entity type. The combination will act as the primary key of S. Include any attributes of the relationship type as attributes of S Where Essn points to Ssn in the EMPLOYEE Relation And Pno points to Pnumber in the PROJECT Relation

Example: resulting Relational Database Schema