This graphic shows the entity-relationship (E-R) diagram rules and gives seven relationship diagram examples.

The following terms are defined:

entity -
something about which data is collected, stored, and maintained
attribute -
a characteristic of an entity
relationship -
an association between entities
entity type -
a class of entities that have the same set of attributes
record -
an ordered set of attribute values that describe an instance of an entity type

End of definition list.

The following symbols are used in the diagrams:

End of symbol list.

The figure shows the following seven simple examples:

  1. One A is associated with one B:
    A rectangle on the left represents entity type A. A rectangle on the right represents entity type B. The association between them is represented by a horizontal line. In the center of the line, a diamond shape provides a place to show the name of the relationship. The one-to-one attribute is indicated by two short vertical lines crossing the horizontal line, one near the A rectangle and one near the B rectangle.
  2. One A is associated with one or more B's:
    A rectangle on the left represents entity type A. A rectangle on the right represents entity type B. The association is represented by a horizontal line with a diamond shape in the center. The one-to-many attribute is indicated by one vertical lines near the A rectangle and three branching lines to the B rectangle.
  3. One or more A's are associated with one or more B's:
    A rectangle on the left represents entity type A. A rectangle on the right represents entity type B. The association is represented by a horizontal line with a diamond shape in the center. The many-to-many attribute is indicated by three branching lines to the A rectangle and three branching lines to the B rectangle.
  4. One A is associated with zero or one B:
    A rectangle on the left represents entity type A. A rectangle on the right represents entity type B. The association is represented by a horizontal line with a diamond shape. Two short vertical lines cross the horizontal line, one near the A rectangle and one near the B rectangle. Near the B rectangle, a circle on the line combined with the vertical line indicate that zero or one B may participate in the association. This is a partly optional one-to-one association.
  5. One A is associated with zero or more B's:
    A rectangle on the left represents entity type A. A rectangle on the right represents entity type B. The association is represented by a horizontal line with a diamond shape. A short vertical line crosses the horizontal line near the A rectangle and three lines branch to the B rectangle. Near the B rectangle, a circle on the line combined with the three branching lines indicate that zero or many B may participate in the association. This is a partly optional one-to-many association.
  6. One A is associated with one B and one C:
    A rectangle on the left represents entity type A. Two rectangles are on the right, one represents entity type B and the other represents entity type C. The association is represented by a horizontal line with a diamond shape. On the left, a short vertical line crosses the horizontal line near the A rectangle. On the right, one line branches to the B rectangle and a second line branches to the C rectangle. Near the B rectangle, a vertical line indicates that one B participates in the association with A. Near the C rectangle, a vertical line indicates that one C participates in the association with A.
  7. One A is associated with one B or one C (but not both):
    A rectangle on the left represents entity type A. Two rectangles are on the right, one represents entity type B and the other represents entity type C. The association is represented by a horizontal line with a diamond shape. On the left, a short vertical line crosses the horizontal line near the A rectangle. On the right, one line branches to the B rectangle and a second line branches to the C rectangle. Near the B rectangle, a vertical line indicates that one B participates in the association with A. Near the C rectangle, a vertical line indicates that one C participates in the association with A. At the juncture where the lines branch out of the horizontal line, a dot indicates that either the B or the C can be associated with the A, but not both.

End of examples.

End of description.