SQL to Pele ER Diagram Converter
Convert SQL CREATE TABLE statements into a Pele ER diagram. Review foreign keys, optional inferred links and warnings before exporting source.
Visualize a SQL schema before your next review
Paste table definitions to make columns, keys, and relationships easier to discuss. This SQL to ER diagram converter reads CREATE TABLE statements locally in your browser. It does not connect to a database or execute the SQL.
Two tables connected by an explicit foreign key
Input
CREATE TABLE customers (
id INT PRIMARY KEY,
name VARCHAR(100)
);
CREATE TABLE orders (
id INT PRIMARY KEY,
customer_id INT,
FOREIGN KEY (customer_id) REFERENCES customers(id)
);Diagram source
erDiagram
customers {
int id PK
varchar name
}
orders {
int id PK
int customer_id FK
}
customers ||--o{ orders : "customer_id"How to use this tool
- Select the dialect that matches your SQL: MySQL, PostgreSQL, SQLite, or MariaDB.
- Paste the CREATE TABLE statements. Decide whether to enable inferred relationships from column names.
- Convert, read the warnings, and inspect the ERD source before copying or downloading it.
What the schema conversion preserves
| Schema detail | Result and review point |
|---|---|
| Tables and columns | Become entities and attributes. Names may be normalized; check warnings for identifier changes. |
| Primary and foreign keys | Key markers and explicit references help explain links. Review composite keys and relationship cardinality in the generated output. |
| Inferred relationships | Naming conventions can suggest a link, but a matching column name does not prove a database constraint. Disable inference when you need only declared relationships. |
| Other SQL statements | Only CREATE TABLE is converted. Other parsed statement types are skipped with warnings; dialect-specific syntax can fail parsing. |
Common questions
Can I upload a full database dump?
Use the schema definitions rather than row data. Input is limited to 200,000 characters. Split a large schema into related groups and include referenced tables in each group.
Why is a relationship missing?
Check that the foreign key is declared in a CREATE TABLE statement and that the referenced table is included. An ALTER TABLE statement is not converted. Name-based inference is optional and should be checked manually.
Can I edit an ERD without SQL?
Use the ER diagram builder to enter entities, attributes, and relationships directly. It is useful for planning a schema before you have DDL.