Notation of Entity Relationship Diagram

ERD in SchemaBank is based on Crow's Feet notation.

One-to-One or One-to-Many Relationship

The parent and child entities can either have an one-to-one relationship:

one-to-one

or an one-to-many relationship:

one-to-many

To express a many-to-many relationship in SchemaBank, you have to use a bridge entity to break it into two one-to-many relationships like this:

one-to-many

Self-Relationship

An entity can be related to itself to create a self-relationship:

self relationship

Parent Optionality (or sometimes called Parent Partiality)

If every record in the child entity must reference to a record in the parent entity, the parent optionality is mandatory and is expressed by adding a stroke beside the parent entity:

parent mandatory

Otherwise, the parent optionality is optional and is expressed by adding a circle beside the parent entity:

parent optional

When parent optionality is mandatory, the foreign keys (in the child entity) cannot be null. The foreign keys can be null if and only if the parent is optional.

Child Optionality (or Child Partiality)

If every record in the parent entity must be referenced from a record in the child entity, the child optionality is mandatory and is expressed by adding a stroke beside the child entity:

child mandatory

Otherwise, the child optionality is optional and is expressed by adding a circle beside the child entity:

child optional

Identifying and Non-identifying Relationships

With an identifying relationship, the foreign keys in the child table are part of the primary key in the child entity. This is represented by a solid line linking the two entities:

identifying

On the contrary, the relationship would be a non-identifying one, represented by a dashed line:

non-identifying

A Sample Model

sample erd

The above sample model contains 3 entities and their relationships:

  • a Sales Office lists at least zero and at most many Property
  • a Property must be listed under at least one Sales Office
  • an Employee works for one and only one Sales Office
  • a Sales Office can have no employee working for it (sounds somewhat un-realistic but that's what the circle beside the Employee entity means)
  • an Employee entity has a 'supervises' self-relationship (note that a self-relationship is always a non-identifying one)