ER-to-Relational Mapping

Similar documents
ER to Relational Mapping

Chapter 9: Relational DB Design byer/eer to Relational Mapping Relational Database Design Using ER-to- Relational Mapping Mapping EER Model

Ch 9: Mapping EER to Relational. Follow a seven-step algorithm to convert the basic ER model constructs into relations steps 1-7

Topic 5: Mapping of EER Diagrams to Relations

Relational DB Design by ER- and EER-to-Relational Mapping Design & Analysis of Database Systems

Database Management

Chapter 17. Methodology Logical Database Design for the Relational Model

Objectives of logical design... Transforming the ERD diagram into relations. Relational database components. Mapping a composite attribute

Chapter 7 Relational Database Design by ER- and EERR-to-Relational Mapping

Chapter 9 Outline. Relational Database Design by ER and EERto-Relational. Mapping Fundamentals of Database Systems

Outline. Note 1. CSIE30600 Database Systems ER/EER to Relational Mapping 2

THE ENHANCED ER (EER) MODEL CHAPTER 8 (6/E) CHAPTER 4 (5/E)

DATABASE DESIGN I - 1DL300

DATABASDESIGN FÖR INGENJÖRER F

DATABASE DESIGN I - 1DL300

MIT Database Management Systems Lesson 03: ER-to-Relational Mapping

A l Ain University Of Science and Technology

Chapter 2: Entity-Relationship Model

Database Principles: Fundamentals of Design, Implementation, and Management Tenth Edition. Chapter 8 Data Modeling Advanced Concepts

LELCTURE 4: ENHANCED ENTITY-RELATIONSHIP MODELING (EER)

DATABASTEKNIK - 1DL116

Relational Model: History

Translating an ER Diagram to a Relational Schema

A l Ain University Of Science and Technology

Chapter 6. Advanced Data Modeling. Database Systems: Design, Implementation, and Management, Seventh Edition, Rob and Coronel

Database Management System 6 ER Modeling...

CMP-3440 Database Systems

DATA MODELING USING THE ENTITY-RELATIONSHIP MODEL. 1 Powered by POeT Solvers Limited

OBJECTIVES. How to derive a set of relations from a conceptual data model. How to validate these relations using the technique of normalization.

Chapter 8 The Enhanced Entity- Relationship (EER) Model

Using High-Level Conceptual Data Models for Database Design A Sample Database Application Entity Types, Entity Sets, Attributes, and Keys

Database Design Process

Chapter 8: Enhanced ER Model

Chapter 6: Entity-Relationship Model. E-R Diagrams

Translation ER/EER to relational

Database Systems: Design, Implementation, and Management Tenth Edition. Chapter 4 Entity Relationship (ER) Modeling

CS 338 The Enhanced Entity-Relationship (EER) Model

Chapter 6: Entity-Relationship Model

Roadmap of This Lecture. Weak Entity Sets Extended E-R Features Reduction to Relation Schemas Database Design UML*

Database Principles: Fundamentals of Design, Implementation, and Management Tenth Edition. Chapter 7 Data Modeling with Entity Relationship Diagrams

Chapter 6: Entity-Relationship Model. The Next Step: Designing DB Schema. Identifying Entities and their Attributes. The E-R Model.

The Next Step: Designing DB Schema. Chapter 6: Entity-Relationship Model. The E-R Model. Identifying Entities and their Attributes.

Chapter (4) Enhanced Entity-Relationship and Object Modeling

Chapter 6: Entity-Relationship Model

4. Entity Relationship Model


Mapping ER Diagrams to. Relations (Cont d) Mapping ER Diagrams to. Exercise. Relations. Mapping ER Diagrams to Relations (Cont d) Exercise

Chapter 7: Entity-Relationship Model

Chapter 7: Entity-Relationship Model

Chapter 6: Entity-Relationship Model

Relational Model (cont d) & Entity Relational Model. Lecture 2

1. Considering functional dependency, one in which removal from some attributes must affect dependency is called

Lecture 10 - Chapter 7 Entity Relationship Model

SE 4DB3 TUTORIAL 2: REDUCTION TO RELATIONAL SCHEMAS

Non-overlappingoverlapping. Final outcome of the worked example On pages R&C pages R&C page 157 Fig 3.52

Chapter 7: Entity-Relationship Model

SVY2001: Databases for GIS

THE ENTITY- RELATIONSHIP (ER) MODEL CHAPTER 7 (6/E) CHAPTER 3 (5/E)

Fundamentals, Design, and Implementation, 9/e Copyright 2004 Database Processing: Fundamentals, Design, and Implementation, 9/e by David M.

More on the Chen Notation

DATABASE SYSTEMS. Chapter 5 Entity Relationship (ER) Modelling DESIGN IMPLEMENTATION AND MANAGEMENT INTERNATIONAL EDITION ROB CORONEL CROCKETT

Database Design Process. Requirements Collection & Analysis

Lecture 2. Database design. The Entity-Relationship model

Database Systems: Design, Implementation, and Management Tenth Edition. Chapter 4 Entity Relationship (ER) Modeling

CS3200 Database Design Spring 2018 Derbinsky. Entity-Relationship (ER) Diagrams. Lecture 7

1/24/2012. Chapter 7 Outline. Chapter 7 Outline (cont d.) CS 440: Database Management Systems

