Adding a new column sounds simple, but the details matter. One mistake can lock a table, stall writes, or corrupt production data. Doing it right means knowing your database, your ORM, and the runtime impact.
In most relational systems, the command is straightforward:
ALTER TABLE users ADD COLUMN last_login TIMESTAMP;
But the real work starts after that line. You need to set defaults without backfilling millions of rows at once. You need to ensure indexes are created without blocking. You measure the change with query analysis before shipping.
For PostgreSQL, use ADD COLUMN ... DEFAULT with care. Older versions rewrite the entire table. In MySQL, watch for table copy behavior unless you use ALGORITHM=INPLACE. In distributed databases, schema changes can trigger cluster-wide events—plan for those.