psql/create-table

Create Table

Create a new PostgreSQL table

table
create

Command

CREATE TABLE tablename (column1 datatype, column2 datatype, ...);

Explanation

Creates a new table in the current database.

Examples

Create users table

CREATE TABLE users (id SERIAL PRIMARY KEY, name VARCHAR(255), email VARCHAR(255));