ALTER TABLE ... DROP COLUMN

From SQLZOO
Jump to navigation Jump to search

Delete a column from a table

schema:scott

This is in the SQL standard ALTER TABLE

DROP TABLE a
CREATE TABLE a(x INTEGER, y INTEGER);
INSERT INTO a VALUES (1,2);
ALTER TABLE a DROP COLUMN y;
SELECT * FROM a;
ALTER TABLE a DROP y;
SELECT * FROM a;
DataWars, Data Science Practice Projects - LogoDataWars: Practice Data Science/Analysis with +100 Real Life Projects