Skip to content Skip to main navigation Skip to footer

Arcs

Objectives

This tutorial covers the following objectives:

  • Define the term “constraint” as it applies to data modeling
  • Identify an exclusive OR relationship in a business scenario
  • Diagram an arc constraint to represent an exclusive OR relationship
  • Distinguish between the use of an arc and a subtype in the data model

Purpose

  • Arcs in data modeling help designers clarify an exclusive OR across relationships.
  • The more explicitly you can define the client’s requirements, the more accurate your final implementation will be.

What is a Constraint?

  • Every business has restrictions on which attribute values and which relationships are allowed.
  • These restrictions are called constraints.
  • They may refer to a single attribute of an entity, or to relationships between entities.
  • We already know about several kinds of constraints; for example, every EMPLOYEE must work in one and only one DEPARTMENT.
  • In this lesson, we will see another kind of constraint— an exclusive OR constraint.

Exclusive OR Relationship

  • Mutually exclusive relationships sometimes exist between entities and are also known as Exclusive OR Relationships
  • An Exclusive OR relationship is a relationship between one entity and two (or more) other entities where only one of the relationships can exist at a time
  • In ERDs, we model this type of relationship with an Arc

Example 1. Exclusive OR Relationship:

  • A TRAINING EVENT can be hosted by either an IN HOUSE TRAINER or an external TRAINING COMPANY.
  • Each TRAINING EVENT must be hosted by one and only one IN HOUSE TRAINER OR one and only one TRAINING COMPANY.
Exclusive OR Relationship

It cannot be both, so only one of the relationships can exist at a time. This is an example of an Exclusive OR Relationship

Example 2. Exclusive OR Relationship:

  • A billboard is an advertising space that can feature a movie, a product, or a public announcement. It may contain advertising about only one of these at a time.
  • Each “feature” has its own characteristics or attributes.
  • The arc tells the reader of the diagram that only one of these “features” will have a relationship with each instance of a BILLBOARD.
Exclusive OR Relationship

Representing Exclusive OR Relationships in the ERD

  • Arcs are a way to represent mutually exclusive relationships in the ERD.
  • This arc represents the exclusive OR relationship – each MEMBERSHIP must be held by one COMPANY or must be held by one CUSTOMER, but not both.
Representing Exclusive OR Relationships in the ERD

A gym MEMBERSHIP must be held by one and only one COMPANY OR one and only one CUSTOMER.

NOTE: In this case, the business rules state that MEMBERSHIPS are only valid until the expiration date, so a COMPANY or CUSTOMER may have one or more MEMBERSHIPS.

  • An arc is represented on an ERD as a solid line with curved ends.
  • A circle is drawn on the arc for every relationship that is part of the arc.
Representing Exclusive OR Relationships in the ERD

If a relationship crosses an arc but it is not part of the Exclusive OR Relationship, the circle is omitted. Where possible, for clarity and ease of reading the diagram, this should be avoided by drawing relationships that are not part of the arc outside the arc.

Arcs

  • An arc always belongs to one entity.
  • Arcs 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.
  • An arc should always consist of relationships of the same optionality.
  • All relationships in an arc must be mandatory or all must be optional.
  • Relationships in an arc may be of different cardinality, although this is rare.

Arcs, Supertypes, and Subtypes

  • Arcs and Super/subtypes both model mutual exclusiveness.
  • Certain situations are best modeled as an arc, and others as supertype and subtypes.

Example 1. Arcs, Supertypes, and Subtypes:

  • CHECKING ACCOUNT and SAVINGS ACCOUNT are “types” of ACCOUNT.
Arcs, Supertypes, and Subtypes
  • This should be modeled as supertype and subtypes
Supertypes, and Subtypes

Example 2. Arcs, Supertypes, and Subtypes:

  • An EVENT can be held at either a PRIVATE HOME or a PUBLIC SPACE.
  • If the entities that are related through the arc are similar, there may be a case for creating a super/subtype without an arc.
Arcs, Supertypes, and Subtypes

• In this case, both PRIVATE HOME and PUBLIC SPACE are types of VENUE, and they have broadly similar attributes, so they could be supertype and subtypes

Arcs, Supertypes, and Subtypes

Example 3. Arcs, Supertypes, and Subtypes:

  • IN HOUSE TRAINER and TRAINING COMPANY are NOT types of TRAINING EVENT, and they do not share common attributes. This is best to model with an arc.
Arcs, Supertypes, and Subtypes

Terminology

Key terms used in this tutorial included:

  • Arc
  • Constraint
  • Exclusive OR relationship
  • Mutually exclusive relationship

Summary

In this tutorial, you should have learned how to:

  • Define the term “constraint” as it applies to data modeling
  • Identify an exclusive OR relationship in a business scenario
  • Diagram an arc constraint to represent an exclusive OR relationship
  • Distinguish between the use of an arc and a subtype in the data model

Was This Article Helpful?

1
Related Articles
0 Comments

There are no comments yet

Leave a comment

Your email address will not be published. Required fields are marked *