The data sits in the table. But it’s missing something you need. You add a new column.
In relational databases, adding a new column changes the shape of your schema without breaking existing data. It can hold values that unlock new features, track more metrics, or store computed results. Done right, it’s a precise operation. Done wrong, it can slow queries, break code, and cause migrations to stall.
A new column has clear steps. First, define its type — integer, varchar, boolean, timestamp, or JSON. Match the type to the data you will insert. Second, decide on nullability. Nullable columns work with existing rows immediately, but allow missing data. Non-null columns require defaults before they can be added safely. Third, handle indexing. An indexed new column can speed read operations but will consume more storage and write time.
In SQL, the common command is: