Terse Notes — Fundamentals of Database Systems Part 4

Enhanced Entity-Relationship Model

Jesse Ruiz (she/they)
6 min readJul 7, 2024
Photo by Campaign Creators on Unsplash

Ch 4 — Book Credit to Elmasri Ramez And Navathe Shamkant

Book: Fundamentals Of Database System, 7th Edition by Elmasri Ramez And Navathe Shamkant

Ch 4 — The Enhanced Entity-Relationship (EER) Model

Newer apps of db tech — CAD/CAM applications, telecommunications, GIS, complex software systems.

These newer applications required more precise database schemas.

Object = entity

EER is just extended from ER.

Subtype / subclass — an entity type has numerous subgroupings or subtypes of its entities.

Class/subclass relationship is any relationship between a superclass and any one of its subclasses.

Specialization and Generalization

“Specialization is the process of defining a set of subclasses of an entity type; this entity type is called the superclass of the specialization.” (pp. 110)

REVIEW QUESTIONS — CH 4

4.1. What is a subclass? When is a subclass needed in data modeling?

A subclass is a subset of entities within a superclass that share some distinguishing characteristics or attributes. Subclasses are needed in data modeling when:

entities within a superclass have additional specific attributes that apply only to some of them. For example, a secretary subclass of the employee superclass may have a typing_speed attribute.

Certain relationship types are applicable only to some entities within a superclass. For instance, only hourly_employee subclass entities may belong_to a trade_union.

4.2. Define the following terms:

superclass: the higher-level entity type of which a subclass is a subset.

Superclass/subclass relationship: a relationship where the subclass entities inherit attributes and relationships from the superclass.

Is-a relationship: how we refer to the superclass/subclass relationship, e. G. “a secretary is an employee”.

Specialization: the process of defining subclasses of an entity type by identifying additional distinguishing characteristics.

Generalization: the reverse of specialization, creating a superclass from specialized entity types by identifying their common features.

Category: a subclass that is a subset of the union of multiple distinct entity types.

Specific (local) attributes: attributes that apply only to entities in a particular subclass.

Specific relationships: relationship types that entities can participate in only by virtue of being members of a particular subclass.

4.3. Discuss the mechanism of attribute/relationship inheritance. Why is it useful?

Attribute/relationship inheritance is the mechanism by which an entity that is a member of a subclass inherits all the attributes and relationship participations of the superclass. This is useful because it allows subclass entities to possess values for both subclass-specific attributes as well as superclass attributes, without having to fully redefine the superclass properties for the subclass.

4.4. Discuss user-defined and predicate-defined subclasses, and identify the differences between the two.

User-defined subclasses are created by simply enumerating the members that belong to the subclass, without any condition on superclass attributes.

Predicate-defined subclasses are specified by a condition (predicate) on one or more attributes of the superclass. The subclass contains exactly those entities from the superclass that satisfy the predicate.

The key difference is that predicate-defined subclasses have a constraint on membership based on attribute values, whereas user-defined subclasses do not.

4.5. Discuss user-defined and attribute-defined specializations, and identify the differences between the two.

User-defined specializations group entities into subclasses in an ad-hoc manner without using any attributes to constrain membership.

Attribute-defined specializations use a predicate condition on an attribute of the superclass to specify the members of each subclass. For example, if the superclass has an attribute a, subclasses could be defined as a=c1, a=c2, etc. Where c1, c2 are constant values from the attribute domain.

The key difference is that attribute-defined specializations formally constrain subclass membership based on attribute values, while user-defined specializations do not have such formal constraints.

4.6. Discuss the two main types of constraints on specializations and generalizations.

The two main types of constraints are:

disjoint/overlapping: in a disjoint specialization, an entity from the superclass can belong to at most one subclass in that specialization. In an overlapping specialization, an entity can belong to multiple subclasses.

Total/partial: in a total specialization, every entity in the superclass must belong to at least one subclass. In a partial specialization, some entities may not belong to any of the subclasses.

4.7. What is the difference between a specialization hierarchy and a specialization lattice?

A specialization hierarchy is a traditional single inheritance structure, where each subclass has only one parent superclass.

A specialization lattice allows an entity to inherit attributes and relationships from multiple parent superclasses. This is known as multiple inheritance, where a subclass can have multiple parent superclasses.

