Before continuing: This entry is part of the ALTER TABLE guide. If you are new to the topic, start with ALTER TABLE.
Examples
ALTER TABLE products
ADD COLUMN weight_kg DECIMAL(6,2);The table gains a new column. Existing rows will hold NULL unless a compatible default has been declared. Adding the column does not convert or replace any other column.
The result confirms that ADD COLUMN extends the schema without inventing data. If the column must be required, fill in valid values first and then add the constraint with your engine's syntax.
Differences and trade-offs
How to choose
| Question | Operation | Example |
|---|---|---|
| The column does not exist yet? | ADD COLUMN | Add weight_kg |
| It exists and its type changes? | ALTER/MODIFY COLUMN | price moves to a higher precision |
| Only the name changes? | Dedicated rename | phone becomes moving |
| Want to change the values? | UPDATE | Fill in empty phone numbers |
Example 2: changing an existing column
ALTER TABLE products
ALTER COLUMN price TYPE NUMERIC(12,2);ALTER TABLE products
MODIFY COLUMN price DECIMAL(12,2) NOT NULL;ALTER TABLE products
ALTER COLUMN price DECIMAL(12,2) NOT NULL;The three statements express a similar intent, but they are not interchangeable. In MySQL, the definition written in MODIFY COLUMN must restate any properties you want to keep, such as NOT NULL. PostgreSQL may need a USING clause if the values have no suitable implicit conversion.
What happens in SQLite
SQLite directly supports ADD COLUMN, renames and DROP COLUMN. Since SQLite 3.53.0, released on 9 April 2026, it also supports ALTER TABLE ... ALTER COLUMN ... SET/DROP NOT NULL. There is still no generic command to change a column's type and all its properties at will. The site's lab checks ADD COLUMN; for unsupported changes, follow the documented procedure: create a new table, copy the data, validate it and replace the old table.
Before changing a type
- Find the minimum and maximum values and the formats in use.
- Look for values that cannot be converted.
- Review indexes, keys, views and dependent code.
- Estimate whether the engine will copy or rewrite the table.
- Test the migration and its rollback on a representative copy.