Skip to content

Changing the schema

Handout

Changing a table's structure

A table's design is not fixed. ALTER TABLE … ADD adds a new column to an existing table:

ALTER TABLE product ADD weight DECIMAL(5, 2);

Existing rows get NULL in the new column until you fill them in.

ALTER TABLE ADD gives the table a new, empty column

Handout

Log in or create account

IGCSE & A-Level