+ All Categories
Home > Documents > LELCTURE 4: ENHANCED ENTITY-RELATIONSHIP MODELING (EER) · LELCTURE 4: ENHANCED ENTITY-RELATIONSHIP...

LELCTURE 4: ENHANCED ENTITY-RELATIONSHIP MODELING (EER) · LELCTURE 4: ENHANCED ENTITY-RELATIONSHIP...

Date post: 03-Jul-2018
Category:
Upload: vuongtu
View: 220 times
Download: 1 times
Share this document with a friend
20
LELCTURE 4: ENHANCED ENTITY-RELATIONSHIP MODELING (EER) Ref. “Chapter12” from “Database Systems: A Practical Approach to Design, Implementation and Management.” Thomas Connolly, Carolyn Begg. IS220 : Database Fundamentals
Transcript
Page 1: LELCTURE 4: ENHANCED ENTITY-RELATIONSHIP MODELING (EER) · LELCTURE 4: ENHANCED ENTITY-RELATIONSHIP MODELING ... Enhanced Entity–Relationship (EER) ... they are represented in an

LELCTURE 4:

ENHANCED ENTITY-RELATIONSHIP

MODELING (EER) Ref. “Chapter12”

from

“Database Systems: A Practical Approach to Design, Implementation and Management.”

Thomas Connolly, Carolyn Begg.

I S 2 2 0 : D at ab as e F u n d am e n t al s

Page 2: LELCTURE 4: ENHANCED ENTITY-RELATIONSHIP MODELING (EER) · LELCTURE 4: ENHANCED ENTITY-RELATIONSHIP MODELING ... Enhanced Entity–Relationship (EER) ... they are represented in an

Chapter Objectives

In this chapter you will learn:

The limitations of the basic concepts of the Entity–Relationship

(ER) model and the requirements to represent more complex

applications using additional data modeling concepts.

The most useful additional data modeling concepts of the

Enhanced Entity–Relationship (EER) model called

specialization/generalization and inheritance.

2

Page 3: LELCTURE 4: ENHANCED ENTITY-RELATIONSHIP MODELING (EER) · LELCTURE 4: ENHANCED ENTITY-RELATIONSHIP MODELING ... Enhanced Entity–Relationship (EER) ... they are represented in an

Main Terms 3

• Enhanced ER model.

• Specialization

• Generalization

• Inheritance.

• Participation constraints.

• Disjoint constraints.

Page 4: LELCTURE 4: ENHANCED ENTITY-RELATIONSHIP MODELING (EER) · LELCTURE 4: ENHANCED ENTITY-RELATIONSHIP MODELING ... Enhanced Entity–Relationship (EER) ... they are represented in an

Enhanced Entity-Relationship (EER)

Model •4

Enhanced Entity-Relationship (EER) Model is an ER model

supported with additional semantic concepts.

Semantic concepts supported:

Specialization

Generalization

Page 5: LELCTURE 4: ENHANCED ENTITY-RELATIONSHIP MODELING (EER) · LELCTURE 4: ENHANCED ENTITY-RELATIONSHIP MODELING ... Enhanced Entity–Relationship (EER) ... they are represented in an

Specialization

5

Specialization: Top-down design process; we designate

sub-groupings within an entity type that are distinctive

from other entities in the set.

Page 6: LELCTURE 4: ENHANCED ENTITY-RELATIONSHIP MODELING (EER) · LELCTURE 4: ENHANCED ENTITY-RELATIONSHIP MODELING ... Enhanced Entity–Relationship (EER) ... they are represented in an

Generalization

6

Generalization: A bottom-up design process – combine a

number of entity types that share the same features into a

higher-level (superclass) entity type.

Specialization and generalization are simple inversions of

each other; they are represented in an EER diagram in the

same way.

Page 7: LELCTURE 4: ENHANCED ENTITY-RELATIONSHIP MODELING (EER) · LELCTURE 4: ENHANCED ENTITY-RELATIONSHIP MODELING ... Enhanced Entity–Relationship (EER) ... they are represented in an

Specialization/ Generalization

7

The sub-groupings (subclasses) become lower-level entity

types that have attributes or participate in relationships

that do not apply to the higher-level entity set

(superclass).

Page 8: LELCTURE 4: ENHANCED ENTITY-RELATIONSHIP MODELING (EER) · LELCTURE 4: ENHANCED ENTITY-RELATIONSHIP MODELING ... Enhanced Entity–Relationship (EER) ... they are represented in an

Superclass/Subclass Relationship

8

STAFF

MANAGER SECRETARY SALES

PERSONNEL Subclass

Superclass

IS_A relationship

1:1

Page 9: LELCTURE 4: ENHANCED ENTITY-RELATIONSHIP MODELING (EER) · LELCTURE 4: ENHANCED ENTITY-RELATIONSHIP MODELING ... Enhanced Entity–Relationship (EER) ... they are represented in an

Inheritance

9

A subclass entity type inherits all the attributes and

relationship participation of the superclass entity type to

which it is linked.

An entity in a subclass represents the same ‘real world’ object

as in the superclass, and may possess subclass-specific

attributes, and sometimes relationships, as well as those

associated with the superclass.

