thinQmaster Virtual testing partner Adaptive practice exams that find your weak spots and drill them. Every answer explained. From $69
Enroll

thinQmaster

Find your exam

Five questions free, before you decide.

Step 1 · choose a vendor

In one of our camps? Your practice exams come with the tuition — they are on your study page already.

Data & Analytics · Foundational

ALTER TABLE Statement

The DDL statement that changes an existing table's structure, such as adding, dropping or modifying columns and constraints.

Definition

ALTER TABLE supports ADD COLUMN, DROP COLUMN, ALTER/MODIFY COLUMN, ADD CONSTRAINT and RENAME. Some changes, such as narrowing a type or adding NOT NULL, fail if existing data violates them. Large-table alters can lock the table or rewrite it.

Example

ALTER TABLE Customers ADD LoyaltyTier VARCHAR(20) DEFAULT 'Standard';

Exam tip

Adding a column is DDL (ALTER); populating it afterwards is DML (UPDATE).

Related terms