Adding a new column is never just a schema tweak. It is a decision that touches code, queries, indexes, and performance. In SQL, the ALTER TABLE command is your entry point. The syntax is simple, but each parameter matters:
ALTER TABLE orders
ADD COLUMN shipped_at TIMESTAMP DEFAULT NULL;
This command creates the column without disrupting existing rows, but in large datasets, migration strategy is critical. Online schema changes or batched migrations prevent downtime. Consider database engine specifics—PostgreSQL, MySQL, and modern cloud databases each handle locks and storage in their own ways.
A new column introduces new query patterns. If it will be filtered or joined often, add an index. Decide whether it should allow NULL, whether it should have a default, and how it integrates with current constraints. Adding a computed column can reduce complexity in application code but may cost more on writes.