EasyBasic SELECT

Create a basic table with primary key

The query

SQL
CREATE TABLE departments (
  dept_id SERIAL PRIMARY KEY,
  dept_name VARCHAR(100) NOT NULL,
  location VARCHAR(100)
);
Tested against PostgreSQL 16

Note

SERIAL is a pseudo-type that creates an auto-incrementing integer column. PRIMARY KEY implies UNIQUE and NOT NULL.

Tables referenced