/en-tutor-prep-s5-ict-databases-sql-practice-4/
/en-tutor-prep-s5-ict-databases-sql-practice-4/
英文版
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

S5 ICT: Relational Databases and SQL – Practice Paper 4 (Error Redo, 10 Questions)

S5 ICT: Relational Databases and SQL – Practice Paper 4 (Error Redo, 10 Questions)

  • 2026-11-05

S5 ICT: Relational Databases and SQL – Practice Paper 4 (Error Redo, 10 Questions)

Paper four is error redo only: clause order, quoting text values, LIKE prefixes and suffixes, aggregates versus DISTINCT, indexes and sorting – ten items with answers and one-line notes.

Quick answer Most SQL marks are lost on clause order, quotes and data types rather than on hard syntax.

01 Paper details (check answers afterwards)

Item Detail
Questions 10 questions
Suggested time 25 minutes
Difficulty mix Foundation 2 · Intermediate 2 · Challenge 2 · Error redo 4
Chapter Chapter: S5 ICT | Relational Databases and SQL
Level Error redo

02 Questions (10 items)

  1. FoundationA table holds 6 rows and 5 columns. How many records and how many fields does it have?
  2. FoundationThe student_id column of a student table has one duplicated value and one blank value. Can it be the primary key?
  3. IntermediateFor SELECT name, score FROM students WHERE form = ‘S5’ ORDER BY score DESC; how is the result ordered?
  4. IntermediateA table has 7 rows and 2 of them have NULL in phone. What do COUNT(*) and COUNT(phone) return?
  5. ChallengeThe orders table has 5 orders covering only 3 distinct customer_id values. After an equi-join with customers, how many rows result, and what is COUNT(DISTINCT customer_id)?
  6. ChallengeAn unindexed table of 10 000 rows is queried by equality. How many row comparisons in the worst case, and roughly how many with an index?
  7. Error redoWhat is wrong, in two places, with SELECT * WHERE form = S5 FROM students;?
  8. Error redoA table starts with 10 rows and DELETE FROM students WHERE form = ‘S1’; removes 3 of them. What remains?
  9. Error redoOf 8 names, 3 begin with A and 2 end with A. How many does LIKE ‘A%’ return, and how many does LIKE ‘%A’ return?
  10. Error redoScores are stored as text values 10, 9 and 100. How does text ordering differ from numeric ordering?

03 Answers and one-line notes

# Answer One-line note
1 6 records and 5 fields; each row is one record, each column is one field or attribute. Rows are records and columns are fields; do not mix the two counts.
2 No. A primary key must be unique and never null; a duplicate or a blank both break that rule. Check uniqueness and non-null before choosing any column as a key.
3 Only S5 students, listed from the highest score to the lowest; DESC means descending and the default is ASC. WHERE filters rows; ORDER BY only sets the order.
4 COUNT(*) returns 7 and COUNT(phone) returns 5; counting a column skips NULL values. Use COUNT(*) for rows and COUNT(column) for how many values are actually filled in.
5 Still 5 rows, one per order, and COUNT(DISTINCT customer_id) is 3. A join does not merge repeated customers into one row; count distinct customers with DISTINCT.
6 10 000 comparisons without an index, about 14 with a balanced index, since 2 to the power 14 is 16 384. An index turns a full scan into repeated halving, and the gap widens as the table grows.
7 The order is wrong, WHERE must follow FROM, and the text value S5 needs single quotes. Keep the fixed order SELECT, FROM, WHERE, ORDER BY, and always quote text values.
8 7 rows, with the table structure and column definitions untouched; only DROP TABLE removes the table itself. DELETE removes rows, DROP removes the whole table; the damage is very different.
9 LIKE ‘A%’ returns 3 and LIKE ‘%A’ returns 2; % stands for any run of characters, and its position sets prefix or suffix. Percent first matches endings, percent last matches beginnings.
10 Text ordering gives 10, 100, 9 because characters are compared one by one, while numeric ordering gives 9, 10, 100. Store numbers in numeric columns, or sorting and comparisons both go wrong.

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.

Find a tutor freeTutor 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 →