CREATE TABLE and INSERT INTO
SQL command that builds a new table by naming its fields and their data types, such as a PRIMARY KEY. INSERT INTO ... VALUES then adds one record to that table.
Understanding CREATE TABLE and INSERT INTO in VCE Spreadsheets, SQL & Visualisation
What it does: PRIMARY KEY is written after the field's data type inside CREATE TABLE to make that field unique for each record. The number 2 has no quotes but the text 'Rex' does, matching the INT and TEXT types of the fields. The table has to exist first. Run CREATE TABLE, then use INSERT INTO to add records. The list of fields must be wrapped in brackets and separated by commas. INSERT INTO ... VALUES adds a single record, with values in the same order as the fields. The command must say CREATE TABLE so SQL knows a new table is being built.
Common mistakes: Each field definition must be separated from the next by a comma. The Name line should end with a comma: Name TEXT,. The keyword is PRIMARY KEY, two words. The line should be: ID INTEGER PRIMARY KEY,.
Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.
This module's key terms are also in a printable crossword (Modules 35–44) and word search (Modules 35–54).
Take this worksheet further — free with Cloodit
Each concept is reinforced from every angle — learned, then applied, then tested.
Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.
Over 100 of them, across seven natural biomes.
Turns their work into revision material ready for Flash Cards and Exam study.
Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.
Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.
Quick Questions
Match the Pairs
Key Term
CREATE TABLEFill in the Blanks
Spot the Error
Student with a class code? Join your class →