A new column changes how your data works. It can store fresh values, track evolving states, or drive computed results across rows. In most databases—PostgreSQL, MySQL, SQLite—the command is straightforward:
ALTER TABLE users ADD COLUMN last_login TIMESTAMP DEFAULT CURRENT_TIMESTAMP;
This line adds a last_login column to the users table and sets a default value. The database will now store this time whenever a new row appears. Adding columns like this lets you expand schema without rewriting your entire system.
When creating a new column, think about type, constraints, and indexes. Choose INTEGER for counts, TEXT for strings, and exact date/time types for scheduling. Use NOT NULL when every row must have a value. Add indexes if you'll query by this column often. These decisions affect performance and correctness.