Beruflich Dokumente
Kultur Dokumente
ER Diagrams- Notation
Relationships of Higher Degree
Extended Entity-Relationship (EER) Model
Notation is based on :
R. Elmasri and S.B. Navathe, Fundamentals of Database Systems, Ed. 3., Addison Wesley,
2000, Chapters 3.4.
Chapter 3-3
SUMMARY OF ER-DIAGRAM
NOTATION
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
E2
(min,max)
TOTAL PARTICIPATION OF E2 IN R
CARDINALITY RATIO 1:N FOR E1:E2 IN R
Chapter 3-4
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 and Navathe, Fundamentals of Database Systems, Fourth Edition
Copyright 2004 Elmasri and Navathe.
Chapter 3-5
Chapter 3-6
Chapter 3-7
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
Elmasri and Navathe, Fundamentals of Database Systems, Fourth Edition
Copyright 2004 Elmasri and Navathe.
Chapter 3-8
Types of Attributes
Simple: Each entity has a single atomic value for the attribute; for
example SSN or Sex
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}.
In general, composite and multi-valued attributes may be nested
arbitrarily to any number of levels although this is rare. For example,
PreviousDegrees of a STUDENT is a composite multi-valued attribute
denoted by {PreviousDegrees(College, Year, Degree, Field)}.
Chapter 3-9
Chapter 3-10
.
.
.
Elmasri and Navathe, Fundamentals of Database Systems, Fourth Edition
Copyright 2004 Elmasri and Navathe.
Chapter 3-11
Chapter 3-12
Chapter 3-13
ER Model Concept
Entity Type- a grouping of
member entities
Relationship Type - a
grouping of member
relationships
Aggregation
Relationship Type is an
Identification
Generalization
Chapter 3-14
Constraints on Aggregation
Cardinality Constraints on Relationship Types
( Also known as ratio constraints )
Maximum Cardinality
One-to-one
One-to-many
Many-to-many
Chapter 3-15
WORKS_FOR
r1
e2
r2
e3
r3
e4
r4
e5
e6
e7
DEPARTMENT
d1
d2
d3
r5
r6
r7
Elmasri and Navathe, Fundamentals of Database Systems, Fourth Edition
Copyright 2004 Elmasri and Navathe.
Chapter 3-16
MANY-TO-MANY(M:N)
RELATIONSHIP
r9
e1
r1
e2
r2
e3
r3
e4
r4
e5
e6
e7
d1
d2
d3
r5
r6
r 8 r7
Elmasri and Navathe, Fundamentals of Database Systems, Fourth Edition
Copyright 2004 Elmasri and Navathe.
Chapter 3-17
Structural Constraints
one way to express semantics
of relationships
Structural constraints on relationships:
Chapter 3-18
Chapter 3-19
(1,1)
(1,1)
(1,N)
What does it mean to put m:n:p on the three arms of the relationship?
It is essentially meaningless. The (min,max) notation looking away
from the entity is the best to use.
Elmasri and Navathe, Fundamentals of Database Systems, Fourth Edition
Copyright 2004 Elmasri and Navathe.
Chapter 3-20
Chapter 3-21
TERNARY RELATIONSHIPS
The Benjamin/Cummings Publishing Company, Inc. 1994, Elmasri/Navathe, Fundamentals of Database Systems, Second Edition
Chapter 3-22
The Benjamin/Cummings Publishing Company, Inc. 1994, Elmasri/Navathe, Fundamentals of Database Systems, Second Edition
Chapter 3-23
SUPPLY
r1
p1
r2
r3
PART
PROJECT
r4
r5
p2
r6
p3
r7
Elmasri and Navathe, Fundamentals of Database Systems, Fourth Edition
Copyright 2004 Elmasri and Navathe.
Chapter 3-24
Chapter 3-25
(1,5)
Chapter 3-26
RECURSIVE RELATIONSHIP
SUPERVISION
EMPLOYEE
WORKS_FOR
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-27
Chapter 3-28
Chapter 3-29
Chapter 3-30
METHODOLGY
lack of built-in methodology support.
poor tradeoff analysis or user-driven design preferences.
poor design verification and suggestions for improvement.
Elmasri and Navathe, Fundamentals of Database Systems, Fourth Edition
Copyright 2004 Elmasri and Navathe.
Chapter 3-31
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-32
The Benjamin/Cummings Publishing Company, Inc. 1994, Elmasri/Navathe, Fundamentals of Database Systems, Second Edition
Chapter 3-33
Chapter 3-34
Extended Entity-Relationship
(EER) Model
Incorporates Set-subset relationships
Incorporates Generalization Hierarchies
LIMITATIONS OF THE ER MODEL:
No relationship may be defined between an entity type and a
relationship type
NEXT SECTION OF THIS Presentation ILLUSTRATES HOW
THE ER MODEL CAN BE EXTENDED WITH
- Set-subset relationships and Generalization Hierarchies and
how we can impose further notation on them.
Chapter 3-35