| Lesson Plan |
| Grade: |
Date: 03/03/2026 |
| Subject: Computer Science |
| Lesson Topic: Understand and identify suitable primary keys |
Learning Objective/s:
- Describe the purpose and characteristics of primary keys in a relational database.
- Differentiate between natural, surrogate, and composite primary keys.
- Evaluate criteria (uniqueness, non‑null, stability, simplicity) to select an appropriate primary key.
- Apply the selection process to design primary keys for given table scenarios.
|
Materials Needed:
- Projector or interactive whiteboard
- Slides on primary key concepts
- Sample database schema handouts
- Laptop computers with a DBMS (e.g., MySQL) installed
- Worksheets with practice questions
- Sticky notes for quick brainstorming
|
Introduction:
Begin with a quick poll: “What unique identifier could you use to distinguish each student in a class?” Connect this to prior learning on tables and records, reminding students that every table needs a single, reliable identifier. Explain that today they will learn how to choose a primary key that meets key criteria and will practice applying it to real‑world examples. Success will be demonstrated by correctly justifying primary key choices in the exit ticket.
|
Lesson Structure:
- Do‑Now (5') – Students list possible identifiers for a given dataset on sticky notes; share quick examples.
- Mini‑lecture (10') – Define primary key, review characteristics, and compare natural, surrogate, composite keys using slides.
- Guided analysis (12') – Examine the provided Students table; pairs evaluate each field against the criteria, then discuss as a class.
- Hands‑on activity (15') – In the computer lab, learners create a simple MySQL table and declare a primary key, experimenting with auto‑increment and composite keys.
- Practice questions (10') – Individually answer three scenario questions; teacher circulates to check reasoning.
- Check for understanding (5') – Whole‑class review of answers, highlighting common pitfalls and reinforcing the selection checklist.
|
Conclusion:
Summarise the four key criteria that make a field suitable as a primary key and revisit the checklist created earlier. For the exit ticket, students write one primary key choice for a new scenario and justify it in one sentence. Assign homework to read the textbook section on indexing and prepare a short paragraph on how primary keys affect query performance.
|