DDL to ER Diagram
Generates Mermaid ER diagram source from CREATE TABLE statements and their declared foreign keys.
Loading the tool…
How to use this tool
- Paste the CREATE TABLE statements for the tables you want on the diagram.
- Choose whether relationships should be drawn as optional or mandatory.
- Select Generate diagram, then paste the Mermaid source into a document that renders it.
What ddl to erd does
This reads your CREATE TABLE statements and writes Mermaid erDiagram source: one entity per table, its columns with types, and a relationship line for every foreign key the DDL declares. Mermaid renders in GitHub, GitLab, many wikis and most Markdown previewers, so the diagram travels with the document rather than living in a separate drawing file.
Only relationships written into the DDL appear. A foreign key enforced in application code, a soft reference by convention, or a join that exists only inside a query will be missing — not because the diagram is wrong, but because the script never said so. Treat the output as a faithful picture of the DDL, then add what the DDL does not know.