SQL Table Generator

Generate CREATE TABLE statements visually — add columns, pick types, set constraints, choose your database dialect.

Name Type Len PK AI NN UQ Default
PK=Primary Key   AI=Auto Increment   NN=Not Null   UQ=Unique

About SQL Table Generator

The CREATE TABLE statement is the foundation of any relational database schema. Writing it correctly for different databases requires knowing each system's specific syntax for data types, auto-increment, primary keys, and character sets. This generator handles all dialect differences — MySQL's AUTO_INCREMENT and backtick quoting, PostgreSQL's SERIAL, SQLite's INTEGER PRIMARY KEY, and SQL Server's IDENTITY(1,1) syntax.

The visual column editor is faster and more reliable than writing DDL by hand, especially for tables with many columns. Each column's type, length, and all five common constraints (Primary Key, Auto Increment, Not Null, Unique, Default) are configurable with checkboxes and inputs. The generated SQL is immediately ready to execute in your database client.

FAQ

What data types are available?
INT, BIGINT, SMALLINT, TINYINT, VARCHAR(n), CHAR(n), TEXT, MEDIUMTEXT, LONGTEXT, DECIMAL(p,s), FLOAT, DOUBLE, BOOLEAN, DATE, DATETIME, TIMESTAMP, TIME, YEAR, JSON, BLOB, and UUID. The generator uses dialect-appropriate equivalents where types differ between databases.
How do I add foreign key constraints?
Add the foreign key column using the table generator, then manually append the FOREIGN KEY constraint to the generated SQL: FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE. The SQL Schema Generator tool supports multi-table schemas with relationships defined visually.