Adding a new column is a fundamental operation in databases, spreadsheets, and data models. Done right, it expands capability without breaking existing systems. Done wrong, it triggers downtime, performance loss, or corrupt records.
In SQL, adding a column is straightforward:
ALTER TABLE users ADD COLUMN last_login TIMESTAMP;
This changes the schema while preserving existing rows. The database fills the new column with NULL (or a default value if defined). For massive tables, this may lock writes or degrade reads, depending on the engine and configuration. On systems like PostgreSQL with certain data types, the change is near-instant if it only updates metadata. With MySQL or other engines, plan for potential migration time.
In NoSQL databases, adding fields can be schema-less, but applications still need to handle missing values. In document stores like MongoDB, simply writing documents with the new field is enough, but schema validation rules or downstream systems may require explicit updates across all records.