From ER (or EER ) to Relational Schema. Inputs :ER Outputs: Data Model

Similar documents
Database Design Process

Database Design Process

Modern Systems Analysis and Design

Lecture 12: Entity Relationship Modelling

Chapter 7 Data Modeling Using the Entity- Relationship (ER) Model

CSC 742 Database Management Systems

Chapter 3. Data Modeling Using the Entity-Relationship (ER) Model

Unit 2.1. Data Analysis 1 - V Data Analysis 1. Dr Gordon Russell, Napier University

Bridge from Entity Relationship modeling to creating SQL databases, tables, & relations

Entity-Relationship Model

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

Chapter 2: Entity-Relationship Model

Lecture Notes INFORMATION RESOURCES

A brief overview of developing a conceptual data model as the first step in creating a relational database.

DATABASE MANAGEMENT SYSTEMS. Question Bank:

Database Design Overview. Conceptual Design ER Model. Entities and Entity Sets. Entity Set Representation. Keys

XV. The Entity-Relationship Model

IT2305 Database Systems I (Compulsory)

Entity Relationship Diagram

Introduction to normalization. Introduction to normalization

Data Analysis 1. SET08104 Database Systems. Napier University

Introduction to Computing. Lectured by: Dr. Pham Tran Vu

not necessarily strictly sequential feedback loops exist, i.e. may need to revisit earlier stages during a later stage

ComponentNo. C_Description UnitOfMeasure. C_Quantity

IT2304: Database Systems 1 (DBS 1)

Chapter 2: Entity-Relationship Model. Entity Sets. " Example: specific person, company, event, plant

Conceptual Design: Entity Relationship Models. Objectives. Overview

RELATIONSHIP STRENGTH

Data Modeling: Part 1. Entity Relationship (ER) Model

DATABASE DESIGN. - Developing database and information systems is performed using a development lifecycle, which consists of a series of steps.

Database Design. Marta Jakubowska-Sobczak IT/ADC based on slides prepared by Paula Figueiredo, IT/DB

Database Management Systems

7.1 The Information system

Converting E-R Diagrams to Relational Model. Winter Lecture 17

Concepts of Database Management Seventh Edition. Chapter 6 Database Design 2: Design Method

Foundations of Information Management

2. Conceptual Modeling using the Entity-Relationship Model

How To Write A Diagram

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

Designing a Database Schema

The Entity-Relationship Model

Data Modeling. Database Systems: The Complete Book Ch ,

Conceptual Design Using the Entity-Relationship (ER) Model

COMP 378 Database Systems Notes for Chapter 7 of Database System Concepts Database Design and the Entity-Relationship Model

ER modelling, Weak Entities, Class Hierarchies, Aggregation

Fundamentals of Database Design

CIS 631 Database Management Systems Sample Final Exam

TIM 50 - Business Information Systems

Relational Schema Design

IV. The (Extended) Entity-Relationship Model

