Section 7 - Arcs, Hierarchies, and Recursive Modeling
Constraint
Every business has restrictions on which attribute values and which relationships are allowed.
Hierarchical Relationship
More explicit, are easier for most people to understand because they are very similar to an organizational chart Each entity can have its own mandatory attributes and relationships if the business requires this (instead of all optional attributes and relationships, as you would have in a recursive) reflects entities organized into successive levels
Recursive Relationship
Relationship exists between occurrences of the same entity set They are less specific, you cannot have mandatory attributes or relationships unless they are mandatory in all instances of the entity
Pig's ear
The drawing convention for a recursive relationship; a loop from itself to itself
Exclusive OR Relationship
A relationship between one entity and two (or more) other entities where only one of the relationships can exist at a time. This is modeled with an Arc that looks like ] over all entities involved
Arcs
A solid line with curved ends. A circle is drawn for every relationship that is part of the arc. Help designers clarify an exclusive OR across relationships, a way to represent mutually exclusive relationships in the ERD
Properties of Arcs
An arc - always belongs to one entity - can include more than two relationships - not all relationships of an entity need to be included in an arc - an entity may have several arcs - should always consist of relationships of the same optionality - must be mandatory or all must be optional - relationships in an arc may be of different cardinality, although this is rare
Hierarchy vs Recursive Relationship
Both of the models represent all employees A relationship cannot be both hierarchical and recursive at the same time
Arcs and Super/Subtypes
- arcs and super/ subtypes are best modeled as an arc, and others as supertypes and subtypes if the entities are related through the arc are similar, there may be a case for creating a super/subtype without an arc