Altering a Table in Cassandra

Altering a Table in Cassandra

Instructor-svg Al-Mamun Sarkar
Sep 19 , 2020

Sometime we may need to add a new column as well need to drop a column from the table. ALTER TABLE is used to add or drop a column.

Adding Column:

Syntax:

ALTER TABLE table_name
ADD new_column datatype;

Example:

ALTER TABLE employees 
ADD email text;

 

Droping column:

Syntax:

ALTER TABLE table_name
DROP column_name;

Example:

ALTER TABLE employees
DROP email;

 

  • Share On:
  • fb
  • twitter
  • pinterest
  • instagram