some other examples for CREATE DATABASE.
Gavin Sherry
CREATE DATABASE lusiadas;
+
+
+
+
+ To create a database sales> owned by user salesapp>>
+ with a default tablespace of salesspace>:
+
+CREATE DATABASE sales OWNER salesapp TABLESPACE salesspace;
+
+
+
+ To create a database music> which supports the ISO-8859-1
+ character set:
+
+CREATE DATABASE music ENCODING 'LATIN1';
the table films:
CREATE UNIQUE INDEX title_idx ON films (title);
+
+
+
+ To create an index on the column code> in the table
+ films> and have the index reside in the tablespace
+ indexspace>:
+CREATE INDEX code_idx ON films(code) TABLESPACE indexspace;
SELECT title, release FROM hollywood.films WHERE awards IS NOT NULL;
+
+ Create a schema sales> whose tables, indexes and sequences
+ will be stored in the tablespace mirrorspace> by default:
+
+CREATE SCHEMA sales TABLESPACE mirrorspace;
+
+
+
name varchar(40),
UNIQUE(name)
);
+
+
+
+ Create table cinemas> in tablespace diskvol1>:
+
+CREATE TABLE cinemas (
+ id serial,
+ name text,
+ location text
+) TABLESPACE diskvol1;