Tags

, , , , , ,

Syntax Rules for an Entity Relationship Diagram:

  • An Entity appears as a Rectangular shape with a Name that is represented in the Singular for the subject of the data contained in this Entity.
  • A Relationship Line can be created between any two and ONLY Two Entities.
  • A Relationship MUST be valid and readable in both directions:
    a) An instance of {the first entity} MAY or MUST have {minimum to maximum} occurrences of {the other entity}.
    b) An instance of {the other entity} MAY or MUST have {minimum to maximum} occurrences of {the first entity}.
  • When the Relationship is Not Mandatory, the MAY will be used and the minimum will be ZERO.
  • When the Relationship is Mandatory, the MUST will be used and the minimum will be ONE.
  • When the Relationship is Singular, the maximum will be ONE; otherwise, the Maximum will be MANY.
  • The Cardinality {minimum to maximum} of these Relationships are sometimes shown as these diagrams as numbers (0,1), (0, many), or a set of predetermined symbols.

An Entity Relationship Diagram Sample:

Use this link: https://docs.google.com/drawings/d/1keA4BzVCJXcUoNWDw7-0pIrQ7AsB5CgavjWR7P5Wyrg/edit?hl=en_US (may have to paste into a browser)


Business Rules derived from this sample are:

  • A Customer MAY have Zero to Many Orders.
  • An Order MUST have One and Only One Customer.
  • An Order MUST have One or More Line Items.
  • An Order Line Item MUST have One and Only One Order.
  • A Product MAY have One or More Order Line Items.
  • An Order Line Item MUST have One and Only One Product.

It is also interesting to note that since there is no relationship between Customer and Product there are no Business Rules that can be derived between these two collections of data (entities).

Advertisements