AQA · GCSE · Computer Science
Course version: 8525 · Version from Sept 2020
INSERT INTO table_name (column 1, column 2 …) VALUES (value 1, value 2 …)
Full specification wording
Structured query language (SQL): INSERT INTO table_name (column 1, column 2 …) VALUES (value 1, value 2 …)
This is the template for adding a record to a table.
Checked against the AQA 8525 specification (opens in a new tab) on .
- Point 7 of 10
Study notes
From the checked teaching notes for this specification point.
The idea
This is the template for adding a record to a table. INSERT INTO is followed by the table name, then a bracketed list of the columns you are filling, then the keyword VALUES, then a bracketed list of the values. The first value fills the first listed column, the second value fills the second column, and so on, so the two lists must be the same length and in matching order. Text values are wrapped in single quotes; numeric values are written plainly. For instance, INSERT INTO Book (BookID, Title, Price) VALUES (7, 'Dune', 9.99) adds one row. Omitting a column leaves it at its default or empty, and any value must suit that column's data type.
What earns the marks
- Places the table name immediately after INSERT INTO.
- Puts the column list in brackets before the VALUES keyword.
- Puts the value list in brackets after VALUES, matching the column order.
- Keeps the number of values equal to the number of listed columns.
- Quotes text values in single quotes and leaves numeric values unquoted.
- Ensures each value matches the data type of its column.
Common mistakes and how to put them right
Swapping the column list and value list positions.
Put it right: Columns come before VALUES, values after it.
Leaving out brackets around the lists.
Put it right: Both the column list and the value list need brackets.
Giving more values than columns (or fewer).
Put it right: The two lists must correspond one-to-one.
Quoting numbers or failing to quote text.
Put it right: Apply single quotes only to text and dates.
Exam tips
- Trace the template left to right: table, columns, VALUES, values.
- Check that each value's type matches the column it fills before selecting an answer.
- Watch for a missing VALUES keyword or missing brackets, which are common distractor errors.
Try the lesson
The start of the Structured query language (SQL): INSERT INTO table_name (column 1, column 2 …) VALUES (value 1, value 2 …) lesson, made from checked teaching notes for this specification point.
Have a go first
A table called Students has columns StudentID, FirstName and YearGroup. Which SQL command adds a new record with StudentID 42, FirstName 'Aisha' and YearGroup 10?
There is more to this lesson
The full lesson goes on to check your understanding and help you earn the marks. Create a free account to carry on, with your progress saved.
A week of Premium from your first lesson · Then the free plan continues · No card, no charge
Test your understanding of Structured query language (SQL): INSERT INTO table_name (column 1, column 2 …) VALUES (value 1, value 2 …)
Active recall beats re-reading. Take an instant quiz now to test what you’ve learned and lock it into long-term memory.
A week of Premium from your first lesson · Then the free plan continues · No card, no charge