0% found this document useful (0 votes)
35 views

Entity Relationship (ER) Modeling

This document discusses entity relationship (ER) modeling and how it forms the conceptual basis for an entity relationship diagram (ERD). It describes the main components of an ERD, including entities, attributes, relationships, and how they are depicted. It covers various relationship types such as one-to-many, many-to-many, weak/strong, and recursive relationships. It also discusses how to resolve issues like multivalued attributes and convert many-to-many relationships to one-to-many relationships using composite or bridge entities. The goal is to use ER modeling to design databases at the conceptual level before implementation.

Uploaded by

jnax101
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views

Entity Relationship (ER) Modeling

This document discusses entity relationship (ER) modeling and how it forms the conceptual basis for an entity relationship diagram (ERD). It describes the main components of an ERD, including entities, attributes, relationships, and how they are depicted. It covers various relationship types such as one-to-many, many-to-many, weak/strong, and recursive relationships. It also discusses how to resolve issues like multivalued attributes and convert many-to-many relationships to one-to-many relationships using composite or bridge entities. The goal is to use ER modeling to design databases at the conceptual level before implementation.

Uploaded by

jnax101
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 62

4

1
Chapter 4
Entity Relationship (ER) Modeling

Database Systems:
Design, Implementation, and Management,
Sixth Edition, Rob and Coronel
4
2 Database Systems: Design, Implementation, & Management, 6
th
Edition, Rob & Coronel
In this chapter, you will learn:
How relationships between entities are
defined and refined, and how such
relationships are incorporated into the
database design process
How ERD components affect database
design and implementation
How to interpret the modeling symbols for the
four most popular ER modeling tools
That real-world database design often
requires that you reconcile conflicting goals

4
3 Database Systems: Design, Implementation, & Management, 6
th
Edition, Rob & Coronel
The Entity Relationship (ER) Model
ER model forms the basis of an ER diagram
ERD represents the conceptual database as
viewed by end user
ERDs depict the ER models three main
components:
Entities
Attributes
Relationships

4
4 Database Systems: Design, Implementation, & Management, 6
th
Edition, Rob & Coronel
Entities
Refers to the entity set and not to a single
entity occurrence
Corresponds to a table and not to a row in the
relational environment
In both the Chen and Crows Foot models, an
entity is represented by a rectangle
containing the entitys name
Entity name, a noun, is usually written in
capital letters

4
5 Database Systems: Design, Implementation, & Management, 6
th
Edition, Rob & Coronel
Attributes
Characteristics of entities
In Chen model, attributes are represented by
ovals and are connected to the entity
rectangle with a line
Each oval contains the name of the attribute it
represents
In the Crows Foot model, the attributes are
simply written in the attribute box below the
entity rectangle

4
6 Database Systems: Design, Implementation, & Management, 6
th
Edition, Rob & Coronel
The Attributes of the STUDENT Entity
4
7 Database Systems: Design, Implementation, & Management, 6
th
Edition, Rob & Coronel
Domains
Attributes have a domain:
The attributes set of possible values
Attributes may share a domain


4
8 Database Systems: Design, Implementation, & Management, 6
th
Edition, Rob & Coronel
Primary Keys
Underlined in the ER diagram
Key attributes are also underlined in
frequently used table structure shorthand
Ideally composed of only a single attribute
Possible to use a composite key:
Primary key composed of more than one
attribute

4
9 Database Systems: Design, Implementation, & Management, 6
th
Edition, Rob & Coronel
The CLASS Table (Entity)
Components and Contents
4
10 Database Systems: Design, Implementation, & Management, 6
th
Edition, Rob & Coronel
Attributes
Composite attribute
Simple attribute
Single-value attribute
Multivalued attributes




4
11 Database Systems: Design, Implementation, & Management, 6
th
Edition, Rob & Coronel
A Multivalued Attribute in an Entity
4
12 Database Systems: Design, Implementation, & Management, 6
th
Edition, Rob & Coronel
Resolving Multivalued Attribute Problems
Although the conceptual model can handle
multivalued attributes, you should not
implement them in the relational DBMS
Within original entity, create several new
attributes, one for each of the original
multivalued attributes components
Can lead to major structural problems in the table
Create a new entity composed of original
multivalued attributes components


4
13 Database Systems: Design, Implementation, & Management, 6
th
Edition, Rob & Coronel
Splitting the Multivalued
Attribute into New Attributes
4
14 Database Systems: Design, Implementation, & Management, 6
th
Edition, Rob & Coronel
Components of the Multivalued Attribute
4
15 Database Systems: Design, Implementation, & Management, 6
th
Edition, Rob & Coronel
A New Entity Set Composed of a
Multivalued Attributes Components
4
16 Database Systems: Design, Implementation, & Management, 6
th
Edition, Rob & Coronel
Derived Attributes
Attribute whose value may be calculated
(derived) from other attributes
Need not be physically stored within the
database
Can be derived by using an algorithm

