Creating PostgreSQL Databases
Darryl Reeves
Industry Assistant Professor, New York University
CREATE TABLE table_name (
column1_name column1_datatype [col1_constraints],
column2_name column2_datatype [col2_constraints],
...
columnN_name columnN_datatype [colN_constraints]
);
Name Restrictions
CREATE TABLE school (
id serial PRIMARY KEY,
name TEXT NOT NULL,
mascot_name TEXT
);
CREATE TABLE topic (
id SERIAL PRIMARY KEY,
description TEXT NOT NULL
);
Creating PostgreSQL Databases