Page 10: LELCTURE 4: ENHANCED ENTITY-RELATIONSHIP MODELING (EER) · LELCTURE 4: ENHANCED ENTITY-RELATIONSHIP MODELING ... Enhanced Entity–Relationship (EER) ... they are represented in an

Inheritance (cont.)

10

STAFF

SALES

PERSONNEL

Unshared

attributes

Superclass

address dob name

sales area

car allowance

shared

attributes

Subclass require CAR

Unshared

relationship

contract COMPANY

Shared

relationship

Page 11: LELCTURE 4: ENHANCED ENTITY-RELATIONSHIP MODELING (EER) · LELCTURE 4: ENHANCED ENTITY-RELATIONSHIP MODELING ... Enhanced Entity–Relationship (EER) ... they are represented in an

Constraints on

Specialization/Generalization 11

There are two constraints that may apply to a specialization/

generalization:

Participation constraint

Disjoint constraints.

Page 12: LELCTURE 4: ENHANCED ENTITY-RELATIONSHIP MODELING (EER) · LELCTURE 4: ENHANCED ENTITY-RELATIONSHIP MODELING ... Enhanced Entity–Relationship (EER) ... they are represented in an

Participation Constraints 12

Participation constraint determines whether every member in the

superclass must participate as a member of a subclass.

Two types of participation constraints:

Mandatory (total)

Optional (partial)

Page 13: LELCTURE 4: ENHANCED ENTITY-RELATIONSHIP MODELING (EER) · LELCTURE 4: ENHANCED ENTITY-RELATIONSHIP MODELING ... Enhanced Entity–Relationship (EER) ... they are represented in an

Participation Constraints (cont.)

13

Mandatory (total) participation where every member in the

superclass must also be a member of a subclass.

STAFF

FULL-TIME

STAFF

PART-TIME

STAFF salary Hourly-rate

Page 14: LELCTURE 4: ENHANCED ENTITY-RELATIONSHIP MODELING (EER) · LELCTURE 4: ENHANCED ENTITY-RELATIONSHIP MODELING ... Enhanced Entity–Relationship (EER) ... they are represented in an

Participation Constraints (cont.)

14

Optional (partial) participation where a member in the

superclass need not belong to any of its subclasses.

STAFF

MANAGER SECRETARY SALES

PERSONNEL

Page 15: LELCTURE 4: ENHANCED ENTITY-RELATIONSHIP MODELING (EER) · LELCTURE 4: ENHANCED ENTITY-RELATIONSHIP MODELING ... Enhanced Entity–Relationship (EER) ... they are represented in an

Disjoint Constraints 15

Disjoint constraint describes the relationship between members

of the subclasses & indicates whether it is possible for a member

of a subclass to be a member of one, or more than one,

subclasses.

Two types of disjoint constraints:

Disjoint

Non-Disjoint

Page 16: LELCTURE 4: ENHANCED ENTITY-RELATIONSHIP MODELING (EER) · LELCTURE 4: ENHANCED ENTITY-RELATIONSHIP MODELING ... Enhanced Entity–Relationship (EER) ... they are represented in an

Disjoint Constraints (cont.)

16

Disjoint constraint (d): when an entity can be a member of only

one of the subclasses of the specialization.

STAFF

FULL-TIME

STAFF

PART-TIME

STAFF salary Hourly-rate

d

Page 17: LELCTURE 4: ENHANCED ENTITY-RELATIONSHIP MODELING (EER) · LELCTURE 4: ENHANCED ENTITY-RELATIONSHIP MODELING ... Enhanced Entity–Relationship (EER) ... they are represented in an

Disjoint Constraints (cont.)

17

Non-disjoint constraints (o): an entity is a member of more than

one subclass of specialization. Entity types may overlap.

STAFF

MANAGER SECRETARY SALES

PERSONNEL

o

Page 18: LELCTURE 4: ENHANCED ENTITY-RELATIONSHIP MODELING (EER) · LELCTURE 4: ENHANCED ENTITY-RELATIONSHIP MODELING ... Enhanced Entity–Relationship (EER) ... they are represented in an

Summary of ER notations

18

ENTITY

WEAK ENTITY

RELATIONSHIP

IDENTIFYING

RELATIONSHIP

ATTRIBUTE

KEY ATTRIBUTE

MULTI-VALUED

COMPOSITE

DERIVED

Page 19: LELCTURE 4: ENHANCED ENTITY-RELATIONSHIP MODELING (EER) · LELCTURE 4: ENHANCED ENTITY-RELATIONSHIP MODELING ... Enhanced Entity–Relationship (EER) ... they are represented in an

Summary of ER notations (cont.)

19

CARDINALITY

CONSTRAINTS

PARTICIPATION

CONSTRAINTS

1 M

(min,max)

Page 20: LELCTURE 4: ENHANCED ENTITY-RELATIONSHIP MODELING (EER) · LELCTURE 4: ENHANCED ENTITY-RELATIONSHIP MODELING ... Enhanced Entity–Relationship (EER) ... they are represented in an

Summary of EER notations

20

Disjoint constraint d

o Non-Disjoint constraint

Total Participation

Optional Participation


Recommended