SQL Table Generator
Describe your columns and build a clean CREATE TABLE statement for your database.
Build a CREATE TABLE statement
Columns: 0
Warnings: none
How to use the SQL Table Generator
- Name the table and choose MySQL, PostgreSQL or SQLite as the dialect.
- List one column per line with its type, then add flags such as primary or notnull.
- Click Build statement and copy the SQL or download it as a .sql file.
Features
- Column list with types, lengths and flags
- Primary keys, unique, not null and auto increment
- Default values and foreign key references
- MySQL, PostgreSQL and SQLite dialects
Advertisement
Frequently Asked Questions
Common questions about the free online sql table generator.
Name the table, list one column per line with its type and flags, then click Build statement
and copy the SQL into your migration.
Start with the column name, then the type such as VARCHAR(120), then flags like primary,
auto, notnull, unique or default.
MySQL, PostgreSQL and SQLite. The tool adjusts auto increment keywords, timestamp types and
the table options line for each dialect.
Write a line such as id INT primary auto. MySQL gets AUTO_INCREMENT, SQLite gets
AUTOINCREMENT and PostgreSQL switches the type to SERIAL.
Add refs:table.column to a column line, for example user_id INT refs:users.id, and the
statement gains a FOREIGN KEY clause.
Numbers and known keywords such as CURRENT_TIMESTAMP are left unquoted. Any other value is
wrapped in single quotes with quotes escaped.
The tool reports a column with no type, an unknown flag or a malformed reference so you can
fix the line before running the SQL.
No. The statement is built from your text inside the browser and is never sent anywhere.
It makes the script safe to run twice, but migrations often prefer explicit versioning, so
untick it if your tool manages changes.
Only the table statement. Add CREATE INDEX lines yourself after the table if a column needs a
separate index.
Last updated: October 10, 2026