Data Base
Data Base
Slid
e 31
Chapter Outline
Example Database Application (COMPANY)
ER Model Concepts
Entities and Attributes
Entity Types, Value Sets, and Key Attributes
Relationships and Relationship Types
Slide
3- 2
Slide
3- 3
Slide
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
Each attribute has a value set (or data type) associated with
it e.g. integer, string, subrange, enumerated type,
Slide
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).
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}.
Slide
3- 6
Slide
3- 7
Example of a composite
attribute
Slide
3- 8
Slide
3- 9
Slide
3- 10
Slide
3- 11
Slide
3- 12
Entity Set
Each entity type will have a collection of entities stored in the
database
Called the entity set
Slide
3- 13
DEPARTMENT
PROJECT
EMPLOYEE
DEPENDENT
Slide
3- 14
Slide
3- 15
Lecture 5
Slid
e 316
Slide
3- 17
Slide
3- 18
Relationship Set:
The current set of relationship instances represented in the
database
The current state of a relationship type
Slide
3- 19
Slide
3- 20
Slide
3- 21
Slide
3- 22
ER Diagrams - Notation
ER Diagram for COMPANY Schema
Alternative Notations UML class diagrams, others
Slid
e 323
Slide
3- 24
Constraints on Relationships
Constraints on Relationship Types
(Also known as ratio constraints)
Cardinality Ratio (specifies maximum participation)
One-to-one (1:1)
One-to-many (1:N) or Many-to-one (N:1)
Many-to-many (M:N)
Slide
3- 26
Slide
3- 27
A Recursive Relationship
Supervision`
Slide
3- 29
Slide
3- 30
Lecture 6
Slid
e 331
Attributes of Relationship
types
A relationship type can have attributes:
For example, HoursPerWeek of WORKS_ON
Its value for each relationship instance describes the number of
hours per week that an EMPLOYEE works on a PROJECT.
A value of HoursPerWeek depends on a particular (employee,
project) combination
Slide
3- 32
Slide
3- 33
Slide
3- 34
Slide
3- 35
Slide
3- 36
Slide
3- 37
Alternative diagrammatic
notation
ER diagrams is one popular example for displaying database
schemas
Many other notations exist in the literature and in various
database design and modeling tools
Appendix A illustrates some of the alternative notations that
have been used
UML class diagrams is representative of another way of
displaying ER concepts that is used in several commercial
design tools
Slide
3- 38
Slide
3- 39
Chapt
er 340
METHODOLGY
lack of built-in methodology support.
poor tradeoff analysis or user-driven design preferences.
Chapt
poor design verification and suggestions for
er 341
improvement.
The Benjamin/Cummings Publishing Company, Inc. 1994, Elmasri/Navathe, Fundamentals of Database Systems, Second Edition
Chapt
er 342
Chapt
er 343
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
Chapt
and how we can impose further notation on them.
er 344