ER Diagrams   «Prev  Next»

Lesson 1

Entity-Relationship Diagrams for Database Design

The last order of business before diving into the creation of an entity-relationship (ER) diagram is to examine how entities relate to one another.
Different aspects of entity relationships,
  1. the types of relationships that can exist between entities, as well as the
  2. types of participation entities have in relationships,
find their way into an ER diagram as symbols.
Be forewarned that the lessons in this module may seem a bit more “technical” than previous lessons. One reason for this is because the guidelines for establishing entity relationships (table links) are couched in the language of conceptual modeling.

After completing this module, you will 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

Software Engineering

In software engineering, an entity relationship model (ER model) is a data model for describing the data or information aspects of a business domain or its business process that lends itself to ultimately being implemented in a database such as a relational database.
The main components of ER models are 1) entities and 2) the relationships that can exist among them.
ERD Model
Variants of the idea existed previously, and have been devised subsequently such as supertype and subtype data entities and commonality relationships. Furthermore, an entity relationship model is a systematic way of describing and defining a business process. The process is modeled as components that are linked with each other by relationships that express the dependencies and requirements between them.
Entities may have various attributes that characterize them and diagrams created to represent these entities, attributes, and relationships graphically are called entity relationship diagrams.
An ER model is typically implemented as a database. In the case of a relational database, which stores data in tables, every row of each table represents one instance of an entity. Some data fields in these tables point to indexes in other tables and these pointers represent the relationships.
The three schema approach to software engineering uses three levels of ER models that may be developed.

Three Basic Data Relationships in ERD

Once you have a good idea of the basic entities in your database environment, your next task is to identify the relationships among those entities. There are three basic types of relationships that you may encounter:
  1. one-to-one (1 : 1),
  2. one-to-many (1 : M), and
  3. many-to-many (M : N or M : M).

Before examining each type, you should keep one thing in mind: The relationships that are stored in a database are between instances of entities. For example, a customer is related to the items that he or she orders. Each instance of the customer entity is related to instances of the specific items ordered. When we document data relationships, such as when we draw an ER diagram, we show the types of relationships among entities. We are showing the possible relationships that are allowable in the database. Unless we specify that a relationship is mandatory, there is no requirement that every instance of every entity must be involved in every documented relationship.
The next lesson defines entity relationships.

Database Systems