AQA GCSE Computer Science Paper 2, June 2025: question 20

A PrepWise guide to a real paper, with our descriptions and answers. Not made or approved by AQA.

PrepWise guide: AQA GCSE Computer Science Paper 2Question 2020 of 20

Figure 8 shows part of the data a teacher holds on students and their test results, in the tables Student and TestResult.

Figure 8
Two database tables: Student with four columns and TestResult with four columns.Open full size to read the labels (Figure 8, opens in a new tab)
20.1[2 marks]

Define the word relational database.

See how you would score on SQL

Our own questions on this topic, marked straight away, so you see what to revise. Free now.

Show model answer for 20.1Hide model answer for 20.1

A relational database is a database with more than one table, and the tables are linked together.

2 marks

How the marks are earned

  1. A database that has more than one table.
  2. The tables are linked together. The word database in place of table earns nothing.

Why it scores

One mark for having more than one table and one mark for the tables being linked.

Revise SQL
20.2[2 marks]

Define the word foreign key.

See how you would score on SQL
Show model answer for 20.2Hide model answer for 20.2

A foreign key is a field of one table whose values come from the primary key of a different table, and that is how the tables are linked.

2 marks

How the marks are earned

  1. A field held in one table. Writing database where table is meant earns nothing.
  2. That field is the primary key of a different table. The reverse wording, a primary key whose values also appear as a field of another table, earns both marks.

Why it scores

One mark for the field being in one table and one mark for it being the primary key of another table.

Revise SQL
20.3[1 mark]

State which field of the TestResult table in Figure 8 is its primary key.

See how you would score on SQL
Show model answer for 20.3Hide model answer for 20.3

TestResultID. Each value is different, so it identifies one test result. StudentID cannot be the key because a student can appear in many results.

1 mark

How the marks are earned

  1. TestResultID. Case and spacing are ignored.
Revise SQL
20.4[6 marks]

Write an SQL query on Figure 8 returning only first name, last name and Biology score for GCSE Year 1 students, highest score first.

See how you would score on SQL
Show model answer for 20.4Hide model answer for 20.4
SELECT FirstName, LastName, Score
FROM Student, TestResult
WHERE Student.StudentID = TestResult.StudentID
AND GCSEYear = 1
AND Subject = 'Biology'
ORDER BY Score DESC
SELECT FirstName, LastName, Score
FROM Student INNER JOIN TestResult
ON Student.StudentID = TestResult.StudentID
WHERE GCSEYear = 1 AND Subject = 'Biology'
ORDER BY Score DESC
6 marks

How the marks are earned

  1. Mark A: the SELECT clause has only the three correct fields.
  2. Mark B: the FROM clause names one of the two tables correctly.
  3. Mark C: the second correct table in the FROM clause, or a correct INNER JOIN with ON. Writing INNERJOIN or just JOIN is accepted. The FROM clause must be fully correct.
  4. Mark D: the WHERE clause holds one correct condition.
  5. Mark E: all the correct conditions, joined correctly with AND. In the comma form this includes the StudentID match; in the INNER JOIN form that match is in ON and WHERE needs only the other two.
  6. Mark F: a correct ORDER BY clause, with no other ORDER BY.
  7. With any error in the code the maximum is 5 marks. A mistake of one kind repeated through the query costs one mark only: a swapped key word that still makes sense, a misspelt field name, stray characters such as colons, a field before a table, == for =, or wrong brackets. Table names before field names are fine when correct; single or double quotes round Biology are fine; quotes round 1, correctly formatted brackets round field and table names, case and small misspellings (not of SQL key words) are ignored.

Why it scores

SELECT picks the three fields. FROM names both tables, and the first condition in WHERE matches each result to its student. The other two conditions keep Year 1 students and Biology, and ORDER BY Score DESC puts the highest score first.

This is the same query written with a join. The ON part holds the matching condition, so both forms earn full marks.

Revise SQL
20.5[2 marks]

Mark's result T03 should read 28. Query: line 1 A TestResult; line 2 SET B; line 3 WHERE TestResultID = 'T03'. State A and B.

See how you would score on SQL
Show model answer for 20.5Hide model answer for 20.5

A: UPDATE B: Score = 28

2 marks

How the marks are earned

  1. A is UPDATE. Case and spacing are ignored; any spelling mistake earns nothing.
  2. B is Score = 28. Quotes round 28 are accepted; case and spacing are ignored; any spelling mistake earns nothing.

Why it scores

UPDATE changes records already in the table, and SET Score = 28 gives the new value, with WHERE limiting the change to test T03.

Revise SQL
AQA owns the copyright in its exam questions, so we cannot copy their wording. These descriptions and answers are ours. Not made or approved by AQA.[13 marks]