🧱SQL CREATE TABLE Statement Generator

Turn column definitions into dialect DDL

Types: int, bigint, varchar(n), decimal(p,s), text, bool, date, datetime, json, uuid. Options: pk, auto, notnull, unique, default=value (no spaces). Fields are split by the pipe character so the comma inside decimal(10,2) is never mistaken for a separator.

Before you run it

Type names and auto-increment syntax differ between dialects and cannot be mixed, so you pick one and the output uses only that dialect. MySQL gets AUTO_INCREMENT, PostgreSQL the SERIAL family, and SQLite INTEGER PRIMARY KEY AUTOINCREMENT. Table and column names pass an allow-list and are rejected otherwise.

Run the generated DDL in a development or seed environment first. Indexes, foreign keys, character sets and collations, partitioning and storage engines are out of scope, so this is not a statement to apply to a production database as it stands.

You Might Also Need

Write the columns one line at a time

List each column as a name, a type and options separated by pipe characters, one per line, and the CREATE TABLE statement for your chosen dialect comes back. Because the separator is not a comma, a type such as decimal(10,2) can be written exactly as it is. Mark several columns as pk for a composite primary key, and unique is added as a constraint per column.

Dialects are never mixed

Type names and auto-increment syntax differ per dialect, and a mixture runs on no database at all. So you pick MySQL, PostgreSQL or SQLite and the output uses that dialect alone. Auto-increment becomes AUTO_INCREMENT on MySQL, the SERIAL family on PostgreSQL and INTEGER PRIMARY KEY AUTOINCREMENT on SQLite, and every substitution made is noted under the result. Checked October 2026.

Identifier checks and limits

Table and column names allow only letters, digits, underscores and $; anything else is rejected rather than quoted to make it pass. Defaults other than numbers and NULL, TRUE, FALSE and CURRENT_TIMESTAMP are wrapped in single quotes with inner quotes doubled. Indexes, foreign keys, character sets and collations and partitioning are out of scope, so run the result in a development environment first.

Frequently Asked Questions

Why a pipe separator instead of a comma?

A type such as decimal(10,2) already contains a comma, so a comma cannot serve as the field separator. The pipe keeps those parenthesised commas intact.

Why does varchar(255) come out as TEXT on SQLite?

SQLite does not enforce a length limit, so varchar(255) and TEXT behave the same there. The type is mapped to the dialect and the substitution is noted under the result.

What does this tool not do?

It does not generate indexes, foreign keys, character sets or partitioning, and it does not produce ALTER statements for existing tables.