ER Diagrams   «Prev  Next»

Lesson 14

Entity Relationships and the Three Types of Relationships [1:1, 1:N, M:N]

This module discussed the order to create an ER diagram and how entities relate to each other. You explored two related, but different aspects of entity relationships:
  1. the types of relationships that can exist between entities (1:1, 1:N, and M:N), as well as the
  2. types of participation entities have in relationships (mandatory or optional).
In the next module, you will learn how these are incorporated symbolically into an ER diagram.

Define the concept of an Entity Relationship

Entity Relationship (ER) is a conceptual data modeling technique used to represent the relationships between different entities in a system. ER diagrams are graphical representations of these relationships, consisting of entities, attributes, and relationships between the entities. The technique was first introduced by Peter Chen in 1976 and has since been widely adopted in the field of database design and information systems.
In ER modeling, an entity refers to a real-world object or concept that is distinguishable from other objects or concepts. Entities are represented as rectangles in ER diagrams and contain attributes that describe the characteristics of the entity. Attributes are represented as ovals in ER diagrams and are connected to their respective entities by lines. ER diagrams also include relationships, which are connections between entities that describe how they are related to each other. Relationships are represented as diamonds in ER diagrams, with lines connecting them to the entities involved. Relationships can be classified as one-to-one, one-to-many, or many-to-many, depending on the number of entities involved in the relationship.
  1. One-to-one relationships describe a situation where one instance of an entity is related to only one instance of another entity. For example, a person can have only one social security number, and a social security number can be associated with only one person.
  2. One-to-many relationships describe a situation where one instance of an entity is related to multiple instances of another entity. For example, a customer can have multiple orders, but each order is associated with only one customer.
  3. Many-to-many relationships describe a situation where multiple instances of an entity are related to multiple instances of another entity. For example, a student can take multiple courses, and each course can be taken by multiple students.

ER modeling is an important technique in database design as it helps to ensure that the relationships between entities are properly defined and structured. By using ER diagrams to model the relationships between entities, businesses and organizations can create efficient and effective information systems that accurately reflect their real-world operations.

Learning objectives

Having completed this module, you should be able to:
  1. Define the concept of an entity relationship
  2. Describe the three types of entity relationships
  3. Define and identify one-to-one relationships
  4. Define and identify one-to-many relationships
  5. Define and identify many-to-many relationships
  6. Explain the problems with many-to-many relationships
  7. Convert many-to-many relationships into one-to-many relationships
  8. Distinguish between mandatory and optional relationships

Glossary terms

This module introduced you to the following terms:
  1. composite entity: In relational database design, a composite entity is used to provide an indirect link between two entities in a M:N (many-to-many) relationship. Also called a linking table.
  2. composite key attribute: A key attribute belonging to a composite entity, comprising the key attributes from each of the two entities linked by the composite entity. Also called a composite primary key.
  3. entity relationship: Entities that participate in a relationship are associated; the three types of entity relationships (associations) are one-to-one, one-to-many, and many-to-many.
  4. linking table: Another name for a composite entity. Used to provide an indirect link between two entities in a M:N (many-to-many) relationship.
  5. mandatory entity: In the language of relational database design, mandatory entity is another name for the entity that has mandatory participation in an entity relationship.
  6. mandatory participation: In the language of database design, participation describes the nature of the relationship between two tables. Mandatory participation describes a relationship in which least one record in a table must exist before any records can be added to its associated table.
  7. many-to-many relationship: In relational database design, a many-to-many (M:N) relationship exists when, for one instance of entity A, there exists zero, one, or many instances of entity B; and for one instance of entity B, there exists zero, one, or many instances of entity A.
  8. one-to-many relationship: In relational database design, a one-to-many (1:N) relationship exists when, for one instance of entity A, there exists zero, one, or many instances of entity B; but for one instance of entity B, there exists zero or one instance of entity A.
  9. one-to-one relationship: In relational database design, a one-to-one (1:1) relationship exists when zero or one instance of entity A can be associated with zero or one instance of entity B, and zero or one instance of entity B can be associated with zero or one instance of entity A.
  10. optional participation: In the language of database design, participation refers to the nature of the relationship between tables. Optional participation describes a relationship in which no records need to exist in a table before records are added to its associated table.
  11. redundant data: Duplicate data in a database; although redundant data can never be totally removed, a major goal of database design is to eliminate as much redundant data as possible.
  12. weak entity: In the language of relational database design, weak entity is another name for the entity that has optional participation in an entity relationship.
The next module explains how to create an entity-relationship (ER) diagram.

Entity Relationships - Quiz

Before moving on to the next module, click the Quiz link below to check your understanding of entity relationships.
Entity Relationships - Quiz