A new column changes how your data works. It can store computed values, track timestamps, or hold a foreign key for a join. In SQL, the ALTER TABLE statement is the direct way to create it. The syntax is clear:
ALTER TABLE orders
ADD COLUMN status VARCHAR(20);
This operation is straightforward on small datasets. On large tables, it can lock writes, impact performance, and trigger replication lag. Choosing the right data type matters. Text fields use more space than integers. Nullable columns can simplify rollouts, but they often hide incomplete migrations.
A new column also affects indexes. Adding it without planning can cause full table scans. If the column will be queried often, create an index after the migration: