# SQL to ER Diagram > A free ER diagram maker that runs in the browser: paste or open CREATE TABLE statements and download an entity-relationship diagram as SVG or PNG, or copy it as Mermaid or DBML. https://sql-to-erd.skillsafe.ai/ ## What it does (free, no sign-in, nothing uploaded) - Reads CREATE TABLE (column and table constraints), ALTER TABLE (ADD CONSTRAINT, ADD COLUMN, ALTER/MODIFY/CHANGE/RENAME/DROP COLUMN) and CREATE INDEX from PostgreSQL, MySQL/MariaDB, SQLite and SQL Server. INSERT, views, functions and settings are skipped and counted. - Draws every foreign key as a line from its column to the referenced key, with crow's foot ends (fork = many, two bars = exactly one, circle = zero allowed) or 1 and N labels. Referenced tables sit to the left; tables with no relationships go in a grid below. A reference to a table that is not in the SQL is drawn as a dashed box. - Shows all columns, keys only or table names only; four colour sets; types on or off; three text sizes; white, transparent or dark background. - Free checks, each with fix SQL where one statement fixes it: table without a primary key, foreign key to a missing table or column, foreign key to a non-unique column, foreign key typed differently from its target, foreign key without an index (not raised for MySQL, which indexes them itself), foreign keys without an ON DELETE rule, money in FLOAT/REAL/DOUBLE, dates stored as text, `_id` columns with no foreign key, numbered or packed list columns, VARCHAR(255) everywhere, tables without created_at. One button appends the fixes to the SQL and redraws. - Exports: SVG, PNG (2x), Mermaid erDiagram, DBML for dbdiagram.io, and a Markdown data dictionary. ## Optional AI step (signed-in, metered) "Review the design with AI" reads the schema and returns new design findings (missing unique keys, NOT NULLs and CHECKs, data stored twice, delete rules, junction tables and more), each with fix SQL in the detected dialect. It says which free checks it agrees with or disputes. The page checks every table, column and fix the review names against the schema, applies each fix to a copy to see which checks it clears, and computes the verdict from the severities itself. - API: https://sql-to-erd.skillsafe.ai/api.html - Input fields: `task` ("review"), `sql` (table statements only, comments removed, at most 14,000 characters, whole statements), `focus` (optional, up to 200 characters: how the database is used), `dialect` (postgres, mysql, sqlite, sqlserver or generic), `facts` (JSON text: tables with pk, column count and foreign keys; the free checks with ids), `clipped_note`. - Output: one ```json object: `task`, `findings` (at most 10; each `kind`, `severity`, `table`, `columns`, `why`, `fix_sql`), `agreed` (check ids), `disputed` (`{id, reason}`). ## Source Adapted from the agent skill @softaworks/database-schema-designer by Softaworks (https://github.com/softaworks/agent-toolkit, MIT): https://skillsafe.ai/skill/@softaworks/database-schema-designer