The query ran. The table was clean, but it needed more. You typed two words: NEW COLUMN.
Adding a new column is one of the simplest ways to evolve a database schema without breaking existing functionality. In PostgreSQL, MySQL, or SQLite, the syntax is almost identical:
ALTER TABLE users ADD COLUMN last_login TIMESTAMP;
This operation extends the dataset without touching current rows. When you define a new column, consider the default value, nullability, and indexing. A careless default can lock a table or cause a full rewrite. A nullable column usually avoids heavy I/O during migration.
In high-traffic systems, adding a column to a large table can block writes. Mitigate this with online schema change tools or by creating the column in a way that doesn’t rewrite all the data at once. PostgreSQL’s ADD COLUMN with DEFAULT will rewrite the table unless the default is NULL or immutable and stored only in the metadata. MySQL allows ALGORITHM=INPLACE in some versions to reduce downtime.