Skip to content

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
Start of this note, 8 of 8
Take this term’s notes offline
Reading here is free. Download all 8 SS2 Data Processing First term notes as PDF to print and Word to edit.
Download all three terms, ₦2,000
Instant download. Secure payment by Paystack. Card, bank transfer, USSD or OPay. Payment stuck? WhatsApp us.

An entity-relationship (ER) model is a graphical representation of entities and their relationships to each other, drawn as an entity-relationship diagram (ERD).

Advertisement
  • 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:

  1. define an entity-relationship diagram;
  2. state two uses of an entity-relationship diagram;
  3. name and describe the components of an entity-relationship diagram;
  4. explain cardinality;
  5. 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.

  1. Identify data to capture: it shows the data that must be captured, stored and retrieved to support the business.
  2. Support reports: it identifies the data needed to produce reports on the performance measures an organisation should monitor.
  3. 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.

Advertisement
  • 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
CLASS Has STUDENT 1 M ClassID ClassName AdmNo Name
A simple ERD: one CLASS has many STUDENTS. Based on standard Data Processing texts.

How is an entity-relationship diagram drawn?

An ERD is drawn by listing the entities first, then their attributes, then the links between them.

  1. Identify the entities in the system, such as STUDENT and CLASS.
  2. Draw each entity as a rectangle.
  3. List the attributes of each entity and draw them as ovals.
  4. Choose the key attribute of each entity, such as the admission number.
  5. Draw a diamond and lines to show how the entities are related.
  6. 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.

Advertisement
  • 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

  1. What is an entity-relationship diagram?
  2. State two uses of an entity-relationship diagram.
  3. Name the three components of an entity-relationship diagram.
  4. What is an entity, and how is it shown in an ERD?
  5. 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

  1. Database Management System I
  2. Database Management System II: How to Create Database
  3. Data Model
  4. Data Model II: Types of Data Modelling
  5. Data Modeling
  6. Data Modeling II: Standard Data Model & Examples
  7. Normalization
  8. Entity-Relationship Models
Advertisement

Lesson Notes for Other Classes

Print it or edit it in Word

Every note is free to read online. A PDF or Word copy of one subject costs ₦1,000 for one term, or ₦2,000 for all three terms.

Sign in first, then choose your class and subject at checkout.