DB Diagram

Design a relational database visually. Add tables, edit columns and keys, connect relationships, arrange your ERD, and export SQL without writing code.

Create a relational database visually

  1. Start with Blank database or the Order database template and choose SQLite, PostgreSQL, MySQL, or SQL Server for SQL export.
  2. Open a table in the left panel to edit column names, types, nullability, and primary keys. Use column options for uniqueness, auto increment, and SQL defaults.
  3. Connect a child column to a compatible parent primary or unique key. Renaming an endpoint keeps its relationship attached.

Arrange tables and review design decisions

Drag table headers, choose colors, and organize related tables in named groups. Selecting a canvas table highlights it; its pencil opens the table editor. Locate deliberately centers a table. Resize the left panel, or use the divider arrow to hide and reopen it at its previous width.

Add table comments and ordered single- or multi-column indexes. Review offers optional suggestions for empty tables, missing primary keys, foreign-key indexes, and duplicate indexes. These checks do not prove that a database is ready to deploy.

Save an editable model and export SQL

Sign in to save independent cloud files and share read-only views. Download editable JSON, export SQL, or open the generated SQL in a separate SQL workspace. Export diagram images as PNG, SVG, or PDF.

New designs stay in memory until saved or downloaded. SQL import, composite foreign-key editing, and live database connections are not available. The tool does not connect to your live database or apply migrations. Enable JavaScript to use the canvas.

Learn visual database design

Read the DB Diagram guide for controls, relationships, file limits, and export workflows.

Choose the right modeling tool

Use DB Diagram for relational tables and foreign keys. SQL to ERD starts from existing SQL. ERD Builder models conceptual Chen and EER diagrams.