Adding a new column is more than syntax. It’s schema evolution. It changes queries, indexes, APIs, and sometimes the way entire features work. Done right, it powers growth. Done wrong, it breaks production.
A new column in SQL starts with a clear definition. Know the data type. Know the nullability. Decide on defaults before the migration hits. This is the moment where design decisions become permanent.
For relational databases, common syntax looks like:
ALTER TABLE users ADD COLUMN last_login TIMESTAMP DEFAULT CURRENT_TIMESTAMP;
This single line must be wrapped in a plan: migrations must be atomic, reversible, and tested. Add the column. Backfill data if needed. Deploy changes across all environments.