/en-tutor-prep-s6-term1-ict-database-sql/
/en-tutor-prep-s6-term1-ict-database-sql/
General Inquiry: info@TutorZone.com.hk
Office Hours: Monday to Saturday - 9:00 AM to 6:00 PM
WhatsApp Monday to Sunday - 24 hours
Hotline: +852 6828 1809
Instant Support: +852 9061 3106

S6 Term 1 | ICT: Databases and SQL Queries (Normalisation, Keys and Indexes) — Tutor Lesson Plan | 45-minute flow, teaching script, common errors, practice with answers

S6 Term 1 | ICT: Databases and SQL Queries (Normalisation, Keys and Indexes) — Tutor Lesson Plan | 45-minute flow, teaching script, common errors, practice with answers

  • 2026-12-01

Tutor lesson plan · S6 Term 1 ICT

Database marks sit in two places: the order of SQL clauses, and the reasoning behind the design. Students can write a SELECT but put HAVING before GROUP BY and treat an index as always faster, which costs half the question. This lesson uses one query and one table to fix the order and the cost.

Lesson objectives Students can: (1) divide 75 minutes by 100 marks for 45 seconds a mark and place the 34-mark database part at 25.5 minutes, with 6.25 minutes a question; (2) write the six clauses of a SELECT in order and explain that WHERE filters rows before grouping while HAVING filters groups after; (3) explain what an index buys on 1,000,000 rows, cutting 1,000,000 comparisons to 20, and what it costs on writes.

01 Prior knowledge check (first 3 minutes)

If any of these is missing, fix it before the lesson:

Skill Quick check Pass standard
Primary key Which column uniquely identifies a student The student number
Basic SQL How to select only the name column SELECT name FROM students
Logarithms Two to what power is about one million About 20

02 Lesson flow (45 minutes)

Time Stage Tutor does Student does
0-5 min Diagnose Ask how WHERE differs from HAVING Most say both filter, none give the order
5-15 min Read the paper 75 minutes over 100 marks, then the three parts Students get 25.5, 24 and 6.25 minutes
15-25 min SQL skeleton Six clauses in order, conditions added one at a time Students write a query as six lines
25-35 min Normalisation One wide table split into three, with keys named Students find repetitions and name an anomaly
35-42 min Index cost Linear against binary on a million rows Students get 20 and state the write cost
42-45 min Exit check Three questions, collect the scripts Oral answers

03 Teaching script (read it aloud)

Act one: the paper and the SQL skeleton

Say this: “100 marks in 75 minutes is 45 seconds a mark. The three parts of 34, 34 and 32 become 25.5, 25.5 and 24.0 minutes, adding to 75, and 12 questions average 6.25 minutes. A ten-mark SQL question still deserves seven minutes.”
The skeleton: “SELECT the columns, FROM the table, WHERE the row condition, GROUP BY the group, HAVING the group condition, ORDER BY the sort. Six positions, never reordered. WHERE filters rows before grouping; HAVING filters groups after.”
One example: “Select class, count of students and average score from students, grouped by class, keeping classes with five or more, ordered by average score descending. That answers how many and how well, class by class, for the large classes only.”

Students repeat: WHERE before grouping, HAVING after, ORDER BY last.

Act two: normalisation is about anomalies, not steps

Draw the wide table: “One table holding student number, name, subject, teacher and office, 5 columns. The same subject repeats the teacher and office, so one change means many edits, an update anomaly. A new subject with no students cannot be recorded, an insert anomaly. Delete the last student and the subject disappears, a delete anomaly.”
Three tables: “Students for number and name, subjects for subject, teacher and office, and enrolment for number and subject. From 5 columns to 3 tables, repetition gone, one key each, and enrolment joins the other two with two foreign keys.”
Foreign keys: “Referential integrity means the student number in enrolment must exist in students. Allow it and you get orphan rows that never match in a report.”

Most common misconception: that more tables always score better. Normalisation exists to remove anomalies; split until every query needs five joins and it slows down. The question asks about anomalies and keys, not table count.

Students do: circle the repeated teacher and office in the wide table, then draw three tables and the two links.

Students repeat: normalisation removes update, insert and delete anomalies, and foreign keys keep referential integrity.

Act three: what an index costs

