Entity-Relationship (ER) Model



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

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

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

Chapter 2: Entity-Relationship Model

Foundations of Information Management

Lesson 8: Introduction to Databases E-R Data Modeling

Foundations of Information Management

ER modelling, Weak Entities, Class Hierarchies, Aggregation

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

BİL 354 Veritabanı Sistemleri. Entity-Relationship Model

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

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

2. Conceptual Modeling using the Entity-Relationship Model

Entity Relationship Diagram

Entity-Relationship Model

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

Database Management Systems

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

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

three Entity-Relationship Modeling chapter OVERVIEW CHAPTER

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

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

Lecture 12: Entity Relationship Modelling

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

Data Analysis 1. SET08104 Database Systems. Napier University

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

Database Design Process

OVERVIEW 1.1 DATABASE MANAGEMENT SYSTEM (DBMS) DEFINITION:-

Database Design Process

7.1 The Information system

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

SCHEMAS AND STATE OF THE DATABASE

Conceptual Design: Entity Relationship Models. Objectives. Overview

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

The Entity-Relationship Model

XV. The Entity-Relationship Model

IV. The (Extended) Entity-Relationship Model

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

Entity-Relationship Model. Purpose of E/R Model. Entity Sets

CSC 742 Database Management Systems

A Comparative Analysis of Entity-Relationship Diagrams 1

Exercise 1: Relational Model

Entity - Relationship Modelling

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

Data Modelling and E-R Diagrams

Designing a Database Schema

Modern Systems Analysis and Design

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

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

Database Fundamentals: 1

1 Class Diagrams and Entity Relationship Diagrams (ERD)

Developing Entity Relationship Diagrams (ERDs)

ComponentNo. C_Description UnitOfMeasure. C_Quantity

The Entity-Relationship Model

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

An Example: Video Rental System

DIA Creating Charts and Diagrams

An analysis of structural validity in entity-relationship modeling

Uses Crows feet notation for ER Diagrams in ERwin

Boyce-Codd Normal Form

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

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).

Data Modeling. Database Systems: The Complete Book Ch ,

DATABASE MANAGEMENT SYSTEMS. Question Bank:

Topic: Relationships in ER Diagram and Relationships in MS Access

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


ER & EER to Relational Mapping. Chapter 9 1

Data Modeling with Entity-Relationship Diagrams

Relational Database Concepts

Information Systems Analysis and Design CSC John Mylopoulos Database Design Information Systems Analysis and Design CSC340

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

Review Entity-Relationship Diagrams and the Relational Model. Data Models. Review. Why Study the Relational Model? Steps in Database Design

The Entity-Relationship Model

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

Conceptual Design Using the Entity-Relationship (ER) Model

The Semantics of Reifying N-ary Relationships as Classes

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

DATABASE INTRODUCTION

Relational Schema Design

Review: Participation Constraints

Lecture Notes INFORMATION RESOURCES

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

Entity/Relationship Modelling. Database Systems Lecture 4 Natasha Alechina

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

CS 4604: Introduc0on to Database Management Systems. B. Aditya Prakash Lecture #5: En-ty/Rela-onal Models- - - Part 1

Database Design and the E-R Model

Database Design Methodologies

Collated Food Requirements. Received orders. Resolved orders. 4 Check for discrepancies * Unmatched orders

Data Modeling Basics

AS LEVEL Computer Application Databases

Lecture 6. SQL, Logical DB Design

GEOL 452/552 - GIS for Geoscientists I. Lecture 9

Databases What the Specification Says

Information Management

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

COMPUTING PRACTICES ASlMPLE GUIDE TO FIVE NORMAL FORMS IN RELATIONAL DATABASE THEORY

Transcription:

ER Design (1)

Entity-Relationship (ER) Model Elements in a database: data entries Data entries represent Entities: data objects, e.g., students, courses, and instructors Relationships among entities: students take courses, instructors teach courses ER model: modeling data using entities and relationships CMPT 354: Database I -- ER Design (1) 2

