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

05 Fifth Chapter

Chapter Five discusses the Extended/Enhanced Entity Relationship (EER) model, focusing on entity superclasses and subclasses, specialization hierarchies, and the concept of inheritance. It explains how to effectively use primary keys and the importance of entity clustering in database design. Additionally, it covers disjoint and overlapping constraints, completeness constraints, and the processes of specialization and generalization.
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)
11 views7 pages

05 Fifth Chapter

Chapter Five discusses the Extended/Enhanced Entity Relationship (EER) model, focusing on entity superclasses and subclasses, specialization hierarchies, and the concept of inheritance. It explains how to effectively use primary keys and the importance of entity clustering in database design. Additionally, it covers disjoint and overlapping constraints, completeness constraints, and the processes of specialization and generalization.
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

Data Base Lectures Chapter Five Asst. Lec.

Suhaib Al-Ansarry

Extended/ Enhanced Entity Relationship (EER) Model


In this chapter, we will focus on the following points:
• About the extended entity relationship (EER) model.
• How entity clusters are used to represent multiple entities and relationships.
• The characteristics of good primary keys and how to select them.

5.1 THE EXTENDED ENTITY RELATIONSHIP MODEL


The extended entity relationship model (EERM), sometimes referred to as the enhanced
entity relationship model, is the result of adding more semantic constructs to the original
entity relationship (ER) model.
5.1.1 Entity Superclass and Subclasses
In modeling terms, an entity superclass is a generic entity type that is related to one or
more entity subclasses, where the entity superclass contains the common characteristics,
and the entity subclass contain the unique characteristics of each entity subclass.
There are two criteria that help the designer determine when to use superclasses and
subclasses:
• There must be different, identifiable kinds or types of the entity in the user’s
environment.
• The different kinds or types of instances should have one or more attributes that
are unique to that kind or type of instance.
In employees’ example, because most employees possess a wide range of skills and
special qualifications, data modelers must find a variety of ways to group employees
based on employee characteristics. For instance, a retail company could group employees
as salaried and hourly employees, while a university could group employees as faculty,
staff, and administrators. The grouping of employees to create various types of
employees provides two important benefits:
• It avoids unnecessary nulls in the employee attributes when some employees have
characteristics that are not shared by other employees.
• It enables a particular employee type to participate in relationships that are unique
to that employee type.
5.1.2 Specialization Hierarchy
Entity superclasses and subclasses are organized in a specialization hierarchy, which
depicts the arrangement of
higher-level entity superclasses (parent entities) and lower-level entity subtypes (child
entities). Figure 5.1 shows the specialization hierarchy formed by an EMPLOYEE
superclass and three entity subtypes—PILOT, MECHANIC, and ACCOUNTANT. The
specialization hierarchy reflects the 1:1 relationship between EMPLOYEE and its
superclasses. For example, a PILOT subtype occurrence is related to one instance of the
EMPLOYEE superclass, and a MECHANIC subtype occurrence is related to one
instance of the EMPLOYEE superclass. The terminology and symbols in Figure 5.1 are
explained throughout this chapter.
The relationships depicted within the specialization hierarchy are sometimes described in
terms of “is-a” relationships. For example, a pilot is an employee, a mechanic is an
employee, and an accountant is an employee. It is important to understand that within a

Basrah University/ Computer Dept./ 2nd Year/ 2023-2024 Page 1


Data Base Lectures Chapter Five Asst. Lec. Suhaib Al-Ansarry

specialization hierarchy, a subtype can exist only within the context of a superclass, and
every superclass can have only one superclass to which it is directly related. However, a
specialization hierarchy can have many levels of superclass / subclass relationships—
that is, you can have a specialization hierarchy in which a superclass has many
subtypes; in turn, one of the subtypes is the superclass to other lower-level subtypes.

Specialization hierarchies enable the data model to capture additional semantic content
(meaning) into the ERD. A specialization hierarchy provides the means to:
• Support attributes inheritance.
• Define a special superclass attribute known as the subclass discriminator.
• Define disjoint/overlapping constraints and complete/partial constraints.

5.1.3 Inheritance
The property of inheritance enables an entity subtype to inherit the attributes and
relationships of the superclass. As discussed earlier, a superclass contains those attributes
that are common to all of its subclass. In contrast, subclasses contain only the attributes
that are unique to the subtype. For example, Figure 5.1 illustrates that pilots, mechanics,
and accountants all inherit the employee number, last name, first name, middle initial,
hire date, and so on from the EMPLOYEE entity. However, Figure 5.1 also illustrates
that pilots have attributes that are unique; the same is true for mechanics and accountants.
One important inheritance characteristic is that all entity subclasses inherit their

Basrah University/ Computer Dept./ 2nd Year/ 2023-2024 Page 2


Data Base Lectures Chapter Five Asst. Lec. Suhaib Al-Ansarry

primary key attribute from their superclass.


Entity subclasses inherit all relationships in which the superclass entity participates. For
example, Figure 5.1 shows the EMPLOYEE entity superclass participating in a 1:M
relationship with a DEPENDENT entity.

