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



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

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

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

Entity-Relationship Model

CSC 742 Database Management Systems

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

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

Data Analysis 1. SET08104 Database Systems. Napier University

Lesson 8: Introduction to Databases E-R Data Modeling

2. Conceptual Modeling using the Entity-Relationship Model

Foundations of Information Management

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

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

Lecture 12: Entity Relationship Modelling

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

Modern Systems Analysis and Design

Database Management Systems

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

three Entity-Relationship Modeling chapter OVERVIEW CHAPTER

IV. The (Extended) Entity-Relationship Model

7.1 The Information system

XV. The Entity-Relationship Model

Database Design Process

Database Design Process

Foundations of Information Management

Chapter 2: Entity-Relationship Model

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

Requirement Analysis & Conceptual Database Design. Problem analysis Entity Relationship notation Integrity constraints Generalization

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

The Entity-Relationship Model

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

The Entity-Relationship Model

Designing a Database Schema

The Entity-Relationship Model

Entity/Relationship Modelling. Database Systems Lecture 4 Natasha Alechina

SCHEMAS AND STATE OF THE DATABASE

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

Conceptual Design Using the Entity-Relationship (ER) Model

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

Databases and BigData

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

IT2305 Database Systems I (Compulsory)

Entity - Relationship Modelling

Lecture Notes INFORMATION RESOURCES

IT2304: Database Systems 1 (DBS 1)

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

Entity Relationship Diagram

How To Write A Diagram

Database Administrator [DBA]

Database Design Methodology


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

Database Design Methodology

Information Systems Modelling Information Systems I: Databases

ER & EER to Relational Mapping. Chapter 9 1

ER modelling, Weak Entities, Class Hierarchies, Aggregation

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

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

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

Database Design Methodologies

Introduction to Database Systems CS4320/CS5320. CS4320/4321: Introduction to Database Systems. CS4320/4321: Introduction to Database Systems

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

Data Modelling and E-R Diagrams

Chapter 10. Practical Database Design Methodology. The Role of Information Systems in Organizations. Practical Database Design Methodology

LOGICAL DATABASE DESIGN

CHAPTER 3: DATA MODELING USING THE ENTITY-RELATIONSHIP MODEL

Data Modeling Basics

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

Database Design. Adrienne Watt. Port Moody

OVERVIEW 1.1 DATABASE MANAGEMENT SYSTEM (DBMS) DEFINITION:-

Chapter 8 The Enhanced Entity- Relationship (EER) Model

Conceptual Design: Entity Relationship Models. Objectives. Overview

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

RELATIONSHIP STRENGTH

Chapter 10 Practical Database Design Methodology and Use of UML Diagrams

Database Fundamentals: 1

Business Definitions for Data Management Professionals

Information Management

Database System Concepts

How to Make a Domain Model. Tutorial

Fundamentals of Database Design

DATABASE INTRODUCTION

A Comparative Analysis of Entity-Relationship Diagrams 1

14 Databases. Source: Foundations of Computer Science Cengage Learning. Objectives After studying this chapter, the student should be able to:

2. Basic Relational Data Model

Chapter 10 Practical Database Design Methodology and Use of UML Diagrams

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

A Tool for Generating Relational Database Schema from EER Diagram

(Refer Slide Time 00:56)

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

Concepts of Database Management Eighth Edition. Chapter 1 Introduction to Database Management

Database Concepts. Database & Database Management System. Application examples. Application examples

Relational Database Concepts

Grocery Store Project

Unit 5: Object-Role Modeling (ORM)

Announcements. SE 1: Software Requirements Specification and Analysis. Review: Use Case Descriptions

Transcription:

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

2 LECTURE OUTLINE Using High-Level, Conceptual Data Models for Database Design Entity-Relationship (ER) model Popular high-level conceptual data model ER diagrams Diagrammatic notation associated with the ER model

3 STEPS IN DATABASE DESIGN Requirements collection and analysis DB designers interview prospective DB users to understand and document data requirements Data requirements Functional requirements of the principal applications Conceptual or logical DB design Description of data requirements Detailed descriptions of components and constraints Transformed into implementation data model Result: DB schema in implementation data model of DBMS Physical DB design Internal storage structures, file organizations, indexes, access paths, and physical design parameters for the DB files External or view design

4 A SAMPLE DATABASE APPLICATION Requirements gathered for COMPANY Employees, departments, and projects Company is organized into departments Department controls several projects Employee: require each employee s name, Social Security number, address, salary, sex (gender), and birth date Keep track of the dependents of each employee

5 ER MODEL OVERVIEW ER model describes data in terms of: Entities and entity sets Objects Relationships and relationship sets Connections between objects Attributes Properties that characterize or describe entities or relationships