Databases Model the Real World. The Entity- Relationship Model. Conceptual Design. Steps in Database Design. ER Model Basics. ER Model Basics (Contd.

Fundamentals of Database System

Databasesystemer, forår 2005 IT Universitetet i København. Forelæsning 3: Business rules, constraints & triggers. 3. marts 2005

Lecture 6. SQL, Logical DB Design

Entity - Relationship Modelling


three Entity-Relationship Modeling chapter OVERVIEW CHAPTER

The Relational Model. Why Study the Relational Model? Relational Database: Definitions. Chapter 3

Outline. Data Modeling. Conceptual Design. ER Model Basics: Entities. ER Model Basics: Relationships. Ternary Relationships. Yanlei Diao UMass Amherst

Using Entity-Relationship Diagrams To Count Data Functions Ian Brown, CFPS Booz Allen Hamilton 8283 Greensboro Dr. McLean, VA USA

Review: Participation Constraints

AS LEVEL Computer Application Databases

Data Modeling Basics

Foundations of Information Management

Animated Courseware Support for Teaching Database Design

The Relational Model. Ramakrishnan&Gehrke, Chapter 3 CS4320 1

The E-R èentity-relationshipè data model views the real world as a set of basic objects èentitiesè and

Database Design. Database Design I: The Entity-Relationship Model. Entity Type (con t) Chapter 4. Entity: an object that is involved in the enterprise

A Tool for Generating Relational Database Schema from EER Diagram

CPS352 Database Systems: Design Project

Why & How: Business Data Modelling. It should be a requirement of the job that business analysts document process AND data requirements

Database Design. Adrienne Watt. Port Moody

We know how to query a database using SQL. A set of tables and their schemas are given Data are properly loaded

Lesson 8: Introduction to Databases E-R Data Modeling

Database Design Process. ER Model. Goals. Relational Model. SQL - The Language of Databases. IT420: Database Management and Organization

Database IST400/600. Jian Qin. A collection of data? A computer system? Everything you collected for your group project?

Databases and BigData

Exercise 1: Relational Model

About the Tutorial. Audience. Prerequisites. Copyright & Disclaimer

NATIONAL OPEN UNIVERSITY OF NIGERIA

Database Design Methodology

The Entity-Relationship Model

Databases What the Specification Says

A. TRUE-FALSE: GROUP 2 PRACTICE EXAMPLES FOR THE REVIEW QUIZ:

Database Design Methodology

Section of DBMS Selection & Evaluation Questionnaire

Chapter 8 The Enhanced Entity- Relationship (EER) Model

Relational model. Relational model - practice. Relational Database Definitions 9/27/11. Relational model. Relational Database: Terminology

AVOIDANCE OF CYCLICAL REFERENCE OF FOREIGN KEYS IN DATA MODELING USING THE ENTITY-RELATIONSHIP MODEL

1 Class Diagrams and Entity Relationship Diagrams (ERD)

ER & EER to Relational Mapping. Chapter 9 1

Database Fundamentals: 1

LiTH, Tekniska högskolan vid Linköpings universitet 1(7) IDA, Institutionen för datavetenskap Juha Takkinen

Database Systems. Session 3 Main Theme. Enterprise Data Modeling Using The Entity/Relationship (ER) Model. Dr. Jean-Claude Franchitti

Normalization. Reduces the liklihood of anomolies

SCHEMAS AND STATE OF THE DATABASE

Preview DESIGNING DATABASES WITH VISIO PROFESSIONAL: A TUTORIAL

DATABASE NORMALIZATION

DATABASE INTRODUCTION

Transcription:

Mapping Rules From ER (or EER ) to Relational Schema Inputs :ER Outputs: Data Model Prentice Hall, 2002 1

Transforming EER Diagrams into Relations Mapping Regular Entities to Relations 1. Simple attributes: E-R attributes map directly onto the relation 2. Composite attributes: Use only their simple, component attributes 3. Multi-valued Attribute - Becomes a separate relation with a foreign key taken from the superior entity

Mapping a regular entity (a) CUSTOMER entity type with simple attributes (b) CUSTOMER relation

Mapping a composite attribute (a) CUSTOMER entity type with composite attribute (b) CUSTOMER relation with address detail

Mapping a multivalued attribute (a) Multivalued attribute becomes a separate relation with foreign key (b) 1 to many relationship between original entity and new relation

Transforming EER Diagrams into Relations Mapping Weak Entities Becomes a separate relation with a foreign key taken from the superior entity Primary key composed of: Partial identifier of weak entity Primary key of identifying relation (strong entity)

Example of mapping a weak entity (a) Weak entity DEPENDENT

Relations resulting from weak entity NOTE: the domain constraint for the foreign key should NOT allow null value if DEPENDENT is a weak entity Foreign key Composite primary key

Transforming EER Diagrams into Relations Mapping Binary Relationships One-to-Many - Primary key on the one side becomes a foreign key on the many side Many-to-Many - Create a new relation with the primary keys of the two entities as its primary key One-to-One - Primary key on the mandatory side becomes a foreign key on the optional side

Example of mapping a 1:M relationship (a) Relationship between customers and orders Note the mandatory one

Mapping the relationship Again, no null value in the foreign key this is because of the mandatory minimum cardinality Foreign key

Example of mapping an M:N relationship (a) ER diagram (M:N) The Supplies relationship will need to become a separate relation

Three resulting relations Composite primary key Foreign key Foreign key New intersection relation

Mapping a binary 1:1 relationship

Resulting relations

Transforming EER Diagrams into Relations Mapping Associative Entities Identifier Not Assigned Default primary key for the association Default primary key for the association relation is composed of the primary keys of the two entities (as in M:N relationship) Identifier Assigned It is natural and familiar to end-users Default identifier may not be unique

Mapping an associative entity

Three resulting relations

Transforming EER Diagrams into Relations Mapping Unary Relationships One-to-Many - Recursive foreign key in the same relation Many-to-Many - Two relations: One for the entity type One for an associative relation in which the primary key has two attributes, both taken from the primary key of the entity

Mapping a unary 1:N relationship (a) EMPLOYEE entity with Manages relationship (b) EMPLOYEE relation with recursive foreign key

Mapping a unary M:N relationship (a) Bill-of-materials relationships (M:N) (b) ITEM and COMPONENT relations

Transforming EER Diagrams into Relations Mapping Ternary (and n-ary) Relationships One relation for each entity and one for the associative entity Associative entity has foreign keys to each entity in the relationship

Mapping a ternary relationship (a) Ternary relationship with associative entity

Mapping the ternary relationship Remember that the primary key MUST be unique

Transforming EER Diagrams into Relations Mapping Supertype/Subtype Relationships One relation for supertype and for each subtype Supertype attributes (including identifier and subtype discriminator) go into supertype relation Subtype attributes go into each subtype; primary key of supertype relation also becomes primary key of subtype relation 1:1 relationship established between supertype and each subtype, with supertype as primary table

Supertype / subtype elationships

Mapping Supertype/subtype relationships to relations

What constitutes a Well structured Relation : -Minimal Redundancy - Allows users to insert, update and delete rows without inconsistencies..next Lecture Prentice Hall, 2002 28