The query runs, and you see it—data aligned like soldiers, but one more field needs to exist. You need a new column.
Adding a new column sounds small, but it can reshape a table, unlock new capabilities, or enable faster features. In SQL, the command is direct:
ALTER TABLE users ADD COLUMN last_login TIMESTAMP;
This works in most relational databases, whether PostgreSQL, MySQL, or MariaDB. The syntax changes only slightly by vendor. A NULL-by-default column drops into place without blocking queries. But if you set NOT NULL with no default, migrating large datasets can lock tables and hurt performance. Plan for minimal impact.
When designing a schema change, decide if the new column stores raw data, calculated fields, or references. Choose the correct type at creation to avoid later rewrites. For timestamps, store in UTC. For text, match encoding to your database settings. Index only if queries will frequently filter or sort on that column—indexes speed reads but increase write cost.