SQL ALTER TABLE
Changes the structure of an existing table, such as adding a column with ADD or removing one with DROP COLUMN. Existing rows keep their data and get empty (NULL) values in a new column.
Understanding SQL ALTER TABLE in QCE Digital Solutions Unit 4
What it does: This statement changes the existing subjects table by adding a room column, rather than creating a new table. The SELECT shows age as NULL for every existing student, because ADD does not fill in values for old rows. Use DROP COLUMN to remove a column. DELETE is used to remove rows, not columns. The order is ALTER TABLE, then the table name, then ADD, then the new column name and its data type. Dropping a column removes the whole column, including every value stored in it. Check you no longer need it first.
Common mistakes: The statement must start with ALTER TABLE followed by the table name. Without the TABLE keyword the database cannot tell what is being altered. It should be ALTER TABLE students. INSERT is used to add rows, not columns. To add a new column to an existing table you use ADD (or ADD COLUMN), so the line should be ADD COLUMN discount REAL;.
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 334–401) and word search (Modules 127–401).
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 →