S6 ICT Databases and SQL, Paper 3: grouping, distinct values and precedence
Paper 3 uses six Student rows marked 78, 92, 65, 88, 54 and 73 to count 6, keep four rows above 70, average 75, total 450 and a spread of 38, then sorts 92 first, finds four rows between 60 and 90, groups two classes, keeps three distinct cities and repairs an OR with AND.
| 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 |
| # | Answer | One-line note |
|---|---|---|
| 1 | 6 | COUNT(*) counts rows, so six rows return 6. |
| 2 | 4 rows | The marks 78, 92, 88 and 73 pass, while 65 and 54 fail. |
| 3 | 75 | The six marks add to 450, and dividing by 6 gives 75. |
| 4 | 450 | Adding 78, 92, 65, 88, 54 and 73 gives 450. |
| 5 | 38 | The highest is 92 and the lowest 54, so the difference is 38. |
| 6 | The 92 mark | DESC sorts from largest to smallest, so the 92 mark comes first. |
| 7 | 4 rows | The marks inside the range are 78, 65, 88 and 73, while 92 and 54 fall outside. |
| 8 | 2 rows (3A has 3, 3B has 3) | GROUP BY folds equal classes into one group, so two classes give two rows, each counting 3. |
| 9 | 3 rows | DISTINCT removes duplicates, leaving just HK, KLN and NT, three different cities. |
| 10 | AND binds tighter than OR, so brackets are needed to get 2 rows | The AND part is evaluated first and then joined by OR, so brackets are needed to get the two high marks. |
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.

