/en-tutor-prep-s6-ict-database-sql-practice-2/
/en-tutor-prep-s6-ict-database-sql-practice-2/
英文版
3
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 ICT Databases and SQL, Paper 2: filtering, sorting and aggregates

S6 ICT Databases and SQL, Paper 2: filtering, sorting and aggregates

  • 2026-11-02

S6 ICT Databases and SQL, Paper 2: filtering, sorting and aggregates

Paper 2 uses a five-row Book table priced 120, 85, 150, 60 and 95 to count 5 rows, three rows above 90, an average of 102 and a total of 510, then a range of 90, D first when sorted ascending and three rows between 80 and 120.

Reminders Compare NULL with IS NULL, DELETE removes rows while DROP removes the table, and aggregates fold many rows into one value.

01 Paper details (check answers afterwards)

Item Detail
Questions 10
Suggested time 25
Difficulty mix Foundation 4 · Intermediate 3 · Challenge 2 · Error redo 1
Chapter Chapter: S6 ICT: Databases and SQL
Level S6

02 Questions (10 items)

  1. FoundationTable Book holds 5 rows. What does `SELECT COUNT(*) FROM Book;` return?
  2. FoundationPrices are A 120, B 85, C 150, D 60 and E 95. How many rows does `WHERE Price > 90` return?
  3. FoundationFor the same prices, what does `SELECT AVG(Price) FROM Book;` return?
  4. FoundationFor the same prices, what does `SELECT SUM(Price) FROM Book;` return?
  5. IntermediateFor the same prices, what does `SELECT MAX(Price) – MIN(Price) FROM Book;` return?
  6. IntermediateWhich book appears first in `SELECT Title FROM Book ORDER BY Price ASC;`?
  7. IntermediateFor the same prices, how many rows does `WHERE Price BETWEEN 80 AND 120` return?
  8. ChallengeHow do DELETE and DROP differ in SQL?
  9. ChallengeWhich SQL statement changes the values of existing rows?
  10. Error redoError repair: a student wrote `SELECT * FROM Book WHERE Price = NULL`. What is wrong?

03 Answers and one-line notes

# Answer One-line note
1 5 COUNT(*) counts rows, so five rows return 5 regardless of the column contents.
2 3 rows The prices 120, 150 and 95 are above 90, while 85 and 60 fail, so three rows remain.
3 102 The five prices add to 510 and dividing by 5 gives 102.
4 510 SUM adds the five prices, and 120 plus 85 plus 150 plus 60 plus 95 is 510.
5 90 The highest is 150 and the lowest 60, so the difference, the range, is 90.
6 D (priced 60) ASC sorts from smallest to largest, so D at 60 comes first.
7 3 rows The prices inside the range are 120, 85 and 95, while 150 and 60 fall outside.
8 DELETE removes matching rows and keeps the table; DROP removes the whole table DELETE removes rows and keeps the table, while DROP removes the table itself.
9 UPDATE with SET UPDATE with SET assigns new values, and WHERE limits the rows, otherwise the whole table changes.
10 NULL cannot be compared with equals; use IS NULL NULL means unknown, so any equals test against it is never true; use IS NULL or IS NOT NULL.

04 What to do after marking

  • After marking, redo only the wrong items and write down which step went wrong (formula, unit, or misread number).
  • Repeat the same item two days later; move to the next paper only when both attempts are correct.
  • Parents only need the answer and note columns; there is no need to explain every item.

Book an S6 ICT tutorTutor Registration →

Questions and answers are written originally by the TutorZone team and are not taken from any school, publisher or examination authority paper. Every value is checked by computer.

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