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.
School | Headteacher |
GW11 | Mr Kane |
GW17 | Miss Brown |
GW24 | Mrs Copeland |
School |
Headteacher |
GW11 |
Mr Kane |
GW17 |
Miss Brown |
GW24 |
Mrs Copeland |
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:
School | Teacher |
GW24 | Miss Lowe |
GW11 | Ms Umar |
GW11 | Mr Connelly |
GW24 | Mrs Stevens |
GW17 | Mrs Kyle |
GW11 | Ms Laing |
GW24 | Mr McGarvey |
School |
Teacher |
GW24 |
Miss Lowe |
GW11 |
Ms Umar |
GW11 |
Mr Connelly |
GW24 |
Mrs Stevens |
GW17 |
Mrs Kyle |
GW11 |
Ms Laing |
GW24 |
Mr McGarvey |
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:
Pupils | Subject |
Ross | Computing |
Jameel | Mathematics |
Jena | Physics |
Ross | Mathematics |
Alara | Physics |
Declan | Physics |
Declan | Computing |
Alara | Mathematics |
Pupils |
Subject |
Ross |
Computing |
Jameel |
Mathematics |
Jena |
Physics |
Ross |
Mathematics |
Alara |
Physics |
Declan |
Physics |
Declan |
Computing |
Alara |
Mathematics |
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.