Copyright 2011 Pearson Education, Inc.
Publishing as Pearson Addison-Wesley
Chapter 8
The Enhanced
Entity-
Relationship
(EER) Model
Copyright 2011 Ramez Elmasri and Shamkant Navathe
Chapter 8 Outline
Subclasses, Superclasses, and Inheritance
Specialization and Generalization
Constraints and Characteristics of
Specialization and Generalization
Hierarchies
Copyright 2011 Ramez Elmasri and Shamkant Navathe
The Enhanced Entity-
Relationship (EER) Model
Enhanced ER (EER) model
Created to design more accurate database
schemas
Reflect the data properties and constraints more
precisely
More complex requirements than traditional
applications
Copyright 2011 Ramez Elmasri and Shamkant Navathe
Subclasses, Superclasses, and
Inheritance
EER model includes all modeling concepts
of the ER model
In addition, EER includes:
Subclasses and superclasses
Specialization and generalization
Category or union type
Attribute and relationship inheritance
Copyright 2011 Ramez Elmasri and Shamkant Navathe
Subclasses, Superclasses, and
Inheritance (contd.)
Enhanced ER or EER diagrams
Diagrammatic technique for displaying these
concepts in an EER schema
Subtype or subclass of an entity type
Subgroupings of entities that are meaningful
An entity that belongs to a subclass represents
the same real-world entity as the entity
connected to it in the superclass
Copyright 2011 Ramez Elmasri and Shamkant Navathe
Subclasses, Superclasses, and
Inheritance (contd.)
Terms for relationship between a
superclass and any one of its subclasses
Superclass/subclass
Supertype/subtype
Class/subclass relationship
Type inheritance
Subclass entity inherits all attributes and
relationships of superclass
Copyright 2011 Ramez Elmasri and Shamkant Navathe
Subclasses, Superclasses
Relationship
Some Employees are managers
Employees are either clerical, technical,
managers
All employees are either salaried or hourly
Copyright 2011 Ramez Elmasri and Shamkant Navathe
Example of Superclass/Subclass
Relationship
Copyright 2011 Ramez Elmasri and Shamkant Navathe
Specialization and
Generalization
Specialization
Process of defining a set of subclasses of an
entity type
Defined on the basis of some distinguishing
characteristic of the entities in the superclass
Subclass can define:
Specific attributes
Specific relationship types
Copyright 2011 Ramez Elmasri and Shamkant Navathe
Why it is important
Subclasses may have different attributes
Technicians may have specialty
Hourly employee may have pay rate
and number of worked hours
Subclasses may participate in different
relationship:
Managerial employees manage
departments
Copyright 2011 Ramez Elmasri and Shamkant Navathe
Copyright 2011 Ramez Elmasri and Shamkant Navathe
Copyright 2011 Ramez Elmasri and Shamkant Navathe
Specialization and Inheritance
Manager gets all attributes of employee
Manager can participate in all relations
employee participates in
Every manager is also an employee not
vice versa
Copyright 2011 Ramez Elmasri and Shamkant Navathe
Generalization
Reverse process of abstraction
Generalize into a single superclass
Original entity types are special subclasses
Generalization
Process of defining a generalized entity type
from the given entity types
Copyright 2011 Ramez Elmasri and Shamkant Navathe
Generalization
Copyright 2011 Ramez Elmasri and Shamkant Navathe
Constraints and Characteristics
of Specialization and
Generalization Hierarchies
Constraints that apply to a single
specialization or a single generalization
Differences between specialization/
generalization lattices and hierarchies
Copyright 2011 Ramez Elmasri and Shamkant Navathe
Constraints on Specialization
and Generalization
May be several or one subclass
Determine entity subtype:
Predicate-defined (or condition-defined)
subclasses
Attribute-defined specialization
User-defined
Copyright 2011 Ramez Elmasri and Shamkant Navathe
Constraints on Specialization
and Generalization
Predicate-defined (or condition-defined)
subclasses
Attribute-defined specialization
Copyright 2011 Ramez Elmasri and Shamkant Navathe
Constraints on Specialization
and Generalization (contd.)
Disjointness constraint
Specifies that the subclasses of the
specialization must be disjoint
Completeness (or totalness) constraint
May be total or partial
Disjointness and completeness constraints
are independent
Copyright 2011 Ramez Elmasri and Shamkant Navathe
Constraints on Specialization
and Generalization (contd.)
Copyright 2011 Ramez Elmasri and Shamkant Navathe
Constraints on Specialization
and Generalization (contd.)
Copyright 2011 Ramez Elmasri and Shamkant Navathe
Constraints on Specialization
and Generalization (contd.)
Copyright 2011 Ramez Elmasri and Shamkant Navathe
Specialization and
Generalization Hierarchies
and Lattices
Specialization hierarchy
Every subclass participates as a subclass in
only one class/subclass relationship
Results in a tree structure or strict hierarchy
Specialization lattice
Subclass can be a subclass in more than one
class/subclass relationship
Copyright 2011 Ramez Elmasri and Shamkant Navathe
Copyright 2011 Ramez Elmasri and Shamkant Navathe
Specialization and
Generalization Hierarchies
and Lattices (contd.)
Multiple inheritance
Subclass with more than one superclass called
shared subclass
If attribute (or relationship) originating in the
same superclass inherited more than once via
different paths in lattice
Included only once in shared subclass
Single inheritance
Some models and languages limited to single
inheritance
Copyright 2011 Ramez Elmasri and Shamkant Navathe
Formal Definitions for the EER
Model Concepts
Class
Set or collection of entities
Includes any of the EER schema constructs of
group entities
Subclass
Class whose entities must always be a subset
of the entities in another class
Specialization
Set of subclasses that have same superclass
Copyright 2011 Ramez Elmasri and Shamkant Navathe
Formal Definitions for the EER
Model Concepts (contd.)
Generalization
Generalized entity type or superclass
Predicate-defined
Predicate on the attributes of is used to specify
which entities in C are members of S