Lesson Plan

Lesson Plan
Grade: Date: 01/12/2025
Subject: Information Communication Technology ICT
Lesson Topic: Be able to create relationships between tables
Learning Objective/s:
  • Describe primary keys, foreign keys and referential integrity in a relational database.
  • Identify appropriate primary and foreign keys for given tables.
  • Apply the step‑by‑step process to create one‑to‑many and many‑to‑many relationships in a DBMS.
  • Write SQL statements that add foreign‑key constraints and enforce referential integrity.
  • Analyse common relationship errors and explain how referential integrity prevents orphan records.
Materials Needed:
  • Computer lab with DBMS software (e.g., Access or MySQL Workbench)
  • Projector and screen
  • Sample database files (Students, Courses, Enrollments)
  • Printed worksheet with practice activity
  • Whiteboard and markers
  • Internet access for reference
Introduction:
Begin with a quick question: “What happens to student data if we store course information in the same table?” Connect this to prior learning on tables and keys, and tell students they will learn how to link tables efficiently. Explain that by the end of the lesson they will be able to create and enforce relationships and demonstrate their understanding through a short exit ticket.
Lesson Structure:
  1. Do‑now (5’) – Students answer a short question on data duplication.
  2. Mini‑lecture (10’) – Review primary/foreign keys and relationship types using an ER diagram.
  3. Guided demonstration (15’) – Instructor shows how to open the Relationships window, drag PK to FK, set the relationship type, and enforce referential integrity.
  4. Pair activity (15’) – Learners identify keys in the sample tables and write SQL ALTER statements for foreign keys.
  5. Checking understanding (5’) – Quick quiz (Kahoot) on relationship types and common errors.
  6. Consolidation (5’) – Class discussion of what occurs when a referenced record is deleted.
Conclusion:
Summarise that relationships keep data consistent and avoid duplication, and that the systematic steps ensure referential integrity. Students complete an exit ticket describing one potential error and how to prevent it. For homework, they design a simple ER diagram for a library system and write the corresponding foreign‑key SQL statements.