4.8. What is the difference between specialization and generalization? Why do we not display this difference in schema diagrams?

Specialization is the process of defining subclasses from a superclass by identifying more specific distinguishing characteristics.

Generalization is the reverse process, creating a superclass from specialized entity types by identifying their common features and properties.

The processes are essentially inverse of each other. We do not explicitly display the direction (specialization vs generalization) in eer diagrams because the same constructs are used to represent the result of either process.

4.9. How does a category differ from a regular shared subclass? What is a category used for? Illustrate with examples.

A regular shared subclass represents entities that are members of multiple superclasses simultaneously. For example, an engineering_manager subclass has members that belong to engineer, manager and salaried_employee superclasses.

A category is a subclass that is a subset of the union of multiple distinct entity types. For example, a vehicle_owner category could include entities from person, company and bank entity types to represent owners of vehicles.

Categories are used to create a single class containing entities from multiple entity types when needed to play a particular role, like vehicle_owner. They are displayed using the symbol and subset symbol in eer diagrams.

4.10. For each uml term, discuss the corresponding term in eer model, if any.

Object: corresponds to an entity in the eer model.

Class: corresponds to an entity type or subclass in eer.

Association: corresponds to a relationship type in eer.

Aggregation: no direct corresponding concept in basic eer. Represents a “part-of” relationship.

Generalization: corresponds to generalization/specialization constraints in eer.

Multiplicity: corresponds to cardinality ratio constraints in eer relationships.

Attributes: correspond directly to attributes of entity types/subclasses in eer.

Discriminator: no direct eer correspondence, used to distinguish overlapping subclasses.

Link: no direct eer correspondence, represents an instance of a relationship.

Link attribute: no direct eer correspondence, an attribute of a relationship instance.

Reflexive association: corresponds to a recursive relationship type in eer.

Qualified association: no direct eer correspondence, represents relationships with attributes.

4.11. Discuss the main differences between eer and uml class diagram notation.

Some key differences:

uml uses lines between subclasses and the superclass with different symbols (triangle) to show disjoint/overlapping constraints. Eer uses ovals with constraints stated explicitly.

Uml has a richer notation for various types of classes (abstract, concrete, etc). Eer has a single rectangle notation for all classes.

Uml has association, aggregation and composition relationships. Eer has only a single relationship construct.

Uml can show attributes, operations and visibility directly on class boxes. Eer separates attributes in separate sections.

Uml supports qualifying associations and association classes. Eer does not have these capabilities.

4.12. List the data abstraction concepts and corresponding eer modeling concepts.

Classification: represented by entity types and subclasses in eer

key: represented by key constraints on eer entities/subclasses

specialization/generalization: represented by isa hierarchies in eer

attribute inheritance: supported by attribute inheritance between superclass and subclasses

relationship: represented by relationship types in eer

aggregation: no direct corresponding construct in basic eer

4.13. What aggregation feature is missing from eer? How can it be enhanced?

The eer model does not have a direct way to represent aggregation or “part-of” relationships between entity types. This could be enhanced by adding a new construct similar to the uml composition/aggregation notation to represent these situations.

4.14. Discuss similarities and differences between conceptual database modeling and knowledge representation techniques.

Similarities:

both aim to represent real-world concepts, entities and their properties/relationships

use hierarchies, inheritance, constraints to structure the representations

based on principles of abstraction, classification, generalization

differences:

database models like eer focus on persistent data storage/management requirements

knowledge representation techniques like frames, semantic nets aim for broader knowledge modeling beyond just data

eer has a more strict mathematical formalism compared to some knowledge representation schemes

4.15. Discuss similarities and differences between an ontology and a database schema

similarities:

both represent concepts, entities, attributes and relationships in a domain

use hierarchies, inheritance, constraints to structure the knowledge

differences:

an ontology attempts to model a domain as completely as possible from a knowledge perspective

a database schema focuses on the data storage/management requirements for an application

ontologies are usually more general-purpose; schemas tied to specific database applications

so in summary, an ontology is a more general and complete knowledge model, while a database schema models just the data requirements for a particular use case

--

--

Jesse Ruiz (she/they)
Jesse Ruiz (she/they)

Written by Jesse Ruiz (she/they)

Data Engineer, Artist, Queer writing about tech and life

No responses yet