Adding a new column to an existing table is one of the most common schema changes in production systems. It sounds trivial, but it can break deployments, lock tables, or slow down critical queries if done without care. The right approach depends on your database engine, your data volume, and your uptime requirements.
In SQL, the basic command is straightforward:
ALTER TABLE orders ADD COLUMN status VARCHAR(20);
On small tables, this runs instantly. On large tables, it can hold a lock for minutes or hours, blocking reads and writes. PostgreSQL, MySQL, and other relational databases each handle this differently. PostgreSQL 11+ supports adding a column with a default value without rewriting the whole table, making it faster and safer. MySQL may still rebuild the table unless you use ALGORITHM=INSTANT (available in newer versions).
When designing the new column, define its data type, nullability, default value, and indexing strategy up front. Adding indexes later will cause their own locks and performance hits. If the column is going to be queried often, create the index in a separate migration step to control load.