SQL Table Generator (CREATE TABLE)
Define your columns in the table editor and get a ready-to-run `CREATE TABLE` statement with the right syntax for your chosen database — MySQL, PostgreSQL, SQLite, SQL Server, or standard SQL.
Last updated: May 27, 2026
Find this tool useful? Support the project to keep it free!
Buy me a coffeeWhat is SQL Table Generator (CREATE TABLE)?
Every database has slightly different syntax for the parts of `CREATE TABLE` that vary the most: identifier quoting, auto-increment columns, and certain type names. MySQL uses backticks and `AUTO_INCREMENT`; PostgreSQL uses double quotes and `SERIAL`/`BIGSERIAL` (or `GENERATED BY DEFAULT AS IDENTITY`); SQL Server uses brackets and `IDENTITY(1,1)`; SQLite makes `INTEGER PRIMARY KEY` auto-increment.
This tool takes a single column definition and emits the correct syntax for each dialect. Define your columns once in the table, pick a dialect, and you get a clean CREATE TABLE statement ready to paste into your migration or schema file. Switch dialects to compare how the same schema looks in each database.
How to Use SQL Table Generator (CREATE TABLE)
Set the table name and pick a dialect.
Toggle "IF NOT EXISTS" if you want an idempotent statement.
For each column, set the name, type, length (for VARCHAR/DECIMAL), and constraints (NOT NULL, PRIMARY KEY, UNIQUE, AUTO_INCREMENT, DEFAULT).
Add or remove columns as needed.
Copy the generated SQL.
Common Use Cases
- Bootstrapping a new table for an application schema.
- Comparing CREATE TABLE syntax across MySQL, PostgreSQL, SQLite, and SQL Server.
- Producing initial migration files for ORMs like Sequelize, Prisma, or SQLAlchemy.
- Generating teaching examples for a SQL course.
Example Input and Output
A three-column users table with auto-increment ID for MySQL.
Dialect: MySQL · table: users · columns: id (INT, PK, AUTO_INCREMENT), name (VARCHAR(255), NOT NULL), created_at (TIMESTAMP, DEFAULT CURRENT_TIMESTAMP)CREATE TABLE IF NOT EXISTS `users` (
`id` INT AUTO_INCREMENT NOT NULL,
`name` VARCHAR(255) NOT NULL,
`created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
);Privacy
All generation happens in your browser. No table definitions are sent to a server.
Migrations
Generated SQL is a starting point — for production migrations, version-control the SQL file and run it through your migration tool (Flyway, Liquibase, Prisma Migrate, Alembic) so it tracks applied state.