ENTITIES AND ATTRIBUTES EXAMPLE 6

7 ENTITY SETS Entity type or set Collection (or set) of similar entities that have the same attributes ER model defines entity sets, not individual entities But entity sets described in terms of their attributes

8 CATEGORIES OF ATTRIBUTES Simple (atomic) vs. composite attributes Single-valued vs. multivalued attributes Stored vs. derived attributes Key or unique attributes Attribute values constrained to be distinct for individual entities in entity set

9 INITIAL ER DIAGRAM FOR COMPANY Four entity types Most attributes are simple, single-valued, and stored Works_on and Locations are multivalued Employee s Name is composite Employee has one key, department and project have two keys, dependent has none

11 WEAK ENTITY TYPES Entity types that do not have key attributes of their own Identified by their relationship to specific entities from another entity type Dependent is meaningless in COMPANY DB independently of Employee Identifying relationship Identified by relationship to Employee Dependent_name distinguishes one dependent from other dependents for the same employee: partial key Relates a weak entity type to the identifying entity, which has the rest of the key

12 RELATIONSHIPS IN GENERAL Relationship Interaction between entities Indicator: an attribute of one entity refers to another entity Represent such references as relationships not attributes

13 RELATIONSHIPS Relationship Interaction between entities Indicator: an attribute of one entity refers to another entity Represent such references as relationships not attributes Relationship type R among n entity types E 1, E 2,..., E n Defines a set of associations among entities from these entity types Relationship instance r i Each r i associates n individual entities (e 1, e 2,..., e n ) Each entity e j in r i is a member of entity set E j Relationships uniquely identified by keys of participating entities Degree of a relationship type Number of participating entity types e.g., binary, ternary

RELATIONSHIPS & RELATIONSHIP SETS 14

15 DIAGRAMMING RELATIONSHIP TYPE Diamond for relationship type Connected to each participating entity type Could be binary, ternary, or higher degree Remember: Represents a set of entities of each type, some of which are related to entities of the other type(s) Some entities might participate in several relationships Some entities might not participate in the relationship at all

16 RELATIONSHIPS WITH REPEATED ENTITY SETS Some relationships involve multiple entities from the same entity set e.g., spouse (two persons), games (two teams) e.g., recursive relationships, such as supervises (two employees) Role name Signifies role that participating entity plays in relationship instance Required when entity type participates multiple times in a relationship

USING ROLE NAMES 17

18 RELATIONSHIP CONSTRAINTS Cardinality ratio Specifies maximum number of relationship instances in which each entity can participate Types 1:1, 1:N, or M:N Participation constraint Specifies whether existence of entity depends on its being related to another entity Types: total and partial Thus minimum number of relationship instances in which entities can participate: thus1 for total participation, 0 for partial Diagrammatically, use a double line from relationship type to entity type Alternative: Structural constraint Generalization: specifying any min and max participation Replaces cardinality ratio numerals and single/double line notation Associate a pair of integer numbers (min, max) with each participation of an entity type E in a relationship type R, where 0 min max and max 1 max=n finite, but unbounded

19 RELATIONSHIP ATTRIBUTES Relationship types can also have attributes Property that depends on both/all participating entities Example: Percentage of control that department has on a project CONTROLS Percent Attributes of 1:1 or 1:N relationship types can be migrated to one of the participating entity types For a 1:N relationship type, relationship attribute can be migrated only to entity type on N-side of relationship Attributes on M:N relationship types must be specified as relationship attributes

20 SUMMARY OF ER DIAGRAM SYMBOLS 1 E 1 entity can be related to N E 2 entities

21 REFINING EXAMPLE ER DESIGN Recall preliminary ER design Change attributes that reference entity types into relationship types Weak entities use identifying relationship Determine cardinality ratio and participation constraints for each relationship type Weak entity type always has structural constraint of (1,1) participation in identifying relationship

22

23

25 APPROPRIATE ER MODEL DESIGN Choose names that convey meanings attached to various constructs. Nouns give rise to entity type names Verbs indicate names of relationship types Choose binary relationship names to make ER diagram readable from left to right and from top to bottom Review all attributes Refine into a relationship if attribute references an entity type Attribute that exists in several entity types may be better modelled as an independent entity type Entities that must participate in a relationship with another entity type and with cardinality constraint of 1 might be better modelled as weak entity

REVIEW HIGH-DEGREE RELATIONSHIPS 26

28 LECTURE SUMMARY Components of the Entity-Relationship Model Entity Types, Entity Sets Weak Entity Types Relationship Types, Relationship Sets, Roles Attributes, Attribute Classification, Keys Structural Constraints ER diagrams represent ER models Appropriate ER design