This chapter discusses how to design a relational

CMPT 354 Database Systems I

Chapter 4. In this chapter, you will learn:

CONCEPTUAL DESIGN: ER TO RELATIONAL TO SQL

Advance Database Management System

Database Management System (15ECSC208) UNIT I: Chapter 2: Relational Data Model and Relational Algebra

Entity Relationship Data Model. Slides by: Shree Jaswal

Chapter 7: Entity-Relationship Model. Chapter 7: Entity-Relationship Model

LECTURE 6: GUIDELINES FOR GOOD RELATIONAL DESIGN MAPPING ERD TO RELATIONS

Conceptual Database Design

Chapter 4. Enhanced Entity- Relationship Modeling. Enhanced-ER (EER) Model Concepts. Subclasses and Superclasses (1)

Database Design and the E-R Model (7.4, )

Informatics 1: Data & Analysis

course 3 Levels of Database Design CSCI 403 Database Management Mines Courses ERD Attributes Entities title 9/26/2018

Enhanced Entity- Relationship Models (EER)

E-R Model. Hi! Here in this lecture we are going to discuss about the E-R Model.

CSE 880:Database Systems. ER Model and Relation Schemas

COMP102: Introduction to Databases, 13

Objectives Definition iti of terms List five properties of relations State two properties of candidate keys Define first, second, and third normal for

Distributed Database Systems By Syed Bakhtawar Shah Abid Lecturer in Computer Science

Data Modeling with the Entity Relationship Model. CS157A Chris Pollett Sept. 7, 2005.

Sarajane Marques Peres, Ph.D. University of São Paulo Based on Elsmari, Navathe / Silberschatz, Korth, Sudarshan s books

Copyright 2016 Ramez Elmasri and Shamkant B. Navathe

The Entity Relationship Model

Enhanced Entity-Relationship (EER) Modeling

David M. Kroenke and David J. Auer Database Processing Fundamentals, Design, and Implementation

System Analysis & design

How To Convert An Er Diagram Into Relational Schema Example

COSC344 Database Theory and Applications. σ a= c (P) S. Lecture 4 Relational algebra. π A, P X Q. COSC344 Lecture 4 1

Chapter # 4 Entity Relationship (ER) Modeling

Chapter 4 Entity Relationship Modeling In this chapter, you will learn:

Entity-Relationship Model. Dr. Samaresh Mishra, School of Computer Engineering, KIIT University, Bhubaneswar

High Level Database Models

Represent entities and relations with diagrams

Transcription:

Lecture 9 1

1. Context 2. The Algorithm Outline 2

Database Design and Implementation Process 3

Data Models 4

Example ERD 5

Resulting Relational Schema 6

Step 1: Regular Entity Types i. For each regular/strong entity type, create a corresponding relation that includes all the simple attributes (includes simple attributes of composite relations) ii. Choose one of the key attributes as primary If composite, the simple attributes together form the primary key iii. Any remaining key attributes are kept as secondary unique keys (these will be useful for physical tuning w.r.t. indexing analysis) 7

Example ERD 8

Step 1 Result 9

Step 2: Weak Entity Types i. For each weak entity type, create a corresponding relation that includes all the simple attributes ii. Add as a foreign key all of the primary key attribute(s) in the entity corresponding to the owner entity type iii. The primary key is the combination of all the primary key attributes from the owner and the partial key of the weak entity, if any 10

Example ERD 11

Step 2 Result 12

Step 3: Mapping Binary 1-to-1 Three approaches Foreign Key Usually appropriate Merged Relation Possible when both participations are total Relationship Relation Not discussed 13

Step 3: Mapping Binary 1-to-1 Foreign Key i. Choose one relation as S, the other T Better if S has total participation (reduces number of NULL values) ii. Add to S all the simple attributes of the relationship iii. Add as a foreign key in S the primary key attributes of T 14

Example ERD 15

Step 2 Result 16

Step 3 Result 17

Step 4: Binary 1-to-N i. Choose the S relation as the type at the N-side of the relationship, other is T ii. Add as a foreign key to S all of the primary key attribute(s) of T Another approach: create a relationship relation 18

Example ERD 19

Step 4 Result 20

Step 5: Binary M-to-N i. Create a new relation S (termed: relationship relation) In some ERD dialects, actually drawn in ii. Add as foreign keys the primary keys of both relations; their combination forms the primary key of S iii. Add any simple attributes of the M:N relationship to S 21

Example ERD 22

Step 5 Result 23

Step 6: Multivalued Attributes i. Create a new relation S ii. Add as foreign keys the primary keys of the corresponding relation iii. Add the attribute to S (if composite, the simple attributes); the combination of all attributes in S forms the primary key 24

Example ERD 25

Step 6 Result 26

Step 7: Specialization/Generalization A. Multiple relations subclass and superclass Usually works (assumes unique id at parent) B. Multiple relations subclass only Should only be used for disjoint C. Single relation with one type attribute Only for disjoint, can result in many NULLs D. Single relation with multiple type attributes Better for overlapping, could be disjoint 27

Specialization/Generalization (A) 28

Specialization/Generalization (B) 29

Specialization/Generalization (C) 30

Specialization/Generalization (D) 31

Summary Mapping from ERDs to relations is an algorithmic process Some choice points involve comparing time-space tradeoffs (more in physical design) 32