Skip to content

Alter Table

Mathias Rangel Wulff edited this page Jun 11, 2015 · 3 revisions

Keyword ALTER TABLE

Syntax:

    ALTER TABLE tableid ADD COLUMN columnid type;
    ALTER TABLE tableid RENAME COLUMN columnid TO newname;
    ALTER TABLE tableid DROP COLUMN columnid;
    ALTER TABLE tableid RENAME TO newname;

ADD COLUMN

    alasql('ALTER TABLE City ADD COLUMN Continent STRING');

RENAME COLUMN

    alasql('ALTER TABLE City RENAME COLUMN Continent TO WorldPart');

DROP COLUMN

    alasql('ALTER TABLE City DROP COLUMN Continent');

RENAME TO

   alasql('ALTER TABLE City RENAME TO Capital');

See also: [ADD COLUMN](Add Column), [RENAME TABLE](Rename Table)

Clone this wiki locally