Question Constellation Sign up for free

AQA · GCSE · Computer Science · Higher

SQL UPDATE query construction

Q18.6 3 marks

The film with the title Toy Story 3 has been entered incorrectly into the database and should have the title Toy Story 4.

Figure 8 – Film
FilmIDTitleYear
100Forrest Gump1994
101Toy Story 32019
102Back to the Future1985

Write the SQL to make this change.

Write your answer first. You can study the marking guidance whenever you need it.

Study the marking See what earns credit and compare it with a full-mark answer.

Marking points

  1. 1 Uses UPDATE Film.
  2. 2 Sets Title to 'Toy Story 4'.
  3. 3 Selects the exact record with either WHERE FilmID = 101 or WHERE Title = 'Toy Story 3'.

Full-mark answer

UPDATE Film SET Title = 'Toy Story 4' WHERE Title = 'Toy Story 3'

Why this answer loses marks

I supplied the new value but omitted the row filter.

Without a filter condition, the update is not restricted to the one incorrect record.