ADD is a clause used inside ALTER statements to extend an existing schema object without recreating it. The most frequent use case is ALTER TABLE ... ADD to introduce a new column, but the clause also supports adding constraints (PRIMARY KEY, UNIQUE, CHECK, FOREIGN KEY), indexes, table partitions, and storage parameters depending on the SQL dialect. The operation is normally instantaneous for metadata only, but on large tables some engines need to rewrite or lock the table, which can impact performance or availability. When adding a NOT NULL column without a DEFAULT, many databases will fail because existing rows break the NOT NULL rule. Supplying a DEFAULT lets the engine back-fill existing rows automatically. Some dialects (MySQL, SQL Server) allow positioning keywords such as FIRST or AFTER column_name, while standard SQL does not. ADD applies only to existing objects; use CREATE for new objects and MODIFY/ALTER COLUMN for changing existing columns.
table_name
(identifier) - Target table to changecolumn_name
(identifier) - Name of the new columndata_type
(data type) - Column data type (INT, VARCHAR, etc.)column_constraints
(clause) - Optional NOT NULL, UNIQUE, etc.default_value
(expression) - Value assigned to existing/new rowsconstraint_name
(identifier) - Name of the new constraintconstraint_type
(keyword) - PRIMARY KEY, UNIQUE, CHECK, FOREIGN KEYcolumn_list
(list) - One or more columns separated by commaspartition_definition
(clause) - Engine specific partition descriptionALTER TABLE, ALTER COLUMN, DROP, MODIFY, CREATE TABLE, CONSTRAINT, INDEX
SQL-92 standard (ALTER TABLE ... ADD)
Use ALTER TABLE table_name ADD column_name data_type; Include DEFAULT and NOT NULL if you need to backfill existing rows.
PostgreSQL, Oracle, and SQL Server let you add several columns inside one ADD ( ... ) block. MySQL and SQLite require separate ADD clauses per column.
Yes in most databases. Without a DEFAULT, existing rows violate the NOT NULL rule and the statement fails.
Run ALTER TABLE table_name ADD CONSTRAINT constraint_name UNIQUE (column_list);