CREATE TABLE Generator

Generate CREATE TABLE DDL for PostgreSQL, MySQL, SQL Server or Oracle from a column list with allowed types.

Options

Input

Ctrl + Enter to run

Result

Generate a CREATE TABLE statement for PostgreSQL, MySQL, SQL Server or Oracle from a column list, one per line: name, type and optional modifiers (not null, unique, pk).

Types come from a closed list (integer, bigint, smallint, text, varchar(n), char(n), decimal(p,s), double, boolean, date, timestamp, timestamptz, uuid, json, binary) and are translated into each dialect’s equivalent, with warnings when there is no exact match.

How to use it

  1. Enter the table name.
  2. Choose the dialect.
  3. Write the columns, one per line.
  4. Press Run and review the warnings.

Example

Example input
id bigint pk
email varchar(255) not null unique
full_name varchar(120)
balance decimal(12,2) not null
is_active boolean not null
created_at timestamptz not null
Result
CREATE TABLE "customers" (
  "id" BIGINT NOT NULL,
  "email" VARCHAR(255) NOT NULL UNIQUE,
  "full_name" VARCHAR(120),
  "balance" NUMERIC(12,2) NOT NULL,
  "is_active" BOOLEAN NOT NULL,
  "created_at" TIMESTAMPTZ NOT NULL,
  PRIMARY KEY ("id")
);

Limitations

  • It does not generate DEFAULT values, foreign keys, indexes or CHECK constraints.
  • varchar/char lengths are limited to 1–4000 for portability.
  • Review the DDL before applying it: the tool does not know your real schema.

FAQ

Why does boolean become NUMBER(1) in Oracle?
Oracle had no table BOOLEAN until 23ai; NUMBER(1) is the most common compatible convention.
What about timestamptz in MySQL?
MySQL has no type that stores the time zone; DATETIME(6) is used and storing UTC is recommended.

Related tools