E-R Diagrams Rectangles represent entity sets Diamonds represent relationship sets Lines link attributes to entity sets and entity sets to relationship sets Ellipses represent attributes Double ellipses represent multivalued attributes Dashed ellipses denote derived attributes Underline indicates primary key attributes CMPT 354: Database I -- ER Design (1) 3

Example CMPT 354: Database I -- ER Design (1) 4

Involving One Entity Set Twice Ann and Bob are employees in SmallCompany Two entities in entity set employee Ann is Bob s supervisor (Ann, Bob) supervision Relationship set supervision involves entity set employee twice How can we call the first employee and the second employee in a supervision relationship? CMPT 354: Database I -- ER Design (1) 5

Roles The labels manager and worker are called roles; they specify how employee entities interact via the works_for relationship set Role labels are optional, and are used to clarify semantics of the relationship CMPT 354: Database I -- ER Design (1) 6

Keys and Mapping Cardinality One to one relationship set Use a candidate key in either entity set University-president(university, president) Many to one relationship set Use a candidate key in the one side entity set Teaching (instructor, courses) Many to many relationship set Use a candidate key in each participating entity set Take-course(student, course) How to annotate cardinality constraints in ER diagram? CMPT 354: Database I -- ER Design (1) 7

Cardinality Constraints Drawing either a directed line ( ), signifying one, or an undirected line ( ), signifying many, between the relationship set and the entity set. One-to-one relationship Each customer can have at most one loan Each loan is associated with at most one customer CMPT 354: Database I -- ER Design (1) 8

One-To-Many Relationship In the one-to-many relationship a loan is associated with at most one customer via borrower, a customer is associated with several (including 0) loans via borrower CMPT 354: Database I -- ER Design (1) 9

Many-To-One Relationships In a many-to-one relationship a loan is associated with several (including 0) customers via borrower, a customer is associated with at most one loan via borrower CMPT 354: Database I -- ER Design (1) 10

Many-To-Many Relationship A customer is associated with several (possibly 0) loans via borrower A loan is associated with several (possibly 0) customers via borrower CMPT 354: Database I -- ER Design (1) 11

Participation of an Entity Set Total participation (indicated by double line): every entity in the entity set participates in at least one relationship in the relationship set E.g., participation of loan in borrower is total: every loan must have a customer associated to it via borrower Partial participation: some entities may not participate in any relationship in the relationship set Example: participation of customer in borrower is partial CMPT 354: Database I -- ER Design (1) 12

Entity Sets or Attributes The structure of the enterprise being modeled The semantics associated with the attribute in question CMPT 354: Database I -- ER Design (1) 13

Entity Sets or Relationship Sets Designate a relationship set to describe an action that occurs between entities CMPT 354: Database I -- ER Design (1) 14

A Ternary Relationship CMPT 354: Database I -- ER Design (1) 15

A Cardinality Constraints B C At most one arrow out of a ternary (or greater degree) relationship to indicate a cardinality constraint An arrow from works_on to job indicates each employee works on at most one job at any branch Confusion with more than one arrow Each A entity is associated with a unique entity from B and C (i.e., a combination of B and C), or Each pair of entities from (A, B) is associated with a unique C entity, and each pair (A, C) is associated with a unique B CMPT 354: Database I -- ER Design (1) 16

Binary vs. Non-Binary Relationships Some non-binary relationships may be better represented using binary relationships E.g. A ternary relationship parents, relating a child to his/her father and mother, is best replaced by two binary relationships, father and mother Using two binary relationships allows partial information (e.g. only mother being know) But there are some relationships that are naturally non-binary, e.g., works_on CMPT 354: Database I -- ER Design (1) 17

Converting Non-Binary Relationships A non-binary relationship can be represented using binary relationships by creating an artificial entity set Replace R between entity sets A, B and C by an entity set E, and three relationship sets: CMPT 354: Database I -- ER Design (1) 18

Summary Roles Cardinality constraints Participation Choice of entity sets attributes, or relationship sets Binary and non-binary relationships CMPT 354: Database I -- ER Design (1) 19

To-Do-List Can you think about some situations where the facilities of ER design we have so far are still insufficient to model the application data? CMPT 354: Database I -- ER Design (1) 20