Lesson Plan

Lesson Plan
Grade: Date: 17/01/2026
Subject: Computer Science
Lesson Topic: Understand the purpose of a primary key and identify one
Learning Objective/s:
  • Describe the purpose of a primary key in a relational database.
  • Identify the key characteristics of a good primary key.
  • Select an appropriate primary key for a given table.
  • Explain how primary keys support data integrity and relationships between tables.
Materials Needed:
  • Projector or interactive whiteboard
  • Laptop with database software (e.g., MySQL, SQLite)
  • Sample student table handout
  • Worksheet for primary‑key identification tasks
  • Whiteboard markers
Introduction:

Begin by asking students how everyday systems keep each item distinct, such as library cards or employee numbers. Review their prior knowledge of tables, fields, and records. Explain that today they will discover why primary keys are essential and how to choose one, with success measured by correctly identifying a primary key in a sample table.

Lesson Structure:
  1. Do‑now (5'): Students list everyday examples of unique identifiers.
  2. Mini‑lecture (10'): Define primary key, discuss why it is needed, and outline its characteristics.
  3. Guided demo (12'): Show the sample Students table in the DB, highlight StudentID as the primary key and demonstrate indexing.
  4. Group activity (15'): Teams examine a new table handout, decide on a suitable primary key, and justify their choice using the criteria.
  5. Whole‑class share (8'): Groups present their selections; teacher provides feedback and corrects misconceptions.
  6. Check for understanding (5'): Exit ticket – write one characteristic of a good primary key.
Conclusion:

Recap that primary keys uniquely identify records and enable reliable relationships across tables. Have students write one example of a primary key they could use in a personal project as an exit ticket. For homework, ask them to design a simple table, choose a primary key, and briefly explain their reasoning.