0% found this document useful (0 votes)
22 views36 pages

07 Enhanced ERD

Uploaded by

MANI 96 FF
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views36 pages

07 Enhanced ERD

Uploaded by

MANI 96 FF
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 36

Database Systems

Enhanced ER-Model

Dr. Maqbool Khan

1 www.pktutorials.com
Enhanced Entity-Relationship Model:

▪ Since 1980s there has been an increase in emergence of new


database applications with more demanding requirements.
▪ Basic concepts of ER modeling are not sufficient to represent
requirements of newer, more complex applications e.g., Computer-
Aided Design (CAD), Computer-Aided Manufacturing (CAM), GIS and
CASE tools etc.
▪ Response is development of additional ‘semantic’ modeling concepts.

2 www.pktutorials.com
Enhanced Entity-Relationship Model:

▪ The ER model supported with additional semantic concepts is


called the Enhanced Entity–Relationship (EER) model.

▪ Examples of additional concepts of the EER model, namely


specialization/generalization, aggregation, and composition.

3 www.pktutorials.com
Specialization / Generalization:
▪ Superclass
▪ An entity type that includes one or more distinct subgroupings of
its occurrences, which require to be represented in a data model
▪ Subclass
▪ A distinct subgrouping of occurrences of an entity type, which
require to be represented in a data model
▪ For example, the Staff superclass may have subclasses as Manager,
SalesPersonnel, and Secretary etc.

4 www.pktutorials.com
Specialization / Generalization:

▪ Each member of a subclass is also a member of the superclass


▪ In other words, the entity in the subclass is the same entity in
the superclass, but has a distinct role e.g. Manager/Supervisor is
also a Staff etc.
▪ The relationship between a superclass and a subclass is one-to-one
(1:1) and is called a superclass/subclass relationship.

5 www.pktutorials.com
Specialization / Generalization:

▪ Some superclasses may contain overlapping subclasses, e.g. a


member of staff who is both a Manager and a member of Sales
Personnel.

▪ Not every member of a superclass need be a member of a


subclass, e.g. members of staff without a distinct job role such as
a Manager or a member of Sales Personnel.

6 www.pktutorials.com
Specialization / Generalization:

▪ Superclasses and subclasses are used to avoid describing different


types of staff with possibly different attributes within a single entity

▪ For example, Sales Personnel may have special attributes such as


salesArea and carAllowance

▪ By using a single entity will result in a lot of nulls

▪ Similarly, some relationships are only associated with particular


types of staff (subclasses), e.g. SalesPersonnel Uses Car etc.

7 www.pktutorials.com
Specialization / Generalization:

8 www.pktutorials.com
Specialization / Generalization:
▪ There are two important reasons for introducing the concepts of
superclasses and subclasses into an ER model.
▪ Firstly, it avoids describing similar concepts more than once,
thereby saving time for the designer and making the ER diagram
more readable.
▪ Secondly, it adds more semantic information to the design in a
form that is familiar to many people e.g., the assertions that
‘Manager IS-A member of staff’ and ‘flat IS-A type of property’,
communicates significant semantic content in a concise form.

9 www.pktutorials.com
Specialization / Generalization:
▪ Attribute Inheritance
▪ An entity in a subclass represents the same ‘real world’ object
as in the superclass, and may possess subclass-specific
attributes, as well as those associated with the superclass.
▪ A subclass is an entity and so it may also have one or more
subclasses

10 www.pktutorials.com
Specialization / Generalization:
▪ Attribute Inheritance
▪ An entity and its subclasses and their subclasses, and so on, is
called a type hierarchy.
▪ Type hierarchies are known by a variety of names including:
▪ Specialization hierarchy
▪ Generalization hierarchy
▪ IS-A hierarchy

▪ A subclass with more than one superclass is called a shared


subclass (multiple inheritance).

11 www.pktutorials.com
Specialization / Generalization:
▪ Specialization
▪ The process of maximizing differences between members of an
entity by identifying their distinguishing characteristics.
▪ Specialization is a top-down approach to defining a set of
superclasses and their related subclasses.
▪ The set of subclasses is defined based on some distinguishing
characteristics of the entities in the superclass.

12 www.pktutorials.com
Specialization / Generalization:

13 www.pktutorials.com
Diagrammatic Representation:
▪ The subclasses are attached by lines to a triangle that points toward
the superclass.
▪ The label below the specialization/generalization triangle, shown as
{Optional, And}, describes the constraints on the relationship
between the superclass and its subclasses.
▪ Attributes that are specific to a given subclass are listed in the lower
section of the rectangle representing that subclass.
▪ Attributes that are common to all subclasses are listed in the lower
section of the rectangle representing the superclass.

14 www.pktutorials.com
Specialization / Generalization:
▪ Generalization
▪ The process of minimizing differences between entities by
identifying their common characteristics.
▪ Generalization is a bottom-up approach , that results in the
identification of generalized superclass from the original entity types.
▪ Identify similarities between entities, such as common attributes and
relationships.
▪ It can be viewed as the reverse process of specialization.