4
17 Database Systems: Design, Implementation, & Management, 6
th
Edition, Rob & Coronel
Depiction of a Derived Attribute
4
18 Database Systems: Design, Implementation, & Management, 6
th
Edition, Rob & Coronel
Relationships
Association between entities
Participants:
Entities that participate in a relationship
Relationships between entities always
operate in both directions
Relationship can be classified as 1:M
Relationship classification is difficult to
establish if you only know one side

4
19 Database Systems: Design, Implementation, & Management, 6
th
Edition, Rob & Coronel
Connectivity and Cardinality
Connectivity
Used to describe the relationship classification
Cardinality
Expresses the specific number of entity
occurrences associated with one occurrence
of the related entity
Established by very concise statements
known as business rules



4
20 Database Systems: Design, Implementation, & Management, 6
th
Edition, Rob & Coronel
Connectivity and Cardinality in an ERD
4
21 Database Systems: Design, Implementation, & Management, 6
th
Edition, Rob & Coronel
RELATIONSHIP Strength
Existence dependence
Entitys existence depends on the existence of
one or more other entities
Existence independence
Entity can exist apart from one or more related
entities
Weak (non-identifying) relationships
One entity is not existence-independent on
another entity
Strong (Identifying) Relationships
Related entities are existence-dependent



4
22 Database Systems: Design, Implementation, & Management, 6
th
Edition, Rob & Coronel
A Weak (Non-Identifying) Relationship
Between COURSE and CLASS
4
23 Database Systems: Design, Implementation, & Management, 6
th
Edition, Rob & Coronel
A Weak Relationship
Between COURSE and CLASS
4
24 Database Systems: Design, Implementation, & Management, 6
th
Edition, Rob & Coronel
Relationship Participation
Optional:
One entity occurrence does not require a
corresponding entity occurrence in a particular
relationship
Mandatory:
One entity occurrence requires a
corresponding entity occurrence in a particular
relationship


4
25 Database Systems: Design, Implementation, & Management, 6
th
Edition, Rob & Coronel
A Strong (Identifying) Relationship
Between COURSE and CLASS
4
26 Database Systems: Design, Implementation, & Management, 6
th
Edition, Rob & Coronel
An Optional CLASS Entity in the Relationship
PROFESSOR teaches CLASS
4
27 Database Systems: Design, Implementation, & Management, 6
th
Edition, Rob & Coronel
COURSE and CLASS
in a Mandatory Relationship
4
28 Database Systems: Design, Implementation, & Management, 6
th
Edition, Rob & Coronel
Relationship Strength and Weak Entities
Weak entity meets two conditions
Existence-dependent:
Cannot exist without entity with which it has a
relationship
Has primary key that is partially or totally
derived from the parent entity in the
relationship
Database designer usually determines
whether an entity can be described as weak
based on the business rules


4
29 Database Systems: Design, Implementation, & Management, 6
th
Edition, Rob & Coronel
A Weak Entity in an ERD
4
30 Database Systems: Design, Implementation, & Management, 6
th
Edition, Rob & Coronel
A Weak Entity in a Strong Relationship
4
31 Database Systems: Design, Implementation, & Management, 6
th
Edition, Rob & Coronel
Relationship Degree
Indicates number of associated entities or
participants
Unary relationship
Association is maintained within a single entity
Binary relationship
Two entities are associated
Ternary relationship
Three entities are associated


4
32 Database Systems: Design, Implementation, & Management, 6
th
Edition, Rob & Coronel
Three Types of Relationships
4
33 Database Systems: Design, Implementation, & Management, 6
th
Edition, Rob & Coronel
The Implementation
of a Ternary Relationship
4
34 Database Systems: Design, Implementation, & Management, 6
th
Edition, Rob & Coronel
Recursive Relationships
Relationship can exist between occurrences
of the same entity set
Naturally found within a unary relationship

4
35 Database Systems: Design, Implementation, & Management, 6
th
Edition, Rob & Coronel
An ER Representation
of Recursive Relationships
4
36 Database Systems: Design, Implementation, & Management, 6
th
Edition, Rob & Coronel
The 1:1 Recursive Relationship
EMPLOYEE is Married to EMPLOYEE
4
37 Database Systems: Design, Implementation, & Management, 6
th
Edition, Rob & Coronel
Implementation of the M:N Recursive
PART Contains PART Relationship
4
38 Database Systems: Design, Implementation, & Management, 6
th
Edition, Rob & Coronel
Implementation of the 1:M EMPLOYEE
Manages EMPLOYEE Recursive Relationship
4
39 Database Systems: Design, Implementation, & Management, 6
th
Edition, Rob & Coronel
Composite Entities
Also known as bridge entities
Composed of the primary keys of each of the
entities to be connected
May also contain additional attributes that
play no role in the connective process


