ERD ENTITY RELATIONSHIP DIAGRAM

Similar documents
Database Management Systems

Database Design Process

Database Design Process

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

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

Database Design Methodology

SCHEMAS AND STATE OF THE DATABASE

TIM 50 - Business Information Systems

The Entity-Relationship Model

Access Tutorial 3: Relationships

Entity/Relationship Modelling. Database Systems Lecture 4 Natasha Alechina

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

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

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

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

Data Modelling and E-R Diagrams

G Barnaby Electronics Ltd case Study - Comparison of Entity-Relationship and Normalisation Database Designs

Data Analysis 1. SET08104 Database Systems. Napier University

Databases What the Specification Says

Designing Databases. Introduction

Entity Relationship Diagram

Answers to Review Questions

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

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

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

Topic # 08. Structuring System Process Requirements. CIS Life Cycle and Requirements Structuring Stage

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

Access Part 2 - Design

Modern Systems Analysis and Design

Entity-Relationship Model

Welcome to the Data Analytics Toolkit PowerPoint presentation on EHR architecture and meaningful use.

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

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

Database Design Methodology

Database Design Basics

1 Class Diagrams and Entity Relationship Diagrams (ERD)

DATABASE INTRODUCTION

CA IDMS. Database Design Guide. Release , 2nd Edition

XV. The Entity-Relationship Model

EXTENDED LEARNING MODULE A

7.1 The Information system

Data Modeling Basics

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

Database Management. Technology Briefing. Modern organizations are said to be drowning in data but starving for information p.

Foundations of Business Intelligence: Databases and Information Management

Lecture Notes INFORMATION RESOURCES

ISM 318: Database Systems. Objectives. Database. Dr. Hamid R. Nemati


Conceptual Design: Entity Relationship Models. Objectives. Overview

Chapter 7: Software Engineering

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

Chapter 5 Foundations of Business Intelligence: Databases and Information Management

RELATIONAL DATABASE DESIGN. Basic Concepts

Designing a Database Schema

Database Design Methodologies

5.5 Copyright 2011 Pearson Education, Inc. publishing as Prentice Hall. Figure 5-2

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

Relational Database Concepts

The Entity-Relationship Model

IV. The (Extended) Entity-Relationship Model

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

DATA MODELING AND RELATIONAL DATABASE DESIGN IN ARCHAEOLOGY

three Entity-Relationship Modeling chapter OVERVIEW CHAPTER

s от Systems Analysis and Design

How To Write A Diagram

Foundations of Information Management

Chapter 10 Practical Database Design Methodology and Use of UML Diagrams

Practical Database Design

Lecture 12: Entity Relationship Modelling

Fundamentals of Database Design

DATABASE MANAGEMENT SYSTEMS. Question Bank:

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

Database Design Process. Databases - Entity-Relationship Modelling. Requirements Analysis. Database Design

SOFTWARE ENGINEERING IT 0301 Semester V B.Nithya,G.Lakshmi Priya Asst Professor SRM University, Kattankulathur. School of Computing, Department of IT

- Eliminating redundant data - Ensuring data dependencies makes sense. ie:- data is stored logically

Relational Schema Design

Benefits of Normalisation in a Data Base - Part 1

Higher Computing Science Course Assessment Specification (C716 76)

The Entity-Relationship Model

Technology in Action. Alan Evans Kendall Martin Mary Anne Poatsy. Eleventh Edition. Copyright 2015 Pearson Education, Inc.

Developing Entity Relationship Diagrams (ERDs)

LECTURE 11: PROCESS MODELING

1. Process Modeling. Process Modeling (Cont.) Content. Chapter 7 Structuring System Process Requirements

Ken Goldberg Database Lab Notes. There are three types of relationships: One-to-One (1:1) One-to-Many (1:N) Many-to-Many (M:N).

Overview. Physical Database Design. Modern Database Management McFadden/Hoffer Chapter 7. Database Management Systems Ramakrishnan Chapter 16

MODULE 8 LOGICAL DATABASE DESIGN. Contents. 2. LEARNING UNIT 1 Entity-relationship(E-R) modelling of data elements of an application.

A Project Based Approach for Teaching System Analysis, Design, and Implementation Courses

C H A P T E R 1 Introducing Data Relationships, Techniques for Data Manipulation, and Access Methods

Release: 1. ICADBS502A Design a database

Student Attendance Through Mobile Devices

Expository Reading and Writing By Grade Level

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

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

6-1. Process Modeling

Entity / Activity Table for Causeway Cash Receipts System

2. Conceptual Modeling using the Entity-Relationship Model

Transcription:

ENTITY RELATIONSHIP DIAGRAM M. Rasti-Barzoki Website:

Entity Relationship Diagrams for Data Modelling An Entity-Relationship Diagram () shows how the data that flows in the system is organised and used. 2

Entity Relationship Diagrams for Data Modelling The elements of an are the following: Entity Attributes Relationships associations between entities. 3

