Adding a new column is one of the most common changes in any database schema. It seems simple, but the details decide if it works cleanly or breaks production. Performance, defaults, nullability, and migration strategy can all turn a single line of SQL into a safe change or a costly rollback.
A new column can be added with a single ALTER TABLE statement:
ALTER TABLE users
ADD COLUMN last_login TIMESTAMP DEFAULT NOW();
This works, but it is rarely the full story. On large tables, an ALTER TABLE with a default can lock writes or copy data, impacting availability. For live systems, an online schema change tool or phased migration is safer. First add the column nullable, then backfill data in batches, and finally enforce defaults or constraints.
Data type choice is permanent unless you run another migration. Use the smallest type that works, and match indexes to new query patterns expected to use the column. Avoid adding columns that duplicate data already derived elsewhere; that increases maintenance cost and risk of inconsistency.