Lesson Plan

Lesson Plan
Grade: Year 10 Date: 17/01/2026
Subject: Computer Science
Lesson Topic: Apply validation to fields in a database
Learning Objective/s:
  • Describe the purpose and common types of data validation in databases.
  • Explain how SQL constraints and triggers enforce validation rules.
  • Apply appropriate client‑side and server‑side validation techniques to a sample registration form.
  • Evaluate common pitfalls and select suitable validation strategies.
Materials Needed:
  • Projector or interactive whiteboard
  • Laptop with a MySQL (or similar) database installed
  • Sample HTML form files for the registration exercise
  • Worksheet with validation scenario questions
  • Access to an online code editor (e.g., Replit)
  • Printed checklist of validation rules
Introduction:

Begin with a quick poll: “What happens when you enter the wrong data into a form?” Connect this to previous lessons on database design and explain that today’s success criteria are to identify validation needs, implement them in SQL and HTML, and test their effectiveness.

Lesson Structure:
  1. Do‑now (5'): Students list examples of bad data they’ve encountered online.
  2. Mini‑lecture (10'): Overview of validation types and SQL constraints with short demo.
  3. Guided demonstration (15'): Build the student‑registration form, add HTML5 attributes, then create the corresponding SQL table and CHECK constraints.
  4. Pair activity (15'): Teams modify the form to add a trigger for a complex rule and test both client‑side and server‑side validation.
  5. Exit ticket (5'): Each student writes one validation pitfall to avoid and one best‑practice tip.
Conclusion:

Recap the hierarchy of validation—from UI checks to database constraints—and highlight how they work together to protect data integrity. Collect exit tickets and remind students to complete the homework worksheet, which asks them to design validation rules for a new inventory system.