Professional Documents
Culture Documents
CH3 1 Er PDF
CH3 1 Er PDF
Chapter 3
Data Modeling Using the
Entity-Relationship (ER) Model
2/2/2004
Chapter Outline
z Example Database Application (COMPANY)
z ER Model Concepts
z ER Diagrams - Notation
z ER Diagram for COMPANY Schema
z Alternative Notations UML class diagrams, others
Chapter 3-3
Example COMPANY
Database
z 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.
Chapter 3-4
2/2/2004
Chapter 3-5
ER Model Concepts
z 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-6
2/2/2004
z 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.
z 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-7
Chapter 3-8
2/2/2004
Chapter 3-9
.
.
.
Elmasri/Navathe, Fundamentals of Database Systems, Fourth Edition
Chapter 3-10
2/2/2004
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)
TOTAL PARTICIPATION OF E2 IN R
E2
Chapter 3-11
Chapter 3-12
2/2/2004
Chapter 3-13
WORKS_FOR
DEPARTMENT
r1
e1
e2
e3
e4
e5
r5
e6
r6
e7
r7
r2
r3
d1
d2
d3
r4
Chapter 3-14
2/2/2004
e1
e2
e3
e4
e5
r5
e6
r6
e7
r7
r2
r3
p1
p2
p3
r4
r8
Elmasri/Navathe, Fundamentals of Database Systems, Fourth Edition
Chapter 3-15
Chapter 3-16
2/2/2004
Chapter 3-17
Chapter 3-18
2/2/2004
Chapter 3-19
Constraints on Relationships
z Constraints on Relationship Types
( Also known as ratio constraints )
Maximum Cardinality
z One-to-one (1:1)
z One-to-many (1:N) or Many-to-one (N:1)
z Many-to-many
Chapter 3-20
10
2/2/2004
WORKS_FOR
DEPARTMENT
r1
e1
e2
e3
e4
e5
r5
e6
r6
e7
r7
r2
r3
d1
d2
d3
r4
Chapter 3-21
e1
e2
e3
e4
e5
r5
e6
r6
e7
r7
r2
r3
p1
p2
p3
r4
r8
Elmasri/Navathe, Fundamentals of Database Systems, Fourth Edition
Chapter 3-22
11
2/2/2004
Chapter 3-23
A RECURSIVE RELATIONSHIP
SUPERVISION
EMPLOYEE
e1
e2
e3
e4
e5
e6
e7
SUPERVISION
r1
2
1
1
r2
r3
1
2
1
2
r4
r5
1
2
r6
The Benjamin/Cummings Publishing Company, Inc. 1994, Elmasri/Navathe, Fundamentals of Database Systems, Second Edition
Chapter 3-24
12
2/2/2004
Chapter 3-25
Chapter 3-26
13
2/2/2004
Chapter 3-27
Structural Constraints
one way to express semantics
of relationships
Structural constraints on relationships:
z
Chapter 3-28
14
2/2/2004
Chapter 3-29
(1,1)
(1,1)
(1,N)
Chapter 3-30
15
2/2/2004
Chapter 3-31
Chapter 3-32
16
2/2/2004
Chapter 3-33
z 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
Chapter 3-34
17
2/2/2004
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-35
The Benjamin/Cummings Publishing Company, Inc. 1994, Elmasri/Navathe, Fundamentals of Database Systems, Second Edition
Chapter 3-36
18
2/2/2004
Chapter 3-37
Extended Entity-Relationship
(EER) Model
z Incorporates Set-subset relationships
z 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-38
19