大象传媒

Entity occurence diagrams

Entity occurence

A specific example of an entity is called an instance or entity occurrence.

For example, Ola MacLeod, Hamish Robertson and Shan Ashiq are all entity occurrences found in the Student entity.

Maths, Computing and Physics are all entity occurrences within the Subject entity.

An entity-occurrence diagram shows the relationships between occurrences of a particular entity.

In an entity-occurrence diagram:

  • each entity is shown as a tall oval
  • inside each oval, an occurrence of an entity is shown by a dot and a description of the occurrence

Examples of entity-occurrence diagrams are shown below.

Example 1: One to one relationship

The following table and diagram show the headteachers that manage particular schools.

SchoolHeadteacher
GW11Mr Kane
GW17Miss Brown
GW24Mrs Copeland
School
Headteacher
GW11
Mr Kane
GW17
Miss Brown
GW24
Mrs Copeland
Two circles: one containing school IDs and the other containing headteachers' names. There are lines that connect individual schools to individual headteachers.

For this entity-occurrence diagram:

  • each headteacher manages one, and only one school
  • each school also has one and only one headteacher

This shows that there is a one-to-one relationship between these entities.

Example 2: One-to-many relationship

The following table and diagram show which teachers are employed at which schools:

SchoolTeacher
GW24Miss Lowe
GW11Ms Umar
GW11Mr Connelly
GW24Mrs Stevens
GW17Mrs Kyle
GW11Ms Laing
GW24Mr McGarvey
School
Teacher
GW24
Miss Lowe
GW11
Ms Umar
GW11
Mr Connelly
GW24
Mrs Stevens
GW17
Mrs Kyle
GW11
Ms Laing
GW24
Mr McGarvey
Two circles: one containing school IDs and the other containing teachers' names. There are lines that connect individual schools to individual teachers. Some schools connect to multiple teachers.

For this entity-occurrence diagram:

  • each school has multiple teachers employed
  • each teacher only works at one school

This shows that there is a one-to-many relationship.

Example 3: Many-to-many relationship

The following table and diagram show which pupils study which subjects:

PupilsSubject
RossComputing
JameelMathematics
JenaPhysics
RossMathematics
AlaraPhysics
DeclanPhysics
DeclanComputing
AlaraMathematics
Pupils
Subject
Ross
Computing
Jameel
Mathematics
Jena
Physics
Ross
Mathematics
Alara
Physics
Declan
Physics
Declan
Computing
Alara
Mathematics
Two circles: one containing pupils' names and the other containing subjects. There are lines that connect individual pupils to individual subjects. Some pupils are connected to multiple subjects.

In this entity-occurrence diagram:

  • each pupil can study multiple subjects
  • each subject can have multiple pupils studying it

This shows that these entities share a many-to-many relationship.