SQL ALTER TABLE
An SQL command that changes the structure of an existing table, such as adding a column with ADD, removing one with DROP COLUMN, or adding a FOREIGN KEY, without deleting the table.
Understanding SQL ALTER TABLE in QCE Digital Solutions Unit 2
What it does: ADD FOREIGN KEY on an existing table names the column and uses REFERENCES to point to the primary key of the other table. ALTER TABLE changes the structure of an existing table. UPDATE changes the data in rows, not the structure, and UPDATE TABLE is not valid SQL. The command is always ALTER TABLE followed by the table name. The ADD clause needs a column name and a data type, such as rating INT. Without them the statement is incomplete. DROP COLUMN permanently removes the column and its data, so check before you run it. Correct syntax is ALTER TABLE students ADD email VARCHAR(50); because SQL needs the word TABLE to know what is being altered.
Common mistakes: ADD needs a data type after the new column name. It should be ADD email VARCHAR(50);. The command is ALTER TABLE, so the TABLE keyword is missing. It should be ALTER TABLE products.
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 186–228) and word search (Modules 144–228).
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
ALTER TABLEFill in the Blanks
Spot the Error
Student with a class code? Join your class →