0% found this document useful (0 votes)
27 views7 pages

Lectures 2014 Handout4 DataModeling EER

Uploaded by

johnjames9950
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)
27 views7 pages

Lectures 2014 Handout4 DataModeling EER

Uploaded by

johnjames9950
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/ 7

2.

2 Enhanced-ER (EER) Model Concepts


• Includes all modeling concepts of basic ER

• Additional concepts: subclasses/superclasses, specialization/generalization, categories, attribute


inheritance
• The resulting model is called the enhanced-ER or Extended ER (EER) model
• It is used to model applications more completely and accurately if needed

• It includes some object-oriented concepts, such as inheritance

Subclasses and Superclasses

• An entity type may have additional meaningful subgroupings of its entities

– Example: EMPLOYEE may be further grouped into SECRETARY, ENGINEER, MAN-


AGER, TECHNICIAN, SALARIED EMPLOYEE, HOURLY EMPLOYEE, . . .
– Each of these groupings is a subset of EMPLOYEE entities
– Each is called a subclass of EMPLOYEE
– EMPLOYEE is the superclass for each of these subclasses

• These are called superclass/subclass relationships.


– Example: EMPLOYEE/SECRETARY, EMPLOYEE/TECHNICIAN

• These are also called IS-A relationships (SECRETARY IS-A EMPLOYEE, TECHNICIAN IS-A
EMPLOYEE, . . . ).
• Note: An entity that is member of a subclass represents the same real-world entity as some member
of the superclass

– The Subclass member is the same entity in a distinct specific role


– An entity cannot exist in the database merely by being a member of a subclass; it must also
be a member of the superclass
– A member of the superclass can be optionally included as a member of any number of its
subclasses

• Example: A salaried employee who is also an engineer belongs to the two subclasses ENGINEER
and SALARIED EMPLOYEE
– It is not necessary that every entity in a superclass be a member of some subclass

Attribute Inheritance in Superclass/ Subclass Relationships

• An entity that is member of a subclass inherits all attributes of the entity as a member of the
superclass
• It also inherits all relationships

22
Specialization

• Is the process of defining a set of subclasses of a superclass


• The set of subclasses is based upon some distinguishing characteristics of the entities in the super-
class
• Example: SECRETARY, ENGINEER, TECHNICIAN is a specialization of EMPLOYEE based
upon job type.
– May have several specializations of the same superclass
• Example: Another specialization of EMPLOYEE based in method of pay is SALARIED EMPLOYEE,
HOURLY EMPLOYEE.

– Superclass/subclass relationships and specialization can be diagrammatically represented in


EER diagrams
– Attributes of a subclass are called specific attributes. For example, TypingSpeed of SECRE-
TARY
– The subclass can participate in specific relationship types. For example, BELONGS TO of
HOURLY EMPLOYEE

Figure 11: Example of Specialization

23
Figure 12: EER diagram notation to represent subclasses and specialization

Generalization

• The reverse of the specialization process


• Several classes with common features are generalized into a superclass; original classes become its
subclasses

• Example: CAR, TRUCK generalized into VEHICLE; both CAR, TRUCK become subclasses of
the superclass VEHICLE.
– We can view CAR, TRUCK as a specialization of VEHICLE
– Alternatively, we can view VEHICLE as a generalization of CAR and TRUCK

• Two other conditions apply to a specialization/generalization


• Disjointness Constraint
– Specifies that the subclasses of the specialization must be disjointed (an entity can be a
member of at most one of the subclasses of the specialization)
– Specified by d in EER diagram
– If not disjointed, overlap; that is the same entity may be a member of more than one subclass
of the specialization
– Specified by o in EER diagram

• Completeness Constraint

24
Figure 13: Examples of generalization

– Total specifies that every entity in the superclass must be a member of some subclass in the
specialization/ generalization
– Shown in EER diagrams by a double line
– Partial allows an entity not to belong to any of the subclasses
– Shown in EER diagrams by a single line

• Hence, we have four types of specialization/generalization:


– Disjoint, total
– Disjoint, partial
– Overlapping, total
– Overlapping, partial
• Note: Generalization usually is total because the superclass is derived from the subclasses.

Categories (UNION TYPES)

• All of the superclass/subclass relationships we have seen thus far have a single superclass
• A shared subclass is subclass in more than one distinct superclass/subclass relationships, where
each relationships has a single superclass (multiple inheritance)
• In some cases, need to model a single superclass/subclass relationship with more than one superclass

25
Figure 14: Example of disjoint partial specialization

• Superclasses represent different entity types

• Such a subclass is called a category or UNION TYPE

• Example: Database for vehicle registration, vehicle owner can be a person, a bank (holding a lien
on a vehicle) or a company.
– Category (subclass) OWNER is a subset of the union of the three superclasses COMPANY,
BANK, and PERSON
– A category member must exist in at least one of its superclasses

• Note: The difference from shared subclass, which is subset of the intersection of its superclasses(shared
subclass member must exist in all of its superclasses).

File: Lectures 2014.tex Date: Thursday 13th February, 2014 8:57am Revision: 0.3

26
Figure 15: Example of overlapping specialization

Figure 16: Example of categories (UNION TYPES)

27
Figure 17: An EER conceptual schema for a UNIVERSITY database. Refer section 4.5 (8.5.1 in 6th
edition) of the text book for more information.

28

You might also like