Page 59 -
P. 59
26 Part 1 • SyStemS analySiS FundamentalS
Figure 2.6
An entity-relationship diagram Employee
showing a one-to-one relationship.
One One
PHONE
EXTENSION is is EMPLOYEE
is assigned
is
listed listed assigned to one
PHONE
for one
for
to
EMPLOYEE. EXTENSION.
Phone Extension
of the month, a sales period, or a machine breakdown. A relationship is the association that
describes the interaction among the entities.
There are many different conventions for drawing entity-relationship (E-R) diagrams (with
names like crow’s foot, arrow, or Bachman notation). In this book, we use crow’s foot notation.
For now, we assume that an entity is a plain rectangular box.
Figure 2.6 shows a simple entity-relationship diagram. Two entities are linked together by a
line. In this example, the end of the line is marked with two short parallel marks (| |), signifying
that this relationship is one-to-one. Thus, exactly one employee is assigned to one phone exten-
sion. No one shares the same phone extension in this office.
The red arrows are not part of the entity-relationship diagram. They are present to demon-
strate how to read the entity-relationship diagram. The phrase on the right side of the line is read
from top to bottom as follows: “One EMPLOYEE is assigned to one PHONE EXTENSION.”
On the left side, as you read from bottom to top, the arrow says, “One PHONE EXTENSION is
listed for one EMPLOYEE.”
Similarly, Figure 2.7 shows another relationship. The crow’s foot notation (>—+) is obvi-
ous on this diagram, and this particular example is a many-to-one example. As you read from left
to right, the arrow signifies, “Many EMPLOYEES are members of a DEPARTMENT.” As you
read from right to left, it implies, “One DEPARTMENT contains many EMPLOYEES.”
Figure 2.7
An entity-relationship diagram
showing a many-to-one Many EMPLOYEES
DEPARTMENT.
relationship. are members of a
is a member of
Employee Department
contains
One DEPARTMENT
contains many
EMPLOYEES.