15 www.pktutorials.com
Specialization / Generalization:

16 www.pktutorials.com
Specialization / Generalization:

17 www.pktutorials.com
Generalization
▪ The process of extracting common features from a set of entities and creating
generalized entities from it
▪ Bottom-up approach: two or more entities are combined to form a higher-level entity if
they have some standard features
▪ Subclasses are combined to form a superclass
▪ Example:

superclass vehicle

Bottom-up
subclass car motorcycle bus approach
18
Specialization
▪ An opposite process of generalization
▪ An entity is broken down into subclasses based on some standard features (attributes)
▪ Top-down approach: Identify a subset of an entity set that shares some common
characteristics
▪ Example: a vehicle can be a truck, car or bus

superclass vehicle Top-down


approach

subclass car motorcycle bus


19
Constraints on Specialization / Generalization:
Participation constraint
▪ Determines whether every member in the superclass must
participate as a member of a subclass.
▪ May be mandatory or optional.
▪ A superclass/subclass relationship with mandatory participation
specifies that every member in the superclass must also be a
member of a subclass e.g. contract of employment.
▪ A superclass/subclass relationship with optional participation
specifies that a member of a superclass need not belong to any of its
subclasses e.g. job role.

20 www.pktutorials.com
Constraints: Specialization / Generalization:
▪ Disjoint constraint
▪ Describes the relationship between members of the subclasses
and indicates whether it is possible for a member of a superclass
to be a member of one, or more than one, subclass.
▪ The disjoint constraint only applies when a superclass has more
than one subclass.
▪ If the subclasses are disjoint, then an entity occurrence can be a
member of only one of the subclasses.

21 www.pktutorials.com
Constraints: Specialization / Generalization:

▪ Disjoint constraint
▪ To represent a disjoint superclass/subclass relationship, ‘Or’ is
placed next to the participation constraint within the curly
brackets e.g., contract of employment:
specialization/generalization is disjoint, which means that a
member of staff must have a full-time permanent or a part-time
temporary contract, but not both.

22 www.pktutorials.com
Constraints: Specialization / Generalization:
▪ Disjoint constraint
▪ If subclasses of a specialization/generalization are not disjoint
(called nondisjoint), then an entity occurrence may be a member
of more than one subclass.
▪ To represent a nondisjoint superclass/subclass relationship, ‘And’
is placed next to the participation constraint within the curly
brackets.
▪ For example, the job role specialization/ generalization is
nondisjoint, which means that an entity occurrence can be a
member of both the Manager, and SalesPersonnel subclasses
(shared subclass SalesManager).
23 www.pktutorials.com
Constraints: Specialization / Generalization:

Disjoint constraint
▪ Note that it is not necessary to include the disjoint constraint
for hierarchies that have a single subclass at a given level and
for this reason only the participation constraint is shown for
the SalesManager and AssistantSecretary subclasses.

24 www.pktutorials.com
Categories: Disjoint / Participation:

▪ The disjoint and participation constraints of specialization and


generalization are distinct, giving rise to four categories:
▪ Mandatory and disjoint (Or)
▪ Optional and disjoint (Or)
▪ Mandatory and nondisjoint (And)
▪ Optional and nondisjoint (And)

25 www.pktutorials.com
Dream Home Branch View:

26 www.pktutorials.com
Dream Home Branch View:

27 www.pktutorials.com
Dream Home Branch View:

28 www.pktutorials.com
29 www.pktutorials.com
Aggregation:
▪ Represents a ‘has-a’ or ‘is-part-of’ relationship between entity types, where
one represents the ‘whole’ and the other the ‘part’
▪ A relationship represents an association between two entity types that are
conceptually at the same level
▪ One entity represents a larger entity (the ‘whole’), consisting of smaller
entities (the ‘parts’)
▪ Aggregation does not change the meaning of navigation across the
relationship between the whole and its parts, nor does it link the lifetimes of
the whole and its parts e.g. the Has relationship, which relates the Branch
entity (the ‘whole’) to the Staff entity (the ‘part’)

30 www.pktutorials.com
Aggregation:

31 www.pktutorials.com
Aggregation:

32 www.pktutorials.com
Composition:
▪ A specific form of aggregation that represents an association
between entities, where there is a strong ownership and
coincidental lifetime between the ‘whole’ and the ‘part’.
▪ The ‘whole’ is responsible for the disposition of the ‘parts’,
which means that the composition must manage the creation
and destruction of its ‘parts’.
▪ In other words, an object may only be part of one composite at
a time.

33 www.pktutorials.com
Composition:

34 www.pktutorials.com
Important:

▪ If we remember that the major aim of a data model is to


unambiguously and accurately communicate an understanding of
the enterprise data.
▪ We should only use the additional concepts of aggregation and
composition when the enterprise data is too complex to easily
represent using only the basic concepts of the ER model.

35 www.pktutorials.com
THANKS

36 3/30/2024 www.pktutorials.com

You might also like