S6 ICT Databases and SQL Practice (Paper 4: Retry)
- 2026-11-17
S6 ICT Databases and SQL Practice (Paper 4: Retry)
Retry the ten most common mistakes: COUNT and NULL, WHERE versus HAVING, AND versus OR, JOIN conditions, DELETE versus DROP.
The mistakes usually fall into a few groups Paper 4 retries the familiar errors. SELECT * returns rows while COUNT(*) returns a number; WHERE runs before GROUP BY and HAVING after it; NULL makes COUNT(column) and AVG differ from COUNT(*). ASC sorts smallest first, AND binds tighter than OR so brackets are needed. A JOIN condition can sit in ON or WHERE for INNER JOIN, but LEFT JOIN needs it in ON. A primary key is never NULL and there is one per table, while UNIQUE allows NULL and repeats. DELETE removes rows, DROP removes the table. The final item corrects the invalid SUM(*) syntax.
01 Paper details (check answers afterwards)
| Item | Detail |
|---|---|
| Questions | 10 |
| Suggested time | 25 |
| Difficulty mix | Foundation 4 · Intermediate 2 · Challenge 2 · Error redo 2 |
| Chapter | Chapter: S6 ICT: Databases and SQL |
| Level | Retry (S6 ICT) |
02 Questions (10 items)
- FoundationA table has 30 rows. What do SELECT * and SELECT COUNT(*) give?
- FoundationDoes WHERE come before or after GROUP BY?
- FoundationOf four rows two have NULL Mark. What are COUNT(*) and COUNT(Mark)?
- FoundationTen scores total 694. What is AVG(Mark)?
- IntermediateWith scores 45, 58, 59, 62, 66, 71, 74, 81, 88 and 90, which score is first after ORDER BY Mark ASC?
- IntermediateIn WHERE Class = ‘6A’ OR Class = ‘6B’ AND Mark >= 60, which is evaluated first, AND or OR?
- ChallengeIn SELECT … FROM A INNER JOIN B ON A.ID = B.AID, does the match condition belong in ON or WHERE?
- ChallengeHow does a primary key differ from a UNIQUE key?
- Error redoHow do DELETE FROM Student; and DROP TABLE Student; differ?
- Error redoA student writes SUM(*) instead of COUNT(*). What is wrong?
03 Answers and one-line notes
| # | Answer | One-line note |
|---|---|---|
| 1 | Thirty rows, and the number 30. | SELECT * returns all rows; COUNT(*) returns a single number. |
| 2 | Before. | WHERE filters rows first, GROUP BY then groups them, and HAVING filters the groups. |
| 3 | 4 and 2. | COUNT(*) counts rows; COUNT(column) skips NULL. |
| 4 | 69.4. | 694 divided by 10 gives 69.4, and AVG divides by the number of non-NULL rows. |
| 5 | 45. | ASC runs from smallest to largest, so the lowest comes first. |
| 6 | AND is evaluated first. | AND binds tighter than OR, so brackets are needed to express the intuitive reading. |
| 7 | For INNER JOIN the result is the same, but ON is clearer; for LEFT JOIN it must go in ON. | Putting a LEFT JOIN condition in WHERE filters out the unmatched rows, which turns it into an INNER JOIN. |
| 8 | A primary key cannot be NULL and there is only one per table; UNIQUE may hold NULL and several are allowed. | Both demand uniqueness; they differ on NULL and on how many are allowed. |
| 9 | DELETE removes rows and keeps the table; DROP removes the table itself. | After DELETE you can still INSERT; after DROP you must CREATE TABLE again. |
| 10 | Wrong. SUM works on numeric columns only, and counting rows needs COUNT(*). | SUM(*) is not valid syntax; SUM must name a numeric column. |
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.
After all four papers, revisit the table and SQL examples on the chapter page, then use the same pattern on the next chapter.Tutor 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.



