This resource focuses on 3.7.2 SQL insert, update and delete within AQA GCSE Computer Science. Students need more than vague familiarity here. They need to recognise what each command does, write valid syntax, and spot when a query would change the wrong records. In the specification, this sits within relational databases and structured query language, so it connects directly to tables, fields, records, and the practical management of stored data.
For teaching, the challenge is usually not the basic idea of adding, editing, or removing data. It is the precision. One missing quote or one absent WHERE, and suddenly the whole table has had a very bad lesson. This page gives you a classroom-ready guide to the exact knowledge students need, along with practical marking guidance so you can reward secure understanding rather than lucky syntax.
At a Glance
๐งญ Specification context
This topic sits within AQA GCSE Computer Science 3.7.2 Structured query language (SQL).
The focus here is on commands that change data in a relational database.
Students are expected to understand the purpose and syntax of
INSERT,UPDATE, andDELETE.Students must know
how
INSERT INTO ... VALUES ...adds a new recordhow
UPDATE ... SET ... WHERE ...changes existing datahow
DELETE FROM ... WHERE ...removes recordswhy
WHEREmatters when only specific records should be changedCommon exam focus
writing correct SQL syntax
identifying the effect of a command
spotting unsafe queries that would affect too many records
Typical student challenges
confusing fields with records
forgetting
WHEREinUPDATEorDELETEmixing up
INSERT INTOandUPDATEmismatching field names, values, quotes, or brackets
Understanding the Topic
SQL is used to work with data stored in relational database tables. In this part of the AQA course, students need to understand how data is added, changed, and removed. The command matters because each one performs a different job, and exam questions often hinge on that difference.
INSERT INTO
Use INSERT INTO when a new record needs to be added to a table.
INSERT INTO Students (StudentID, Name, Grade)
VALUES (1042, 'Amira Khan', 'B')
Teachers should stress that:
- the table name must be correct
- the field list and value list must match in number and order
- this command creates a new row, not an edit to an existing one
UPDATE
Use UPDATE when data in an existing record needs to be changed.
UPDATE Students
SET Grade = 'A'
WHERE StudentID = 1042
Teachers should stress that:
SETidentifies the field or fields being changedWHEREidentifies which record or records should be changed- if
WHEREis omitted, every record in the table may be updated
DELETE
Use DELETE when one or more existing records need to be removed.
DELETE FROM Students
WHERE StudentID = 1042
Teachers should stress that:
DELETE FROMremoves whole records, not single field valuesWHEREis essential when the question is targeting a specific record- without
WHERE, the query may remove all records from the table
What students need to secure
- the difference between new data and existing data
- the relationship between table names, field names, and values
- the effect of a condition in
WHERE - the idea that SQL must be precise, even when the command itself looks familiar
๐ก Teacher tip
Have students read each line of a query aloud in plain English.
UPDATE Studentsmeans which table?
SET Grade = 'A'means what changes?
WHERE StudentID = 1042means which record only?This slows the syntax down just enough to stop guesswork.
Key Terms and Concepts
| Term | Explanation |
|---|---|
| SQL | Structured Query Language, used to query and manage data in a relational database. |
| Table | A collection of related data arranged in rows and columns. |
| Record | A single row in a table. |
| Field | A column in a table that stores one type of data. |
INSERT INTO |
The command used to add a new record to a table. |
VALUES |
The clause that supplies the data to be inserted. |
UPDATE |
The command used to change data already stored in a table. |
SET |
The clause used with UPDATE to name the field or fields that will change. |
DELETE FROM |
The command used to remove one or more records from a table. |
WHERE |
The clause that limits a command to records matching a condition. |
| Condition | A test used in WHERE to decide which record or records are affected. |
How to Teach This Topic
Suggested teaching sequence
- Start with a visible paper table or projected table.
- Ask students whether the task is to add, change, or remove data.
- Match each action to the correct SQL command.
- Model one complete example at a time.
- Finish with "What would happen if
WHEREwere missing?" checks.
Classroom moves that work well
- colour-code table name, field name, value, and condition
- get students to annotate queries with "does what?" notes above each line
- use mini whiteboards for quick syntax corrections
- give students broken queries and ask them to repair them
- contrast two near-identical commands so students must explain the difference
Discussion prompts and scaffolds
- Which command would you use if the record already exists?
- Which part of the query tells the database where to look?
- What is the risk of leaving out
WHERE? - Is this command changing one field or removing the whole record?
- Can students translate the SQL into plain English before writing their own?
Scaffolding ideas
- give sentence frames such as "To add a new record, I start with..."
- provide a table diagram beside every first attempt
- keep field names short at first, then increase complexity
- use sorting cards with command parts that students assemble into a correct query
Extension activities
- ask students to correct queries containing more than one mistake
- give a database scenario and ask students to choose between
INSERT,UPDATE, andDELETE - challenge students to explain why two commands with similar wording would have different effects
๐งช Useful classroom check
If a student can explain whyUPDATEis wrong for a new record and whyINSERT INTOis wrong for an existing one, understanding is usually much more secure.
How to Mark This Topic Effectively
When marking SQL responses, reward the right command for the task first. After that, look for precise control over the table, field, value, and condition.
Strong answers usually
- choose the correct command immediately
- name the correct table
- use the correct field name in
SETor the field list inINSERT INTO - use values in a sensible order
- include
WHEREwhen a specific record is targeted - show that the student understands the effect of the query
Weaker answers often
- use
INSERT INTOwhen the question asks to edit existing data - forget
FROMafterDELETE - miss out the field name after
SET - omit
WHEREand accidentally affect every record - copy field names inaccurately from the question
- confuse removing a record with clearing a field value
| What to reward | What to watch carefully |
|---|---|
| Correct command selection for the scenario | A correct-looking query that performs the wrong task |
| Accurate table and field names | Invented or altered field names |
Secure use of SET, VALUES, and WHERE |
Missing clauses that make the query unsafe or incomplete |
| Awareness of the effect of the query | Answers that appear memorised but are not understood |
๐ Exam technique reminder
If the question identifies one named record, a missingWHEREshould normally lose credit for control and accuracy, even if the rest of the command is correct. It is the database equivalent of writing the right answer in the wrong box.
Example Student Responses
Example question
Write an SQL statement to change the Grade of the student with StudentID = 1042 to B. [4 marks]
Marking guidelines
| Mark point | What earns the mark |
|---|---|
| 1 | Uses UPDATE with the correct table name |
| 2 | Uses SET Grade = 'B' or equivalent correct field and value |
| 3 | Uses a correct WHERE clause targeting StudentID = 1042 |
| 4 | Produces a complete query with the correct overall structure |
Strong response
UPDATE Students
SET Grade = 'B'
WHERE StudentID = 1042
- Award: 4/4
- The student has selected the correct command for editing existing data.
- The field being changed is identified accurately.
- The
WHEREclause limits the change to the correct record. - This is precise, safe, and fully aligned with the task.
Weak response
UPDATE Students
SET Grade = 'B'
- Award: 2-3/4, depending on the mark scheme wording used in class.
- Reward the correct command and the correct field/value change.
- Do not award full credit because the missing
WHEREmeans every record in the table could be changed. - This is a very common near-miss and worth flagging explicitly in feedback.
Practice Questions
- A table called
Bookshas the fieldsBookID,Title, andAuthor. Write an SQL statement to add a new book with the values301,'Code Breakers', and'T Patel'. [3 marks]- Marking guidelines: reward correct use of
INSERT INTO, a correct field list, and a correctVALUESlist in matching order.
- Marking guidelines: reward correct use of
- A table called
Studentsincludes the fieldsStudentIDandHouse. Write an SQL statement to change theHouseof the student withStudentID = 2005to'Red'. [4 marks]- Marking guidelines: reward correct use of
UPDATE,SET, the new value, and a correctWHEREclause.
- Marking guidelines: reward correct use of
- A table called
Orderscontains a record withOrderID = 8801that should be removed. Write the SQL statement needed. [4 marks]- Marking guidelines: reward correct use of
DELETE FROM, the correct table name, and aWHEREclause targeting the correct record. Penalise omission ofWHERE.
- Marking guidelines: reward correct use of
- Explain why
WHEREis important when usingUPDATEorDELETE. [2 marks]- Marking guidelines: credit answers that explain it identifies which record or records are affected and prevents all records from being changed or deleted.
- A student writes
INSERT INTO Students SET Grade = 'A'. Explain what is wrong with this command. [3 marks]- Marking guidelines: reward recognition that
INSERT INTOis used to add a new record,SETbelongs withUPDATE, and the command structure does not match the task.
- Marking guidelines: reward recognition that
Common Misconceptions
UPDATEadds a new record.- Quick correction:
UPDATEchanges existing data.INSERT INTOadds new data.
- Quick correction:
DELETEremoves one field value.- Quick correction:
DELETE FROMremoves the whole record that matches the condition.
- Quick correction:
WHEREis just extra detail.- Quick correction:
WHEREcontrols which record is affected. Without it, the whole table may be changed.
- Quick correction:
- Field names and values can be swapped around freely.
- Quick correction: field names identify where the data goes. Values are the actual data being inserted or used.
- If the SQL looks familiar, it is probably fine.
- Quick correction: exam questions reward exact syntax and correct effect, not close-enough guesses.
FAQ
Do students need to memorise the exact SQL syntax?
Yes. Students should be able to recognise and write the standard structure for INSERT INTO, UPDATE, and DELETE. Minor variations may exist in real systems, but GCSE questions reward secure use of the expected command pattern.
Should students always use `WHERE` with `UPDATE` and `DELETE`?
If the task targets specific data, yes. In exam questions, omitting WHERE is usually a strong sign that the student does not understand how the query controls which records are affected.
Do students lose marks for incorrect capital letters in SQL?
Capital letters usually improve readability, but accuracy of the command structure matters more than styling. A correct lower-case answer is still showing the right understanding unless your classroom routine says otherwise.
How can I help students stop mixing up `INSERT INTO` and `UPDATE`?
Keep returning to the same decision question: Is this a new record or an existing one? If students answer that first, they are much more likely to choose the correct command.
What is the best way to check whether students really understand the query?
Ask students to describe the effect of the query in plain English. If they can explain exactly what would happen to the table, they usually understand the syntax well enough to use it accurately.
Save time on the marking that follows
โ Marking.ai helps teachers move from practice response to feedback much faster, without losing clarity.
spot recurring SQL misconceptions across a class
keep feedback consistent on syntax and exam technique
spend less time decoding answers and more time improving them