4
40 Database Systems: Design, Implementation, & Management, 6
th
Edition, Rob & Coronel
Converting the M:N Relationship
into Two 1:M Relationships
4
41 Database Systems: Design, Implementation, & Management, 6
th
Edition, Rob & Coronel
The M:N Relationship
Between STUDENT and CLASS
4
42 Database Systems: Design, Implementation, & Management, 6
th
Edition, Rob & Coronel
A Composite Entity in an ERD
4
43 Database Systems: Design, Implementation, & Management, 6
th
Edition, Rob & Coronel
Entity Supertypes and Subtypes
Generalization hierarchy
Depicts a relationship between a higher-level
supertype entity and a lower-level subtype
entity
Supertype entity
Contains shared attributes
Subtype entity
Contains unique attributes

4
44 Database Systems: Design, Implementation, & Management, 6
th
Edition, Rob & Coronel
Nulls Created by Unique Attributes
4
45 Database Systems: Design, Implementation, & Management, 6
th
Edition, Rob & Coronel
A Generalization Hierarchy
4
46 Database Systems: Design, Implementation, & Management, 6
th
Edition, Rob & Coronel
Disjoint Subtypes
Also known as non-overlapping subtypes
Subtypes that contain a subset of the
supertype entity set
Each entity instance (row) of the supertype
can appear in only one of the disjoint subtypes
Supertype and its subtype(s) maintain a 1:1
relationship


4
47 Database Systems: Design, Implementation, & Management, 6
th
Edition, Rob & Coronel
The EMPLOYEE/PILOT
Supertype/Subtype Relationship
4
48 Database Systems: Design, Implementation, & Management, 6
th
Edition, Rob & Coronel
A Generalization Hierarchy
with Overlapping Subtypes
4
49 Database Systems: Design, Implementation, & Management, 6
th
Edition, Rob & Coronel
A Comparison of ER Modeling Symbols
4
50 Database Systems: Design, Implementation, & Management, 6
th
Edition, Rob & Coronel
The Chen Representation
of the Invoicing Problem
4
51 Database Systems: Design, Implementation, & Management, 6
th
Edition, Rob & Coronel
The Crows Foot Representation
of the Invoicing Problem
4
52 Database Systems: Design, Implementation, & Management, 6
th
Edition, Rob & Coronel
The Rein85 Representation
of the Invoicing Problem
4
53 Database Systems: Design, Implementation, & Management, 6
th
Edition, Rob & Coronel
The IDEF1X Representation
of the Invoicing Problem
4
54 Database Systems: Design, Implementation, & Management, 6
th
Edition, Rob & Coronel
Developing an ER Diagram
Database design is an iterative rather than a
linear or sequential process
Iterative process
Based on repetition of processes and
procedures

4
55 Database Systems: Design, Implementation, & Management, 6
th
Edition, Rob & Coronel
A Supertype/Subtype Relationship
4
56 Database Systems: Design, Implementation, & Management, 6
th
Edition, Rob & Coronel
A Supertype/Subtype Relationship
in an ERD
4
57 Database Systems: Design, Implementation, & Management, 6
th
Edition, Rob & Coronel
Components of the ER Model
4
58 Database Systems: Design, Implementation, & Management, 6
th
Edition, Rob & Coronel
The Completed Tiny College ERD
4
59 Database Systems: Design, Implementation, & Management, 6
th
Edition, Rob & Coronel
The Challenge of Database Design:
Conflicting Goals
Database design must conform to design
standards
High processing speeds are often a top
priority in database design
Quest for timely information might be the
focus of database design

4
60 Database Systems: Design, Implementation, & Management, 6
th
Edition, Rob & Coronel
Various Implementations
of a 1:1 Recursive Relationship
4
61 Database Systems: Design, Implementation, & Management, 6
th
Edition, Rob & Coronel
Summary
Entity relationship (ER) model
Uses ER diagrams to represent conceptual
database as viewed by the end user
Three main components
Entities
Relationships
Attributes
Includes connectivity and cardinality notations
Connectivities and cardinalities are based on
business rules

4
62 Database Systems: Design, Implementation, & Management, 6
th
Edition, Rob & Coronel
Summary (continued)
ER symbols are used to graphically depict the
ER models components and relationships
ERDs may be based on many different ER
models
Entities can also be classified as supertypes
and subtypes within a generalization
hierarchy
Database designers are often forced to make
design compromises

You might also like