CodeBlanks Logo Icon CodeBlanks
Free database design tool

Draw your database, get the SQL

Add tables and columns, connect them by dragging. When you are done, get the CREATE TABLE statements for your database in one click. No account needed to start.

Design a database Start without signing up
  • Free
  • 6 databases
  • SQL, PNG and SVG

What can you do?

Build your schema visually without writing SQL; let the tool write the code when you are ready.

Tables and columns

Add tables, give columns a type and mark primary key, not null, unique and auto increment in one click.

Drag to relate

Drag a column onto another table's column to create a foreign key with ON DELETE and ON UPDATE rules.

SQL for 6 databases

Generate correct SQL for MySQL, MariaDB, PostgreSQL, SQLite, SQL Server and Oracle from the same design.

Laravel and DBML

Export your schema as a Laravel migration or as DBML.

PNG and SVG

Download your diagram as an image for docs and presentations.

Problem check

Tables without a primary key, duplicate columns and empty names are listed instantly.

Undo and autosave

Every change can be undone; your design saves as you work.

Auto layout

Arrange tables into tidy columns by their relationships in one click.

How does it work?

  1. Add tables

    Double-click the canvas or press "Add table"; edit columns in the right panel.

  2. Connect them

    Drag the foreign key column onto the primary key of the table it references.

  3. Get the SQL

    Pick a database in the export window, copy the code or download a .sql file.

Who is it for?

Students

Draw the ER diagrams from database courses and see the matching SQL.

Developers

Plan a new project's schema before coding and get the migration ready.

Teams

Share the schema visually; PNG or SVG drops straight into docs.

Teachers

Explain normalization and relationship types with a live diagram.

How do you design a database schema?

A good schema keeps one entity per table (user, order, product) and moves repeated data into separate tables. Every table needs a primary key that uniquely identifies its rows.

Tables are linked with foreign keys. In a one-to-many relationship the foreign key lives on the "many" side; a many-to-many relationship uses a junction table that points to both tables.

Databases write the same thing differently: an auto-increment id is AUTO_INCREMENT in MySQL, GENERATED AS IDENTITY in PostgreSQL and IDENTITY(1,1) in SQL Server. DB Designer handles these differences for you.

Frequently asked questions

Is DB Designer free?

Yes. Creating designs and exporting them as SQL, PNG or SVG is free.

Do I need an account?

No. You can design and export without signing up; your draft is kept in your browser session. Sign in with a free account to keep your designs.

Will I lose my draft when I sign in?

No. Your guest draft is saved to your account automatically when you sign in.

Which databases are supported?

It generates SQL for MySQL, MariaDB, PostgreSQL, SQLite, SQL Server and Oracle, plus Laravel migrations and DBML.

Draw your first database schema now

Add your tables, connect them and get the SQL in minutes.

Design a database

More tools and content