The table was slow. Queries lagged. You opened the schema and saw the problem—too many values crammed into one field, no room for precision. A new column was the answer.
Adding a new column is one of the simplest yet most powerful schema changes in any relational database. It defines a new space for your data, isolates values that should be independent, and opens the door for cleaner queries and better indexing. Whether you are working in PostgreSQL, MySQL, or SQLite, the principle is the same: define the structure, declare the type, set defaults if needed, and migrate with care.
The command is direct:
ALTER TABLE users ADD COLUMN last_login TIMESTAMP;
This statement modifies the structure of the table without rewriting its existing data. But speed and safety depend on how you execute it. In high-traffic systems, lock times matter. In PostgreSQL, you can add a nullable column instantly because it doesn't touch existing rows. In MySQL, version compatibility may affect online DDL performance, so check engine settings before you deploy.
Naming matters. A column name must be clear, descriptive, and consistent with your schema's conventions. Use snake_case or camelCase as defined in your style guide. Avoid vague names like data1 or misc.