Changing the composition of columns
YDB supports adding columns to row and column tables, as well as deleting non-key columns from tables.
ADD COLUMN — adds a column with the specified name and type. The code below will add a column named views with data type Uint64 to the episodes table.
ALTER TABLE episodes ADD COLUMN views Uint64;
DROP COLUMN — deletes a column with the specified name. The code below will delete the column named views from the episodes table.
ALTER TABLE episodes DROP COLUMN views;