Entity-Relationship Models – SS2 Data Processing Lesson Note (First Term)
Lesson note at a glance
- Class
- SS2
- Subject
- Data Processing
- Term
- First Term
- Reading time
- 4 min

An entity-relationship (ER) model is a graphical representation of entities and their relationships to each other, drawn as an entity-relationship diagram (ERD).
- Purpose: the ERD shows the logical structure of a database.
- Parts: an ERD is made up of entities, attributes and relationships.
- Use: it is drawn to design the database before it is built.
Behavioural objectives
By the end of the lesson, students should be able to:
- define an entity-relationship diagram;
- state two uses of an entity-relationship diagram;
- name and describe the components of an entity-relationship diagram;
- explain cardinality;
- list the three types of cardinality relationship and give an example of each.
What is an entity-relationship diagram?
An entity-relationship diagram is a picture that shows the entities in a database, their attributes and how the entities are related.
- Entity: a thing about which data is kept, such as a student.
- Attribute: a detail that describes the entity, such as a name.
- Relationship: a link between entities, such as a class having students.
What are the uses of an entity-relationship diagram?
An ERD is used to plan what data a database must hold and how the data is connected.
- Identify data to capture: it shows the data that must be captured, stored and retrieved to support the business.
- Support reports: it identifies the data needed to produce reports on the performance measures an organisation should monitor.
- Design the database: it gives designers a clear plan before the tables are created.
What are the components of an entity-relationship diagram?
An entity-relationship diagram has three components: entities, attributes and relationships.
What is an entity?
An entity is an object or concept within the data model about which data is stored.
- Symbol: each entity is drawn as a box (rectangle) in the ERD.
- Container idea: an entity holds all the instances of one particular thing in a system.
- Examples: STUDENT, TEACHER, CLASS, SUBJECT.
What is an attribute?
An attribute (also called a data element) is a property that describes an entity.
- Smallest unit: attributes are the smallest units of data that can be described in a meaningful way.
- Examples: for STUDENT, the attributes can be admission number, name, date of birth and gender.
- Key attribute: the unique, distinguishing characteristic of an entity, such as the admission number.
- Primary key: the attribute that identifies each record uniquely. It is always an attribute of the entity.
What is a relationship?
A relationship is an association among the instances of one or more entity types that are of interest to the organisation.
- Meaning: it links entities or entity occurrences.
- Example: a CLASS has STUDENTS. A TEACHER teaches SUBJECTS.
What symbols are used in an ERD?
The symbols below follow the common (Chen) style of drawing an ERD.
| Component | Symbol | Example |
|---|---|---|
| Entity | Rectangle | STUDENT |
| Attribute | Oval (ellipse) | Name |
| Relationship | Diamond | Has |
How is an entity-relationship diagram drawn?
An ERD is drawn by listing the entities first, then their attributes, then the links between them.
- Identify the entities in the system, such as STUDENT and CLASS.
- Draw each entity as a rectangle.
- List the attributes of each entity and draw them as ovals.
- Choose the key attribute of each entity, such as the admission number.
- Draw a diamond and lines to show how the entities are related.
- Mark the cardinality (1 or M) on each line.
What is cardinality?
Cardinality defines the relationship between entities in terms of numbers.
- Meaning: it shows how many instances of one entity can be linked to instances of another.
- On the ERD: it is written on the relationship line as 1 (one) or M (many).
What are the types of cardinality relationship?
There are three types of cardinality relationship: one-to-one, one-to-many and many-to-many.
- One-to-one (1:1): one instance of an entity is linked to only one instance of another. Example: one student has one admission number.
- One-to-many (1:M): one instance of an entity is linked to many instances of another. Example: one class has many students.
- Many-to-many (M:N): many instances of one entity are linked to many instances of another. Example: many students offer many subjects.
| Type | Meaning | School example |
|---|---|---|
| One-to-one | One to one | One student, one admission number |
| One-to-many | One to many | One class, many students |
| Many-to-many | Many to many | Many students, many subjects |
Evaluation
- What is an entity-relationship diagram?
- State two uses of an entity-relationship diagram.
- Name the three components of an entity-relationship diagram.
- What is an entity, and how is it shown in an ERD?
- What is cardinality?
Assignment
Name the three types of cardinality relationship. Explain each one and give one example from a school setting.
This term's Data Processing topics
SS2 First Term · 8 topics

