menu
save_alt Download

SQL Table Generator

A visual SQL table creator. Add columns, set keys and defaults, and get a ready-to-run CREATE TABLE statement for your database.

lock100% in browser

About this table generator

Design a database table without writing any DDL by hand. Add columns, pick their types, set primary keys, defaults, and constraints, then get a clean CREATE TABLE statement for your dialect, ready to run. It works as a MySQL, PostgreSQL, SQLite, SQL Server, Redshift, or Oracle table creator. New to the syntax? Our SQL CREATE TABLE guide walks through every clause.

storage

Six dialects

PostgreSQL, MySQL, SQLite, SQL Server, Amazon Redshift, and Oracle. Each gets the right quoting, types, and auto-increment syntax.

vpn_key

Keys and constraints

Mark primary keys, toggle nullability, add default values, and set auto-increment, all with a click.

lock

No nonsense

100% client-side code, so your schema never touches our servers. Plus - no ads, trackers, or other BS to deal with.

Frequently Asked Questions

Which databases does the table generator support?

The generator produces CREATE TABLE statements for PostgreSQL, MySQL, SQLite, SQL Server, Amazon Redshift, and Oracle. Each dialect uses its own identifier quoting, column types, and auto-increment syntax.

How is auto-increment handled for each database?

Tick the Auto inc box on a column and the tool writes the correct syntax per dialect:

  • PostgreSQL: SERIAL / BIGSERIAL
  • MySQL: AUTO_INCREMENT
  • SQL Server & Redshift: IDENTITY(1,1)
  • SQLite: INTEGER PRIMARY KEY AUTOINCREMENT
  • Oracle: GENERATED BY DEFAULT AS IDENTITY
How do I set a composite (multi-column) primary key?

Tick Primary on every column that belongs to the key. When more than one column is marked, the tool emits a table-level PRIMARY KEY (col_a, col_b) constraint instead of an inline one.

How do I add a default value?

Type the value into the Default field exactly as it should appear in SQL. Wrap literal strings in quotes (e.g. 'active'), and leave functions unquoted (e.g. CURRENT_TIMESTAMP or now()).

Can I reorder columns?

Yes. Use the up and down arrows on the left of each column to change the order, which is reflected directly in the generated statement.

Are column comments supported?

Where the database supports them. MySQL writes an inline COMMENT '…', while PostgreSQL, Redshift, and Oracle emit a separate COMMENT ON COLUMN statement. SQLite and SQL Server have no standard column-comment syntax, so the field is hidden for those dialects.

Is my schema data secure?

Yes. Every statement is generated in your browser, so nothing you type is uploaded to our servers. There are no trackers or ads either.

Can I generate a table from existing data instead?

Yes. The JSON to SQL and CSV to SQL converters infer a CREATE TABLE from your data and write the INSERT statements to fill it.

Make SQL fun again

Have you tried Beekeeper Studio, our fast, good-looking SQL editor and database manager for Mac, Windows, and Linux? It's open source and there's a beefy free community edition too. My favorite parts:

  • check_circle Visual table builder and editor
  • check_circle Query editor with autocomplete and highlighting
  • check_circle Open source, with a free Community Edition
Beekeeper Studio running a query against PostgreSQL

Beekeeper Studio's Mission

Our mission is to create open source software in order to improve database accessibility for everyone the world over.

Our commitments to you:
  • 😍 Great Feels - Using our software should make you feel warm and fuzzy inside because it is so nice to use.
  • 🔒 Respects Privacy - No creepy ad-tracking or selling your personal information. By default we don’t even know when you install the app, it’s none of our business!
  • 💾 Works Offline - You will never need an internet connection to use the app (why should you?)
  • 🌍 Inclusive - We are 100% inclusive and have a code of conduct. Diversity and inclusivity are good for Beekeeper, the tech community, and the world.
  • 💪 Open Source - We will always provide a feature-full community edition under an OSI approved license.