Columns

Column Name Data Type Length Primary Not Null Auto Inc
MySQL CREATE TABLE Statement
-- Add columns and click Generate to create your table

Quick Templates

What is MySQL Table Creator?

A MySQL Table Creator is a free online tool that helps you create MySQL tables through a visual interface. MySQL is the world's most popular open-source relational database.

Instead of memorizing CREATE TABLE syntax, you can define columns visually and instantly see the generated SQL.

Why Use MySQL Table Creator?

  • No SQL Knowledge Required — Build tables visually
  • Instant SQL Generation — See results as you add columns
  • Data Type Selection — Choose appropriate types
  • Primary Key Support — Set up keys easily
  • Ready-to-Use Templates — Users, Posts, Orders, Products

MySQL Data Types

TypeDescriptionSize
INTInteger numbers4 bytes
BIGINTLarge integers8 bytes
VARCHAR(n)Variable text1-65,535 bytes
TEXTLong text65,535 bytes
DECIMAL(p,s)Precise numbersVariable
DATEDate only3 bytes
DATETIMEDate and time8 bytes
TIMESTAMPAuto timestamp4 bytes
BOOLEANTrue/False1 byte
JSONJSON dataVariable

Column Constraints

  • PRIMARY KEY — Unique identifier, auto-indexed
  • NOT NULL — Column cannot be empty
  • AUTO_INCREMENT — Auto-generates sequential numbers
  • UNIQUE — All values must be different
  • DEFAULT — Sets default value if none provided
  • FOREIGN KEY — Links to another table

Example CREATE TABLE

CREATE TABLE users (
  id BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY,
  name VARCHAR(100) NOT NULL,
  email VARCHAR(255) NOT NULL,
  created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
  status VARCHAR(20) DEFAULT 'active'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

How to Use MySQL Table Creator

  1. Enter the table name
  2. Add columns with the Add Column button
  3. Select data types and lengths
  4. Check PRIMARY KEY for ID columns
  5. Choose NOT NULL for required fields
  6. Select ENGINE and CHARSET
  7. Click Generate to create the SQL
  8. Copy the CREATE TABLE statement

Quick Templates

  • Users — id, name, email, password, timestamps
  • Posts — id, user_id, title, content, status, timestamps
  • Orders — id, user_id, total, status, timestamps
  • Products — id, name, price, stock, timestamps

Frequently Asked Questions

What's the difference between VARCHAR and TEXT?

VARCHAR is variable-length with a maximum you specify (e.g., VARCHAR(255)). TEXT has a fixed 65KB limit and cannot be indexed directly.

Should I use INT or BIGINT for IDs?

Use BIGINT for primary keys in high-traffic applications. INT is fine for smaller tables (up to 4 billion rows).

What's the difference between InnoDB and MyISAM?

InnoDB is recommended for most cases. It supports transactions, foreign keys, and row-level locking. MyISAM is older and better for read-heavy tables.

Why use utf8mb4 instead of utf8?

MySQL's "utf8" is limited to 3 bytes per character. utf8mb4 supports full 4-byte Unicode characters including emojis.