The table waits, static, incomplete. You open the schema and see the missing piece. The solution is clear: add a new column.
Creating a new column is one of the most direct ways to evolve a database. It changes the structure without rewriting the core. Done right, it unlocks new capabilities instantly. Done wrong, it can slow queries, break code, or corrupt data.
When planning a new column, define its purpose. Is it storing raw data, a calculated value, or metadata? Choose the correct data type—integers, text, timestamps, JSON—based on the smallest size and the fastest access needed. Align with existing standards to avoid friction in joins, indexes, and migrations.
In SQL, the simplest path is an ALTER TABLE statement:
ALTER TABLE users ADD COLUMN last_login TIMESTAMP;
This adds without re-creating the table. But understand the implications. On large tables, adding a column can lock writes or trigger heavy disk I/O. For systems at scale, consider adding columns in off-peak hours or using database-native online DDL features.