SQL ALTER TABLE

Last updated: August 27, 2026.

Use ALTER TABLE to change an existing table definition. Exact options vary between database systems, so test migrations against the same engine and version used in production.

Syntax

ALTER TABLE table_name
ADD COLUMN column_name data_type;

Example

ALTER TABLE Orders
ADD COLUMN Quantity SMALLINT;

Make schema changes through a reviewed migration, take a backup, and understand locking and rewrite costs before altering a large production table.

See the current PostgreSQL SQL reference; confirm dialect details for your own database.

admin

admin

Leave a Reply

Your email address will not be published.