ALTER TABLE

ALTER TABLE can be used to make schema changes to a table. It works in conjunction with several subcommands.

Overview

The ALTER TABLE page describes the following:

Locks

Schema changes take an exclusive lock on tables. While these operations are usually short, other statements may have to wait until the schema changes are completed.

Subcommands

The following table shows the subcommands:

Command

Usage

ADD COLUMN

Add a new column to a table

DROP COLUMN

Drop a column from a table

RENAME COLUMN

Rename a column

RENAME TABLE

Rename a table

CLUSTER BY

Modify (add or reorder) the clustering keys in a table

DROP CLUSTERING KEY

Drop all clustering keys