Do the arithmetic: “On 1,000,000 rows with no index, the worst case compares every row, 1,000,000 times. An index halves the range each step, and two to the twentieth is about a million, so 20 comparisons. That is fifty thousand times fewer.”
Join cost: “Tables of 100 and 1,000 rows without a join condition give a Cartesian product of 100,000; with the key equality it is the 100 matching rows. A missing join condition is the commonest way a query explodes.”
The cost: “An index speeds reads but every insert, update and delete must maintain it, so writes slow and storage grows. Index the columns you search, not every column.”

Students repeat: an index turns linear into binary but slows writes, and a missing join condition gives a Cartesian product.

04 Question types and steps

Type Example Steps Answer
SQL query Students per class with an average score, large classes only Write the six clauses in order, adding one condition at a time class, count, average, HAVING count of five or more
Normalisation One wide table of five columns Find repetition, name an anomaly, split, name keys Students, subjects and enrolment
Indexes and performance A table of a million rows Compare linear and binary, state the write cost 1,000,000 against 20
Data validation Input field checks Range, type, presence and format, one example each Age from 0 to 120, an email with an at sign
S6 ICT: 12 questions in 75 minutes, 6.25 each, with the SQL skeleton and what an index buys25.534 mdata25.534 mdatabase and SQL2432 mnetworksSELECTFROMWHEREGROUP BYHAVINGORDER BYthe order matters: WHERE before grouping, HAVING after1,000,000no index20indexed45 seconds a mark; 75 minutes over 12 questions is 6.25 minutes eachSELECT fields FROM table WHERE condition GROUP BY field HAVING filter ORDER BY field100 rows times 1,000 rows is a Cartesian product of 100,000; joined on a key it is 100a linear search runs 1,000,000 comparisons against 20 for binary, 50,000 times fewera primary key is unique and not null; a foreign key keeps referential integrity; an index speeds reads but slows writes

Top: parts of 34, 34 and 32 marks at 45 seconds a mark give 25.5, 25.5 and 24.0 minutes, adding to 75, with 6.25 minutes a question. Bottom left: the five clauses of a SELECT in order. Bottom right: on 1,000,000 rows an unindexed search scans 1,000,000 times, while a binary search takes 20.

Sanity check (must teach):SQL clauses never reorder: WHERE before GROUP BY, HAVING after, ORDER BY last. Normalisation removes anomalies rather than maximising tables. An index speeds reads and slows writes. A join without a condition returns the product of the two row counts.

05 Three independent practice questions

Question Answer What to observe
On a million rows with no index, how many comparisons in the worst case? 1,000,000 Whether students take the row count as the comparison count
With a binary-search index, about how many? 20 Whether students use two to the twentieth is about a million
Tables of 100 and 1,000 rows with no join condition give how many rows? 100,000 Whether students multiply rather than add

06 Common errors and correction lines

Error Student usually writes Tutor says
Putting HAVING before GROUP BY Select the count, then HAVING, then GROUP BY Groups must exist before you filter them: GROUP BY first, then HAVING.
Filtering an aggregate with WHERE WHERE count of students is more than five WHERE sees rows, not aggregates; conditions on aggregates belong in HAVING.
Assuming every index helps Index every column and it will be fastest An index speeds reads but must be maintained on every write, so write-heavy tables get slower.
A join with no condition List both tables in FROM and select Without the key equality you get a Cartesian product, 100 times 1,000, so 100,000 rows.

07 Homework (paper and question numbers)

08 Exit check (last 3 minutes)

Question Answer Verdict
Which runs first, WHERE or HAVING? WHERE, before grouping Wrong means reteach act one
About how many steps does an index need on a million rows? 20 Wrong means reteach the logarithm
What does a join without a condition produce? A Cartesian product Wrong means reteach join conditions

09 Tutor FAQ

Which year is this for?

S6 Term 1 mainly; S5 students who know basic SQL can use it for integration practice.

Must students memorise full SQL syntax?

Only the six clauses and their keywords; the detail can be looked up, but the split between WHERE and HAVING must be certain.

Is there a paper to go with it?

Yes. The homework section links to the S6 ICT paper, three parts and 12 questions in 75 minutes, with answers and marking points.

Find a tutor freeTutor sign-up →

©2026 TutorZone · www.tutorzone.com.hk · Terms of use · All rights reserved. Original TutorZone material for personal study and teaching only; not for resale or republication.

Take this guide with you

Reading the full guide is free. Downloading the print version, printing it for students, or taking a whole-level pack needs a tutor account (free).

Registered tutors also get:

Register as a tutor — freeAlready registered? Log in

Join as a tutor or coach — academic, music, sports, arts, STEM. Free to register. See how it works →