ALTER TABLE

You can use the ALTER TABLE command to:

  • Add, drop, and rename table columns

  • Rename tables

  • Add and reorder table clustering keys

  • Drop table clustering keys

Usage Note

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

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.