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)
- FoundationA table holds 6 rows and 5 columns. How many records and how many fields does it have?
- FoundationThe student_id column of a student table has one duplicated value and one blank value. Can it be the primary key?
- IntermediateFor SELECT name, score FROM students WHERE form = ‘S5’ ORDER BY score DESC; how is the result ordered?
- IntermediateA table has 7 rows and 2 of them have NULL in phone. What do COUNT(*) and COUNT(phone) return?
- 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)?
- 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?
- Error redoWhat is wrong, in two places, with SELECT * WHERE form = S5 FROM students;?
- Error redoA table starts with 10 rows and DELETE FROM students WHERE form = ‘S1’; removes 3 of them. What remains?
- 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?
- 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.


