SQL CREATE ALTER DROP TABLE: Difference between revisions
Jump to navigation
Jump to search
(→CREATE) |
|||
Line 27: | Line 27: | ||
<syntaxhighlight lang='sql'> | <syntaxhighlight lang='sql'> | ||
ALTER TABLE person ADD COLUMN birthday DATE; | ALTER TABLE person ADD COLUMN birthday DATE; | ||
</syntaxhighlight> | |||
<syntaxhighlight lang='sql'> | |||
ALTER TABLE person DROP COLUMN birthday; | |||
</syntaxhighlight> | </syntaxhighlight> | ||
:{| class="wikitable" style="text-align: left;" | :{| class="wikitable" style="text-align: left;" |
Revision as of 19:20, 23 May 2024
Internal
Overview
CREATE
CREATE [TEMPORARY] TABLE person
( id smallint,
name varchar(30) NOT NULL,
CONSTRAINT pk_person PRIMARY KEY (id)
);
If the TEMPORARY
keyword is used, the created table will be temporary instead of permanent.
ALTER
ALTER TABLE person [...]
Add/Remove a Column
ALTER TABLE person ADD COLUMN birthday DATE;
ALTER TABLE person DROP COLUMN birthday;
DROP
DROP TABLE person [...]