S6 ICT Databases and SQL Practice (Paper 2: Advanced)
- 2026-11-17
S6 ICT Databases and SQL Practice (Paper 2: Advanced)
Use one ten-row score table to practise COUNT, AVG, MAX, BETWEEN, DISTINCT, GROUP BY and JOIN row counts.
With aggregates, first ask what is being counted Paper 2 puts the aggregate functions on the same ten-row score table. COUNT(*) gives 10; Mark >= 60 matches 7 rows; the total is 694 so AVG gives 69.4; MAX is 90 and MIN is 45, a range of 45; BETWEEN 60 AND 80 includes both ends and matches 4 rows; ORDER BY DESC with LIMIT 3 returns 90, 88 and 81. DISTINCT returns unique values only, while GROUP BY forms groups that can then take aggregates. It ends with the Cartesian product 4 times 3 giving 12 rows versus an INNER JOIN, and corrects the trap that COUNT(column) skips NULLs.
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 | Advanced (S6 ICT) |
02 Questions (10 items)
- FoundationTen students score 58, 62, 71, 45, 88, 90, 66, 74, 59 and 81. What does SELECT COUNT(*) FROM Mark return?
- FoundationWith the same ten scores, how many rows does WHERE Mark >= 60 select?
- FoundationThe ten scores total 694. What does SELECT AVG(Mark) return?
- FoundationWhat do SELECT MAX(Mark) and MIN(Mark) return?
- IntermediateHow many rows does WHERE Mark BETWEEN 60 AND 80 select?
- IntermediateORDER BY Mark DESC with LIMIT 3 returns which three scores?
- ChallengeThe Class column holds only 6A, 6B and 6C. How many rows does SELECT DISTINCT Class return?
- ChallengeGROUP BY Class over 6A (3 rows), 6B (2 rows) and 6C (4 rows) produces how many groups?
- Error redoStudent has 4 rows and Mark has 3 rows. How many rows in the Cartesian product, and at most how many after INNER JOIN?
- Error redoA student uses COUNT(Mark) as the row count while two rows have a NULL Mark. Does that overcount or undercount?
03 Answers and one-line notes
| # | Answer | One-line note |
|---|---|---|
| 1 | 10. | COUNT(*) counts rows, so ten rows give 10. |
| 2 | 7 rows. | The qualifying scores are 62, 71, 88, 90, 66, 74 and 81, so seven. |
| 3 | 69.4. | The mean is the total over the row count: 694 divided by 10 gives 69.4. |
| 4 | 90 and 45. | The top score is 90 and the lowest is 45, so the range is 45. |
| 5 | 4 rows. | BETWEEN includes both ends, so 62, 71, 66 and 74 match. |
| 6 | 90, 88 and 81. | Sort from high to low first, then keep the first three rows. |
| 7 | 3 rows. | DISTINCT collapses repeats, so three class values give three rows. |
| 8 | 3 groups. | GROUP BY groups by column value, so three distinct classes give three groups. |
| 9 | The product has 12 rows, and INNER JOIN yields at most 12. | 4 times 3 is 12, and a JOIN condition can only cut the result down. |
| 10 | It undercounts. | COUNT(column) skips NULLs, so two NULL rows are missed and the result is 2 lower than COUNT(*). |
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 paper 2, move on to paper 3 for normalisation, NULL averages and multi-table JOINs.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.