5.1.4 Disjoint and Overlapping Constraints


Disjoint subclass, also known as non-overlapping subclasses, are subclasses that contain
a unique subset of the superclass entity set; in other words, each entity instance of the
superclass can appear in only one of the subclasses. For example, in Figure 5.1, an
employee (superclass) who is a pilot (subclass) can appear only in the PILOT subclass,
not in any of the other subclasses. In Visio, such disjoint subclasses are indicated by the
letter d inside the category shape.
Overlapping subclasses are subclasses that contain non-unique subsets of the superclass
entity set; that is, each entity instance of the superclass may appear in more than one
subclass.

For example, in a university environment, a person may be an employee or a student or


both. In turn, an employee may be a professor as well as an administrator. Because an
employee may also be a student, STUDENT and EMPLOYEE are overlapping
subclasses of the superclass PERSON, just as PROFESSOR and ADMINISTRATOR
are overlapping subtypes of the superclass EMPLOYEE. Figure 5.2 illustrates
overlapping subclasses with the use of the letter o inside the category shape.

Basrah University/ Computer Dept./ 2nd Year/ 2023-2024 Page 3


Data Base Lectures Chapter Five Asst. Lec. Suhaib Al-Ansarry

5.1.5 Completeness Constraint


The completeness constraint specifies whether each entity superclass occurrence must
also be a member of at least one subclass. The completeness constraint can be partial or
total.
Partial completeness (symbolized by a circle over a single line) means that not every
superclass occurrence is a member of a subclass; that is, there may be some superclass
occurrences that are not members of any subclass.
Total completeness (symbolized by a circle over a double line) means that every
superclass occurrence must be a member of at least one subtype.

Given the disjoint/overlapping subclasses and completeness constraints, it’s possible to


have the specialization hierarchy constraint scenarios shown in Table 5.1.

5.1.6 Specialization and Generalization


Specialization is the top-down process of identifying lower-level, more specific entity
subclasses from a higher-level entity superclass. Specialization is based on grouping
unique characteristics and relationships of the subtypes.
In the aviation example, you used specialization to identify multiple entity subclasses
from the original employee superclass.
Generalization is the bottom-up process of identifying a higher-level, more generic
entity superclass from lower-level entity subtypes. Generalization is based on grouping
common characteristics and relationships of the subtypes.
For example, you might identify multiple types of musical instruments: piano, violin,
and guitar. Using the generalization approach, you could identify a “string instrument”
entity superclass to hold the common characteristics of the multiple subclasses.

5.2 ENTITY CLUSTERING


An entity cluster is a “virtual” entity type used to represent multiple entities and
relationships in the ERD. An entity cluster is formed by combining multiple interrelated
entities into a single abstract entity object.
An entity cluster is considered “virtual” or “abstract” in the sense that it is not actually
an entity in the final ERD.

Basrah University/ Computer Dept./ 2nd Year/ 2023-2024 Page 4


Data Base Lectures Chapter Five Asst. Lec. Suhaib Al-Ansarry

5.3 ENTITY INTEGRITY: SELECTING PRIMARY


A natural key or natural identifier is a real-world, generally accepted identifier used to
distinguish—that is, uniquely identify—real-world objects. As its name implies, a
natural key is familiar to end users and forms part of their day-to-day business
vocabulary. Additionally, look at Table 5.2, which summarizes desirable primary key
characteristics.

Basrah University/ Computer Dept./ 2nd Year/ 2023-2024 Page 5


Data Base Lectures Chapter Five Asst. Lec. Suhaib Al-Ansarry

Composite keys are useful to represent M:N relationships and weak (strong identifying)
entities.
In fact, composite primary keys are particularly useful in two cases:
• As identifiers of composite entities, where each primary key combination is
allowed only once in the M:N relationship.
• As identifiers of weak entities, where the weak entity has a strong identifying
relationship with the parent entity.
As shown in Figure 5.3, example of student, the composite primary key automatically
provides the benefit of ensuring that there cannot be duplicate values—that is, it ensures
that the same student cannot enroll more than once in the same class.

ReviewQuestions
1. What is an entity superclass, and why is it used?
2. What kinds of data would you store in an entity subclass?
3. What is a specialization hierarchy?
4. What is subclass completeness? Give an example of its use.
5. What is an overlapping subclass? Give an example.
6. What is the difference between partial completeness and total completeness?
For questions 7–9, refer to Figure Q5.7.
7. List all of the attributes of a movie.
8. According to the data model, is it required that every entity instance in the PRODUCT
table be associated with an entity instance in the CD table? Why, or why not?
9. Is it possible for a book to appear in the BOOK table without appearing in the
PRODUCT table? Why, or why not?

Basrah University/ Computer Dept./ 2nd Year/ 2023-2024 Page 6


Data Base Lectures Chapter Five Asst. Lec. Suhaib Al-Ansarry

Basrah University/ Computer Dept./ 2nd Year/ 2023-2024 Page 7

You might also like