Adding a new column to a database table is one of the most common schema changes. It changes the shape of your data and the way your application reads and writes to it. Done wrong, it can lock tables, block traffic, or corrupt data. Done right, it is seamless.
In SQL, the basic syntax is direct:
ALTER TABLE table_name ADD COLUMN column_name data_type;
The ALTER TABLE command updates the structure without dropping the table. Choose the data_type carefully to match existing and future data. Large or complex types grow storage quickly.
For productions systems, the challenge is avoiding downtime. On high-traffic tables, adding a new column can trigger a full table rewrite. Use online schema change tools like gh-ost or pt-online-schema-change for MySQL, or PostgreSQL’s native ALTER TABLE … ADD COLUMN which is often metadata-only for nullable columns without defaults.