Adding a new column in a database is not just schema work. It is a structural decision that impacts performance, data integrity, and maintainability. Done right, it gives new capabilities without slowing queries or breaking existing systems. Done wrong, it causes downtime, locks, or hidden bugs.
In SQL, the most direct way to create a new column is with ALTER TABLE. Example:
ALTER TABLE users
ADD COLUMN last_login TIMESTAMP;
This runs fast on small datasets, but large tables in production can be tricky. Depending on your database, adding a new column may require a full table rewrite. On PostgreSQL, adding a column with a default value before version 11 rewrites the table; after version 11, it can be instant for NULL defaults. MySQL and MariaDB have different behaviors—some operations are online, some block writes.
Before adding a column: