A relationship connects two associated data entities. The relationship between two entities can often be expressed with a verb. For example, the relationship between the DEPARTMENT entity and the EMPLOYEE entity might be expressed with the verb phrase BELONGS TO. An employee belongs to a department in an organization.
A relationship connects two associated data entities. The relationship between two entities can often be expressed with a
verb
. For example, the relationship between the DEPARTMENT entity and the EMPLOYEE entity might be expressed with the verb phrase BELONGS TO. An employee belongs to a department in an organization.Representing the relationship between two entities
The relationship between two entities is shown with a diamond. The name of the relationship is specified inside the diamond.
No hard-and-fast rule exists for determining data relationships for an organization. Data relationships depend on the requirements of the organization. The concept of
marriage
, for example, could be viewed as an entity type or a relationship between two people, depending on how the data was viewed.Types of Data Relationships
Data entities in a database are related in one of three ways: one-to-one (1-1), one-to-many (1-M), and many-to-many (M-M).
In the following one-to-one example, for every EMPLOYEE entity occurrence in the database, there can exist only one corresponding PROJECT entity occurrence.
In the following one-to-many example, for every DEPARTMENT entity occurrence in the database, there may exist one or more corresponding EMPLOYEE entity occurrences.
In the following many-to-many example, for every SKILL entity occurrence in the database, there can exist one or more corresponding EMPLOYEE entity occurrences. For every EMPLOYEE entity occurrence in the database, there can also exist one or more corresponding SKILL entity occurrences.
Other types of data relationships
In addition to relationships between two entity types, the following types of data relationships are acceptable in an entity-relationship model:
A relationship can be defined for only one entity type
. For example, to define a relationship between different employees in an organization, you might combine different data occurrences from the EMPLOYEE entity. For example, you might express the relationships among employees as MANAGES and REPORTS TO. See the following entity-relationship diagram of Commonweather Corporation for an example.
General Guidelines for Identifying Relationships
To identify the relationships between data entities, perform the following steps:
Using the list of business functions, identify relationships between entities as
verbs
. In those instances where no verb adequately expresses the relationship, join the two entity names to form a name for the relationship. For example, the DEPARTMENT and EMPLOYEE entities could be connected through the relationship BELONGS TO or through the relationship DEPT-EMPLOYEE.List these key verbs between the entities they connect and draw a diamond around each one.
Associate entities with the appropriate relationships by connecting them with lines.
Label each relationship to show whether it is 1-1, 1-M, or M-M.
Entity-relationship diagram for Commonweather Corporation
The following diagram illustrates a simple entity-relationship diagram for the Commonweather Corporation.