Creating a new column in a database is simple in syntax but critical in impact. It shapes queries, affects indexing, and changes the structure of your system. Whether you are working in PostgreSQL, MySQL, or SQLite, the principle is the same: define the column, set the type, and control its constraints.
In SQL, the ALTER TABLE statement adds the new column without destroying existing data:
ALTER TABLE users
ADD COLUMN last_login TIMESTAMP;
This operation is fast on small tables but can be costly at scale. Large datasets may trigger table rewrites, lock rows, or block writes depending on the database engine. Plan for downtime or use online schema change tools if availability matters.