Adding a new column is one of the most common changes in database work, yet it carries weight. It changes schemas, impacts queries, and can ripple through production systems if not handled with care. Whether you use PostgreSQL, MySQL, or SQLite, the core operation stays simple: define the column, set its type, and apply the migration.
In SQL, the command is direct:
ALTER TABLE orders ADD COLUMN status TEXT;
This tells the database to alter the table structure and append the new column at the end. Most relational systems support this without changing existing rows until you specify default values. For columns in large tables, adding without defaults is much faster because it avoids a full table rewrite.
When working with live production systems, pair the new column with versioned migrations. Keep schema files under source control and roll changes through a CI/CD pipeline. Test the column addition on staging with realistic data sizes to catch index or locking issues before deployment.