Relationships Management Information Systems Entity Relationship Diagrams for Data Modelling A one-to-one relationship (1:1). A one-to-many (1:N). A many-to-many (M:N). 4

a) Relationship type Management Information Systems Relationship types and instances 5

b) Relationship instances Management Information Systems Relationship types and instances 6

Types of entity relationships and example of their representation: 7

Examples 8

Cardinalities 9

Examples A patient history is recorded for one and only one patient A patient must have recorded at least one history, and can have many 10

Examples A project must be assigned to at least one employee, and may be assigned to many An employee can be assigned to any number of projects, or may not be assigned to any at all 11

Examples 12

Examples 13

Database Models A database model is a collection of logical constructs used to represent the data structure and the data relationships found within the database. Two Categories of Database Models Conceptual models focus on the logical nature of the data representation. They are concerned with what is represented rather than how it is represented. Implementation models place the emphasis on how the data are represented in the database or on how the data structures are implemented. 14

Like constructing DFDs and data dictionaries, the construction of s is an iterative and evolutionary process that requires refinement as a better understanding of the system to be developed is achieved. 1. Identify entities use DFDs to identify multiple instance entities. 2. Add attributes requires detailed analysis and perhaps use of requirements gathering techniques. 3. Assign identifiers or Primary keys Each entity type must have an attribute or set of attributes that distinguishes one instance from other instances of the same type. 4. Foreign Keys - The attributes of a foreign key in one entity are the attributes of a primary key in another entity. 5. Identify Relationships Steps to Construct 15

Example: Create a logical data model (based on an ) for the University Registration System. 1. Identify Entities Steps to Construct 16

Steps to Construct 2. Add Attributes 17

Steps to Construct 3. Assign Identifiers 18

Steps to Construct 4. Identify Relationships 19

Three Types of Relationships One-to-one relationships (1:1) Each store is managed by a single employee and each store manager (employee) only manages a single store. EMPLOYEE (1) manages STORE (1) One-to-many relationships (1:M) A painter paints many different paintings, but each one of them is painted by only that painter. PAINTER (1) paints PAINTING (M) Many-to-many relationships (M:N) An employee might learn many job skills, and each job skill might be learned by many employees. EMPLOYEE (M) learns SKILL (N) 20

Entity Relationship Diagrams for Data Modelling Implement One-to-One Relationships In a relational database, one-to-one relationships between entities can be implemented by merging the two tables/entities together. Implement One-to-Many Relationships Place the primary key of the entity that can occur only once as a foreign key in the entity that can occur many times. Implement Many-to-Many Relationships In a relational database, many-to-many relationships between entities can be implemented by creating a new entity that links the other two entities together. In most cases, the primary key of the new entity consists of the primary keys of the entities that it is relating together. Spit it into two one-to-many relationships! 21

Transforming to Tables Applying these rules ensures all relationships simplify to 1:N 1:1 - Relationships merge into one table. One entity becomes an attribute of the other 1:N - Add primary key from the one entity as a foreign key in the many entity N:M - Add intersection table which includes primary keys from both tables 22

Multiple Relationships 1 N N M Faculty Teaches Course Enrolls Student 23

Many-to-Many Relationship (N:M) Student N Enrolls M Course Joe MGS 351 Sally MGA 201 Tom Jean MGQ 301 MGF 301 MGB 301 24

Transforming to Tables N:M Detailed Steps 1. Add intersection table 2. Flip relationship lines around so many side faces the intersection table 3. Add primary keys from original tables as fields in the intersection table 4. Assign a name the intersection table 5. Add other relevant fields to intersection table if necessary 25

Transforming to Tables N:M (Before) M:N - Add intersection table which includes primary keys from both tables Student N Enrolls M Course Person # Course # 26

Transforming to Tables N:M (After) Add intersection table Student Course Person # Course # 27

Transforming to Tables N:M (After) Flip relationship lines around so many side faces the intersection table Student 1 N N 1 Course Person # Course # 28

Transforming to Tables N:M (After) Add primary keys from original tables as foreign key fields in the intersection table Student 1 N N 1 Course Person # Course # Person # Course # 29

Transforming to Tables N:M (After) Assign a name the intersection table Student 1 N N 1 Registration Course Person # Course # Person # Course # 30

Transforming to Tables N:M (After) Add other relevant fields to intersection table if necessary Student 1 N N 1 Registration Course Grade Person # Course # Person # Course # 31

What should be used as Primary Key in the intersection table? Composite Primary Key or Auto-number Student 1 N N 1 Registration Course Grade Person # Course # Person # Course # 32

Steps to Construct Important guidelines when creating s: Use consistent labels and names Avoid unnecessary attributes Break-down the model if needed Determine cardinality correctly 33

Validation of Entity Relationship Diagrams The DFD and are balanced when: There is a one-to-one correspondence between data stores in the DFD and entities in the. Data flows in the DFD are made of data elements corresponding to attributes in the. 34

35