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
- Start with Blank database or the Order database template and choose SQLite, PostgreSQL, MySQL, or SQL Server for SQL export.
- 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.
- 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.
DB Diagram supports single-column and composite foreign keys. For a composite key, choose the complete primary or unique key and review all column pairs. They are saved, edited and exported as one relationship.
This tool does not connect to a live database, apply migrations, or execute SQL against your production data.
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.