Adding a new column is one of the most common database changes. It sounds simple, but it can break production if done without care. Whether your system runs on PostgreSQL, MySQL, SQLite, or a cloud database service, the process follows the same steps: define the change, apply it safely, and verify it works under load.
In SQL, the ALTER TABLE statement is the core tool.
ALTER TABLE users ADD COLUMN last_login TIMESTAMP;
This updates the schema instantly in a development environment. In production, you need to think about locks, downtime, and migration strategy. Large tables can block writes during schema updates. For critical systems, use online migrations or split the change into two phases: add the column, then backfill data.
Plan your new column carefully. Choose the right data type. Set sensible defaults. Avoid NULL when the column should always store a value. In relational databases, wrong choices here lead to inconsistent data and extra code paths.