PostgreSQL Create Table

PostgreSQL Create Table

The PostgreSQL CREATE TABLE is used to create a database table.

Create Table syntax

CREATE TABLE table_name (
column_name1 datatype,
column_name2 datatype,
column_name3 datatype,
...);

Create Table example

CREATE TABLE goods
(
ID NUMERIC PRIMARY KEY,
GOOD_TYPE VARCHAR(10) NOT NULL,
NAME VARCHAR(50) NOT NULL,
DESCRIPTION VARCHAR(255),
PRICE NUMERIC,
INSERT_DATE TIMESTAMP
);