
06-21923/21980 Fundamentals/ICY: Databases The University of Birmingham
Spring Semester 2013 School of Computer Science
originally derived from text by Achim Jung
(so he is sometimes the “I” in the text)
Handout and Exercises – Week 6
Entity-Relationship Modelling and Diagramming
1. NOTES. The style of diagram notation in these and later notes will differ somewhat from that used in the textbook(s) and
in lectures. There are many different variants of ER diagramming.
Also, some alternative terminology (e.g., “multiplicities”) is used in some places in this handout.
This document contains major enhancements by John Barnden.
2. Identify entity types. The first step is to find entity types that we wish (or that the customer asks us) to represent in the
database.
Typical examples:
People: staff, clients/customers, patients, members, owners, contacts, other individuals, . . .
Objects: stock items, real estate, offices, . . .
Organisations: firms (suppliers or customers), departments, charities, clubs, committees, . . .
Object classes: recordings, films, books, types of stock, biological species, work roles, . . .
Events: concerts, examinations, lecture courses, consultations, sales, . . .
.
.
.
Often, the main entity types appear as nouns in a natural language specification. However, a typical mistake of beginners in
ER-modelling is to include all nouns as database entity types. In each case, you must check whether there is more than one
instance of the entity — otherwise, why use a table instead of a constant? Even if there are several instances, they may be
totally fixed in advance, so for example, the days of the week are an unlikely entity set. Finally, you must check whether
there is anyone really interested in the instances — otherwise we are cluttering the database with irrelevant information.
3. Identify relationships. Find relationships between entity types that need to be recorded:
Typical examples:
Ownership: person owns object
Lines of command: person supervises person
Participation: person participates in event
Part of relationship: item is part of order
person belongs to organisation
Location: house is located in region
Personal: person is married to person
person is parent of person
.
.
.
Often, relationships are expressed by verbs.
Relationships can involve more than two entity types, for example, an examination involves an examiner, a course, and
a student; a property sale involves a seller, a buyer, a property, an estate agent, and two solicitors. These higher-order
relationships are relatively rare, but important to know about.
4. ER diagram. The notation in these notes uses diagrams where entity types are represented as rectangles, relationships as
diamonds. Small example:
1