Adding a new column is more than a schema change. It alters how your application stores and retrieves state. Done well, it opens the door to new features, new queries, and cleaner code. Done badly, it can break production and corrupt data.
In SQL, ALTER TABLE is the core command to add a new column. The syntax is simple:
ALTER TABLE users
ADD COLUMN last_login TIMESTAMP;
But the details matter. Think about nullability, default values, and indexing before you run the change. On large datasets, adding a column without planning can lock the table and cause downtime. Some databases support non-blocking schema changes; others do not. Know your system.
If the new column will be queried frequently, create the index after the data is populated. Adding an index before backfilling can slow inserts to a crawl. For wide tables, consider column order if your database stores rows in fixed layouts.