The query hit the database, but the data wasn’t complete. You needed a new column.
A new column changes the structure of your table. It adds a field to store more data, adjust queries, and evolve your schema without redesigning from scratch. In SQL, adding a column is direct:
ALTER TABLE users ADD COLUMN last_login TIMESTAMP;
This command updates the table, extends its definition, and opens new patterns for indexing and queries. A new column can be nullable or have a default value. Defaults help with migrations, avoiding failures when existing rows need a value.
When creating a new column, check its type and constraints. Use precise data types—avoid generic text where integer, boolean, or timestamp fits better. Constraints like NOT NULL or UNIQUE enforce data rules at the database level. This keeps application logic simpler and prevents corruption that can surface months later.