ALTER TABLE

You can use the ALTER TABLE command to make schema changes to a table, and can be used in conjunction with several sub-commands.

Locks

Making changes to a schema makes an exclusive lock on tables. While these operations do not typically take much time, other statements may have to wait until the schema changes are completed.

Sub-Commands

The following table shows the sub-commands that can be used with the ALTER TABLE command:

Command

Usage

ADD COLUMN

Adds a new column to a table.

DROP COLUMN

Drops a column from a table.

RENAME COLUMN

Renames a column.

RENAME TABLE

Renames a table.

CLUSTER BY

Modifies (adds or reorders) the clustering keys in a table.

DROP CLUSTERING KEY

Drops all clustering keys.