SQL y bases de datos

Generador CREATE TABLE SQL online

Diseña columnas y restricciones visualmente y genera SQL limpio para el motor seleccionado. Nunca se ejecuta nada.

HostingerHosting rápido para tu webAlojamiento, dominio y SSL desde un mismo lugar.Ver oferta ↗HostingerLanza tu web hoyHosting fiable para proyectos nuevos y sitios en crecimiento.Ver oferta ↗

Columnas

Restricciones

Claves foráneas

Índices

Vista previa SQL

Guía de tablas SQL

¿Qué es CREATE TABLE?

CREATE TABLE es la sentencia SQL utilizada para definir una tabla, sus columnas y restricciones. Esta herramienta genera texto para revisarlo, pero nunca conecta con una base de datos.

Tipos de datos SQL

Los tipos de datos varían entre MySQL, PostgreSQL y SQLite. El selector muestra tipos habituales del motor elegido para facilitar la adaptación del resultado.

Claves primarias, índices y claves foráneas

La clave primaria identifica filas, los índices aceleran búsquedas, UNIQUE evita duplicados y las claves foráneas describen relaciones entre tablas.

MySQL, PostgreSQL y SQLite

Cada motor tiene su propio quoting y sintaxis de identidad. Elige el motor y revisa el SQL generado antes de utilizarlo en un esquema real.

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.