SQL CREATE ALTER DROP VIEW

From NovaOrdis Knowledge Base
Revision as of 17:03, 23 May 2024 by Ovidiu (talk | contribs) (Created page with "=Internal= * SQL * SQL Data Types =Overview= =<tt>CREATE</tt>= <syntaxhighlight lang='sql'> CREATE TABLE person ( id smallint, name varchar(30) NOT NULL, CONSTRAINT pk_person PRIMARY KEY (id) ); </syntaxhighlight> :{| class="wikitable" style="text-align: left;" |- | PostgreSQL || MySQL |- |} =<tt>ALTER</tt>= <syntaxhighlight lang='sql'> ALT...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Internal

Overview

CREATE

CREATE TABLE person 
( id smallint, 
  name varchar(30) NOT NULL, 
  CONSTRAINT pk_person PRIMARY KEY (id)
);
PostgreSQL MySQL

ALTER

ALTER TABLE person [...]

Add/Remove a Column

ALTER TABLE person ADD COLUMN birthday DATE;
PostgreSQL MySQL

DROP

DROP TABLE person [...]
PostgreSQL MySQL

Features

AUTO_INCREMENT

AUTO_INCREMENT