CQL for Cassandra 1.2

Adding columns to a table

The ALTER TABLE command adds new columns to a table.

Procedure

Add a coupon_code column with the varchar data type to the users table.
cqlsh:demodb> ALTER TABLE users ADD coupon_code varchar;
This creates the column metadata and adds the column to the table schema, but does not update any existing rows.
Show/hide