Adding a new column is simple in theory, but the details decide whether it ships clean or causes outages. You must choose the right data type. Decide on NULL or NOT NULL constraints. Set default values with care. In SQL, the basic command looks like this:
ALTER TABLE users
ADD COLUMN last_login TIMESTAMP DEFAULT NOW();
This works for small tables. For production tables with millions of rows, you need a safe migration strategy. Direct ALTER TABLE can lock writes and block queries. Use an online schema change tool or a rolling migration. Break the change into steps. First, add the nullable column. Then backfill data in small batches. Finally, enforce constraints.
Naming matters. A good column name is short, clear, and matches your existing naming style. Avoid generic words like data or info. Use lowercase with underscores. Keep units or formats obvious in the name when needed.