Download presentation
Presentation is loading. Please wait.
1
Overview of Entity‐Relationship Model
Entity‐Relationship Model is a detailed, logical representation of the data for an organization or for a business area. What are the entities and relationships in the enterprise? What information about these entities and their relationships should we store in the database? What are the integrity constraints or business rules that holds? The model must be as ‘open’ as possible and not tied to any technology or to any particular business methodology. Introduced in 1976 by Peter Chen. ISE230
2
Supertypes and Subtypes
Subtype: A subgrouping of the entities in an entity type that has attributes distinct from those in other subgroupings Supertype: A generic entity type that has a relationship with one or more subtypes Attribute Inheritance: Subtype entities inherit values of all attributes of the supertype An instance of a subtype is also an instance of the supertype ISE230
3
EER Notations ISE230
4
EER Notations (Microsoft Visio)
Different modeling tools may have different notation for the same modeling constructs ISE230
5
Supertype/Subtype Example
All employee subtypes will have employee number, name, address, and date‐ hired Each employee subtype will also have its own attributes ISE230
6
Relationships and Subtypes
Relationships at the supertype level indicate that all subtypes will participate in the relationship The instances of a subtype may participate in a relationship unique to that subtype. In this situation, the relationship is shown at the subtype level ISE230
7
Another Example: Hospital
Both outpatients and resident patients are cared for by a responsible physician Only resident patients are assigned to a bed ISE230
8
Word of caution! When to use sub/super‐type relationships?
There are attributes that apply to some (but not all) instances of an entity type. Some (again not all) instances of an entity type participate in a relationship ISE230 10
9
Generalization and Specialization
Generalization: The process of defining a more general entity type (supertype) from a set of more specialized entity types (subtypes) and forming supertype/subtype relationships. BOTTOM‐UP Specialization: The process of defining one or more specialized entity types (subtypes) of the supertype. TOP‐DOWN ISE230
10
Example of Generalization
Three entity types: CAR, TRUCK, and MOTORCYCLE All these types of vehicles have common attributes ISE230
11
Example of Generalization (2)
Generalization to VEHICLE supertype So we put the shared attributes in a supertype Note: no subtype for motorcycle, since it has no unique attributes ISE230
12
Example of Specialization
Only applies to manufactured parts Applies only to purchased parts ISE230
13
Example of Specialization (2)
Created two subtypes Note: multivalued attribute was replaced by an associative entity relationship to another entity ISE230
14
Constraints in Supertype/Subtype
Completeness Constraints: Whether an instance of a supertype must also be a member of at least one subtype. No further sub‐type(s) of the super‐type is possible. Yes: Total Specialization Rule (double line) No: Partial Specialization Rule (single line) ISE230
15
Example of Completeness Constraint
Total specialization rule A patient must be either an outpatient or a resident patient ISE230
16
Example of Completeness Constraint
Partial specialization rule A vehicle could be a car, a truck, or nothing. ISE230 20
17
Constraints in Supertype/Subtype
Disjointness Constraints: Whether an instance of a supertype may simultaneously be a member of two (or more) subtypes Disjoint Rule: An instance of the supertype can be only ONE of the subtypes Overlap Rule: An instance of the supertype could be more than one of the subtypes ISE230
18
Example of Disjointness Constraint
Disjoint rule A patient can either be outpatient or resident, but not both ISE230
19
Example of Disjointness Constraint
Overlap rule A part may be both purchased and manufactured ISE230
20
Constraints in Supertype/Subtype
Subtype Discriminator: An attribute of the supertype whose values determine the target subtype(s) Disjoint – a simple attribute with alternative values to indicate the possible subtypes Overlapping – a composite attribute whose subparts pertain to different subtypes. Each subpart contains a boolean value to indicate whether or not the instance belongs to the associated subtype ISE230
21
Subtype Discriminator (Disjoint Rule)
A simple attribute with different possible values indicating the subtype ISE230
22
Subtype Discriminator (Overlap Rule)
A composite attribute with sub‐attributes indicating “yes” or “no” to determine whether it is of each subtype ISE230
23
Supertype/Subtype Hierarchy
ISE230
24
Entity Clusters Problem: EER diagrams are difficult to read when there are too many entities and relationships Solution: Group entities and relationships into clusters Entity cluster: Set of one or more entity types and associated relationships grouped into a single abstract entity type ll ISE230
25
Pine Valley Furniture Company
Related groups of entities could become clusters ISE230
26
EERD of PVF Entity Clusters
More readable, isn’t it? ISE230
27
Manufacturing Entity Cluster
ISE230
28
Conclusion Summary Essential Reading What is Next?
Basic business rules are data names and definitions Data modeling notations frequently used today is the entity‐relationship data model. E‐R model constructs: entities, entity types, relationships, relationship types, attributes, identifiers, cardinality constraints. Essential Reading Modern Database Management (8th Ed.), Chapter 3 What is Next? Relational Model ISE230
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.