SQL Ddl Generator

Generate a CREATE TABLE statement for a database from a short description of the table.

Runs in your browser — nothing is uploaded
    More options

    Your result will appear here.

    Free, no account, no sign-up. Nothing is uploaded. Everything runs on your device.

    Generate a CREATE TABLE statement for a database from a short description of the table. You enter the table name, describe the columns, pick a dialect — PostgreSQL, MySQL or SQLite — and choose whether to include IF NOT EXISTS. Columns can be listed one per line, such as id SERIAL PRIMARY KEY and name VARCHAR(255) NOT NULL, or given as a JSON array of objects with name, type and flags such as primaryKey, notNull, unique and default. The tool checks every name is a valid identifier, quotes identifiers in the style of the dialect you chose, and adds the MySQL engine clause when that dialect is selected. The result is a complete statement you can run in your database. Everything runs in your browser with no upload, no account and nothing stored.

    How to use SQL Ddl Generator

    1. Set the options adjust the settings below — length, range, colours or dates.
    2. Click Convert the tool runs entirely in your browser — nothing is uploaded.
    3. Read your result it appears below the tool.
    4. Download the result save it for your records.
    5. Convert another change the options and convert again — no sign-up, no limits.

    Format facts

    InputNo file needed — set the options below the box and convert.
    EngineBuilt-in browser engine
    CategoryDeveloper Tools

    Frequently asked questions

    How do I describe the columns?

    One per line, such as id SERIAL PRIMARY KEY, or as a JSON array of objects with name, type and flags such as primaryKey, notNull, unique and default. Both forms produce the same statement.

    Which dialects are supported?

    PostgreSQL, MySQL and SQLite. Identifiers are quoted in the style of the dialect, and MySQL adds an ENGINE clause. Types are used exactly as you write them — the tool does not translate types between dialects.

    What does IF NOT EXISTS do?

    It makes the statement safe to run more than once: if the table already exists, the database leaves it alone instead of reporting an error. Turn it off when you want a duplicate to fail loudly.

    Does it create the database or the table data?

    No. It only writes the CREATE TABLE statement. Run it in your database yourself, and check the types against your database before running it on real data.