Chapter 3 ERD
Chapter 3 ERD
Chapter 3 ERD
Chapter Outline
Example Database Application (COMPANY)
ER Model Concepts
ER Diagrams - Notation
ER Diagram for COMPANY Schema
Alternative Notations UML class diagrams, others
Chapter 3-2
Example COMPANY
Database
Requirements of the Company (oversimplified for
illustrative purposes)
The company is organized into DEPARTMENTs.
Each department has a name, number and an
employee who manages the department. We keep
track of the start date of the department manager.
Each department controls a number of PROJECTs.
Each project has a name, number and is located at a
single location.
Elmasri/Navathe, Fundamentals of Database Systems, Fourth Edition
Copyright 2004 Pearson Education, Inc.
Chapter 3-3
Chapter 3-4
ER Model Concepts
Entities and Attributes
Entities are specific objects or things in the mini-world that are
represented in the database. For example the EMPLOYEE John
Smith, the Research DEPARTMENT, the ProductX PROJECT
Attributes are properties used to describe an entity. For example an
EMPLOYEE entity may have a Name, SSN, Address, Sex,
BirthDate
A specific entity will have a value for each of its attributes. For
example a specific employee entity may have Name='John Smith',
SSN='123456789', Address ='731, Fondren, Houston, TX', Sex='M',
BirthDate='09-JAN-55
Each attribute has a value set (or data type) associated with it e.g.
integer, string, subrange, enumerated type,
Chapter 3-5
Composite
The attribute may be composed of several components. For example,
Address (Apt#, House#, Street, City, State, ZipCode, Country) or
Name (FirstName, MiddleName, LastName). Composition may form
a hierarchy where some components are themselves composite.
Multi-valued
An entity may have multiple values for that attribute. For example,
Color of a CAR or PreviousDegrees of a STUDENT. Denoted as
{Color} or {PreviousDegrees}.
Chapter 3-6
Chapter 3-7
Chapter 3-8
.
.
.
Elmasri/Navathe, Fundamentals of Database Systems, Fourth Edition
Copyright 2004 Pearson Education, Inc.
Chapter 3-9
SUMMARY OF ER-DIAGRAM
NOTATION FOR ER SCHEMAS
Symbol
Meaning
ENTITY TYPE
WEAK ENTITY TYPE
RELATIONSHIP TYPE
IDENTIFYING RELATIONSHIP TYPE
ATTRIBUTE
KEY ATTRIBUTE
MULTIVALUED ATTRIBUTE
COMPOSITE ATTRIBUTE
DERIVED ATTRIBUTE
E1
E1
E2
R
R
R
N
(min,max)
E2
E
TOTAL PARTICIPATION OF E2 IN R
CARDINALITY RATIO 1:N FOR E1:E2 IN R
STRUCTURAL CONSTRAINT (min, max) ON PARTICIPATION
OF E IN R
Chapter 3-10
Chapter 3-11
Chapter 3-12
WORKS_FOR
r1
e2
r2
e3
r3
e4
r4
e5
e6
e7
DEPARTMENT
d1
d2
d3
r5
r6
r7
Elmasri/Navathe, Fundamentals of Database Systems, Fourth Edition
Copyright 2004 Pearson Education, Inc.
Chapter 3-13
r1
e2
r2
e3
r3
e4
r4
e5
e6
e7
p1
p2
p3
r5
r6
r 8 r7
Elmasri/Navathe, Fundamentals of Database Systems, Fourth Edition
Copyright 2004 Pearson Education, Inc.
Chapter 3-14
Chapter 3-15
Chapter 3-16
Chapter 3-17
Chapter 3-18
Constraints on Relationships
Constraints on Relationship Types
( Also known as ratio constraints )
Maximum Cardinality
One-to-one (1:1)
One-to-many (1:N) or Many-to-one (N:1)
Many-to-many
Chapter 3-19
WORKS_FOR
r1
e2
r2
e3
r3
e4
r4
e5
e6
e7
DEPARTMENT
d1
d2
d3
r5
r6
r7
Elmasri/Navathe, Fundamentals of Database Systems, Fourth Edition
Copyright 2004 Pearson Education, Inc.
Chapter 3-20
r1
e2
r2
e3
r3
e4
r4
e5
e6
e7
p1
p2
p3
r5
r6
r 8 r7
Elmasri/Navathe, Fundamentals of Database Systems, Fourth Edition
Copyright 2004 Pearson Education, Inc.
Chapter 3-21
Chapter 3-22
A RECURSIVE RELATIONSHIP
SUPERVISION
EMPLOYEE
SUPERVISION
2
1
e1
r1
e2
e3
e4
e5
e6
e7
2
r2
2
1
2
1
2
r3
r4
1
2
r5
r6
The Benjamin/Cummings Publishing Company, Inc. 1994, Elmasri/Navathe, Fundamentals of Database Systems, Second Edition
Chapter 3-23
Chapter 3-24
Chapter 3-25
Chapter 3-26
Structural Constraints
one way to express semantics
of relationships
Structural constraints on relationships:
Chapter 3-27
Chapter 3-28
(1,1)
(1,1)
(1,N)
Chapter 3-29
Chapter 3-30
Chapter 3-31
Chapter 3-32
METHODOLGY
lack of built-in methodology support.
poor tradeoff analysis or user-driven design preferences.
poor design verification and suggestions for improvement.
Elmasri/Navathe, Fundamentals of Database Systems, Fourth Edition
Copyright 2004 Pearson Education, Inc.
Chapter 3-33
TOOL
FUNCTIONALITY
Embarcadero
Technologies
ER Studio
DB Artisan
Oracle
Popkin Software
Platinum
Technology
Platinum Enterprice
Modeling Suite: Erwin,
BPWin, Paradigm Plus
Persistence Inc.
Pwertier
Rational
Rational Rose
Rogue Ware
RW Metro
Resolution Ltd.
Xcase
Sybase
Visio
Visio Enterprise
Chapter 3-34
The Benjamin/Cummings Publishing Company, Inc. 1994, Elmasri/Navathe, Fundamentals of Database Systems, Second Edition
Chapter 3-35
Chapter 3-36
Extended Entity-Relationship
(EER) Model
Incorporates Set-subset relationships
Incorporates Specialization/Generalization Hierarchies
NEXT CHAPTER ILLUSTRATES HOW THE ER
MODEL CAN BE EXTENDED WITH
- Set-subset relationships and
Specialization/Generalization Hierarchies and how to
display them in EER diagrams
Chapter 3-37