Lesson Plan

Lesson Plan
Grade: Date: 17/01/2026
Subject: Computer Science
Lesson Topic: Write an SQL script to query or modify data (DML) which are stored in (at most two) database tables
Learning Objective/s:
  • Describe the purpose of DDL and DML statements in relational databases.
  • Write CREATE TABLE and ALTER TABLE commands for up to two related tables.
  • Construct INSERT, UPDATE, DELETE, and SELECT statements—including an INNER JOIN—to manipulate data.
  • Apply referential‑integrity constraints when designing DML scripts.
  • Identify and correct common errors such as missing WHERE clauses or broken foreign keys.
Materials Needed:
  • Projector or interactive whiteboard
  • Computer lab with an SQL IDE (e.g., MySQL Workbench)
  • Printed handout of the Student and Enrolment table definitions and sample script
  • Whiteboard and markers
  • Access to a sample database containing the two tables
Introduction:

Begin with a quick recall question: “What’s the difference between defining a table and changing its data?” Students will link this to their previous work on relational models. Explain that today they will create a complete DML script for two linked tables and will be judged on whether the script runs without errors and meets the success criteria of correct data manipulation and proper use of joins.

Lesson Structure:
  1. Do‑now (5 minutes): Students answer three short questions on DDL vs DML on a sticky‑note exit ticket.
  2. Mini‑lecture (10 minutes): Review DDL statements, demonstrate CREATE TABLE for Student and Enrolment, emphasise the foreign‑key relationship.
  3. Guided practice (15 minutes): Teacher models INSERT statements for both tables; students work in pairs to write and run the same inserts.
  4. Hands‑on activity (20 minutes): Students extend the script by adding an UPDATE, a DELETE, and a SELECT with an INNER JOIN; teacher circulates to address misconceptions.
  5. Check for understanding (5 minutes): Quick Kahoot quiz on common pitfalls (e.g., DELETE without WHERE).
  6. Reflection & exit ticket (5 minutes): Each student writes one tip to avoid a common DML error and submits it.
Conclusion:

Summarise how DDL sets the stage for DML and how the join query ties the two tables together. Collect the exit‑ticket tips as a formative check and assign homework: students must create a similar script for a new pair of tables (e.g., Teacher and Class) and bring it to the next lesson.