Adding a new column is simple in theory. In practice, it can break production, lock tables, and block writes. The method you choose depends on database type, schema size, and uptime requirements.
In SQL, the common syntax is:
ALTER TABLE users ADD COLUMN last_login TIMESTAMP;
This works for small tables. For large production tables under load, a naive ALTER TABLE can cause downtime. On PostgreSQL, it locks writes until the change is done. On MySQL with InnoDB, it may rebuild the table. Both can block critical requests.
There are safer patterns. In PostgreSQL, adding a nullable column with no default can be instant. Then write backfill scripts that update rows in chunks. In MySQL, tools like pt-online-schema-change or gh-ost can modify the schema without heavy locks. They copy data in the background and swap tables with minimal interruption.