In SQL, COLUMN is not usually executed as a standalone command but is a reserved keyword that identifies a single field of structured data stored in a table. It is crucial in Data Definition Language (DDL) operations that create, modify, or remove table structure. Typical contexts include CREATE TABLE, where each column is described by a name and data type, and ALTER TABLE, where columns are added, dropped, renamed, or modified. A column stores one data value per row, has an associated data type, may allow or disallow NULLs, and can carry constraints such as PRIMARY KEY, UNIQUE, CHECK, or DEFAULT. Some dialects (Oracle, SQL*Plus) expose a client-side COLUMN command that formats query output, but that usage is tool-specific and not part of ANSI SQL. Important caveats: renaming or dropping a column can invalidate views, triggers, or application code; altering data type may require casting or table locks; and most RDBMSs disallow dropping a column that is referenced by a constraint unless the constraint is removed first.
column_name
(identifier) - Name of the column to create or alterdata_type
(type) - SQL data type of the column (INTEGER, VARCHAR, etc.)column_constraints
(clause) - Optional constraints like NOT NULL, DEFAULT, UNIQUE, CHECKCREATE TABLE, ALTER TABLE, DROP COLUMN, RENAME COLUMN, CONSTRAINT, DATA TYPE
SQL-92 standard (ALTER TABLE ADD/DROP COLUMN)
A column represents a single attribute of the entity modeled by the table. Each row stores one value for that attribute.
If data must always be present, add NOT NULL. Otherwise the column accepts NULLs by default, which may allow incomplete data.
Create a new column with the desired type, backfill data with CAST, update code, then drop the old column. This avoids risky in-place conversions on large tables.
Indexes that include the column are automatically dropped. Check index definitions first to avoid unexpected performance changes.