Sql Table Generator
Design columns and constraints, then generate CREATE TABLE SQL for MySQL, PostgreSQL, and SQLite in the browser.
SQL Table Generator - CREATE TABLE for MySQL, PostgreSQL, and SQLite
Designing a new table often starts with naming columns, picking types, and deciding nullability and keys. This generator
builds a CREATE TABLE statement you can paste into migrations, admin consoles, or documentation. Choose a
dialect so identifiers and type aliases match your engine—MySQL adds a default InnoDB/utf8mb4 clause, PostgreSQL maps JSON
to JSONB, and SQLite can emit an INTEGER PRIMARY KEY AUTOINCREMENT pattern for surrogate keys.
What you can configure
- Table name with engine-appropriate quoting (backticks, double quotes).
- Per-column name, logical type, optional length or precision, nullability, primary key, uniqueness, defaults, unsigned integers (MySQL), and auto-increment style helpers.
Before you run DDL in production
Generated SQL is a starting point. Review indexes, foreign keys, check constraints, collations, tablespaces, and permissions separately. Some combinations (multiple primary keys, conflicting SERIAL definitions) are invalid—fix them before execution.
Frequently Asked Questions
Does this create indexes or foreign keys?
Not automatically. Add CREATE INDEX or FOREIGN KEY statements after you finalize the table shape.
Why does PostgreSQL show SERIAL instead of INT?
When auto-increment is enabled on supported integer types, SERIAL/BIGSERIAL is a concise shorthand for an integer column with a sequence.
Can SQLite tables have more than one AUTOINCREMENT column?
No. Only a single INTEGER PRIMARY KEY AUTOINCREMENT column is valid; the tool follows that pattern when you enable the option on an INT column.
How should I enter DEFAULT values?
Type raw SQL fragments such as NULL, 0, 'draft', or CURRENT_TIMESTAMP depending on your dialect.
Related tools
Your recent visits