SQL e database

Generatore CREATE TABLE SQL online

Progetta colonne e vincoli visivamente e genera SQL pulito per il motore scelto. Nulla viene eseguito.

HostingerHosting veloce per il tuo sitoHosting, dominio e SSL in un unico posto.Vedi l'offerta ↗HostingerLancia oggi il tuo sitoHosting affidabile per nuovi progetti e siti in crescita.Vedi l'offerta ↗

Colonne

Constraints

Foreign keys

Indexes

Anteprima SQL

SQL table guide

What is CREATE TABLE?

CREATE TABLE is the SQL statement used to define a table, its columns and its constraints. This generator creates text for you to review; it never connects to a database.

SQL data types

Data types differ between MySQL, PostgreSQL and SQLite. The selector only offers types commonly supported by the chosen engine so the generated statement is easier to adapt.

Primary keys, indexes and foreign keys

A primary key identifies rows, indexes speed up searches, UNIQUE prevents duplicate values and foreign keys describe relationships between tables.

MySQL, PostgreSQL and SQLite

Each engine has its own quoting and identity syntax. Select the target engine and review the generated SQL before using it in a real schema.

Frequently asked questions

SQL Table Creator FAQ

How do I create an SQL table?

Enter a table name, add columns, choose their types and constraints, then copy or download the generated CREATE TABLE statement.

What is a PRIMARY KEY?

A primary key uniquely identifies each row in a table. It can be assigned to one column or defined as a composite key.

What does NOT NULL mean?

NOT NULL requires a value for that column when a row is inserted.

How do I create an auto-incrementing column?

Enable the identity option on an integer column. The generated syntax is adapted to MySQL, PostgreSQL or SQLite.

What is the difference between VARCHAR and TEXT?

VARCHAR is length-limited text, while TEXT is intended for longer content. The exact behavior depends on the database engine.

How do I create a foreign key?

Add a foreign key and provide the local column, referenced table and referenced column. Review the relationship before applying it.

What is a UNIQUE index?

A UNIQUE index prevents duplicate combinations of values in the indexed columns while also helping searches.

Does the tool execute the generated SQL?

No. It only generates SQL text. It does not connect to, modify or execute anything in a database.