CREATE TABLE

From SQLZOO
Revision as of 10:42, 7 March 2014 by 117.212.90.88 (talk)
Jump to: navigation, search

CREATE TABLE

The table games shows the year and the city hosting the Olympic Games.

games
yrcity
2004Athens
2008Beijing
schema:scott
 DROP TABLE games

The CREATE statement builds an empty table to hold rows. In this example the column yr is the PRIMARY KEY:

CREATE TABLE table1
(id int primary key,name varchar(20),city varchar(20),mobile numeric(10,0)
);

See also