The query ran. The table loaded. You saw the gap where data should be. A new column was the only answer.
Adding a new column sounds simple. In production, it can break everything if done wrong. Schema changes hit live systems. They lock tables. They choke writes. The impact grows with data size.
Plan each change. Decide the column name, data type, default value, and nullability. Mismatched types cause casting errors. Wrong defaults generate invalid data.
Use database migrations. Version every change. Apply them in controlled deployments. In PostgreSQL, use ALTER TABLE ... ADD COLUMN. In MySQL, the same command works, but locks differ based on storage engine. Know your database internals.
For large datasets, create columns as nullable first. Populate them in batches. Add constraints or defaults after backfilling. This avoids long locks and downtime.