In relational databases like PostgreSQL, MySQL, and MariaDB, the ALTER TABLE statement is the tool of choice. The syntax is direct:
ALTER TABLE table_name
ADD COLUMN column_name data_type [constraints];
Choosing the right data type matters. Use INTEGER or BIGINT for counters, TEXT or VARCHAR for user input, and BOOLEAN for flags. Index a new column only if you need to query it often, since unnecessary indexes slow down writes.
When adding a new column to a large production table, plan for lock times and migration windows. Some databases allow adding columns with default values without locking rows; others may require online schema changes. Always test on a staging environment before running changes in production.