Posted in Database
CREATE TABLE <table name> (<column name> <column type>[ NOT NULL][ PRIMARY KEY| DEFAULT <value>][, <column name> <column type>[ NOT NULL][ PRIMARY KEY| DEFAULT <value>]]* [,[ CONSTRAINT <constraint name>] { PRIMARY KEY (<column name>[, <column name>]*) | UNIQUE ([VALUE|<column name>[, <column name>]*]) | FOREIGN KEY (<column name>[, <column name>]*) REFERENCES <table name> (<column name>[, <column name>]*)[ ON DELETE CASCADE][ ON UPDATE CASCADE] | CHECK (<predicate>[{ AND| OR} <predicate>]*) } ]* );
ALTER TABLE <table name> { ADD[ COLUMN] <column name> <column type>[ NOT NULL][ PRIMARY KEY| DEFAULT <value>] | ALTER[ COLUMN] <column name>[ SET DEFAULT <default option>| DROP DEFAULT] | DROP[ COLUMN] <column name> | ADD[ CONSTRAINT <constraint name>] { PRIMARY KEY (<column name>[, <column name>]*) | UNIQUE ([VALUE|<column name>[, <column name>]*]) | FOREIGN KEY (<column name>[, <column name>]*) REFERENCES <table name> (<column name>[, <column name>]*)[ ON DELETE CASCADE][ ON UPDATE CASCADE] | CHECK (<predicate>[{ AND| OR} <predicate>]*) } | DROP CONSTRAINT <constraint name> };
DROP TABLE <table name>;Semoga bermanfaat. Semoga bermanfaat