Database Schema & SQL DDL Tool
Runs locallyInspect SQL DDL tables, generate Mermaid ER diagrams and convert between SQL dialects.
What is Database Schema & SQL DDL Tool?
Draft and inspect SQL `CREATE TABLE` DDL statements, visualize tables, primary keys, and foreign-key relationships, generate Mermaid `erDiagram` markup, and format SQL cleanly.
How to use Database Schema & SQL DDL Tool
- Step 1
Paste CREATE TABLE SQL DDL statements.
- Step 2
Inspect parsed columns, types, constraints, and relationships.
- Step 3
Copy formatted DDL, Mermaid ER diagram code, or TypeScript interfaces.
Features
- Parses CREATE TABLE columns, PRIMARY KEY, UNIQUE, NOT NULL, and REFERENCES
- Generates Mermaid `erDiagram` syntax automatically
- Formats DDL across PostgreSQL, MySQL, and SQLite
- 100% browser-based
Example
Input
CREATE TABLE users (id INT PRIMARY KEY, email TEXT NOT NULL);
Output
erDiagram
users {
INT id PK
TEXT email
}Turns SQL DDL into readable ER diagrams and structured schemas.
Frequently asked questions
Which SQL DDL statements are supported?
Standard CREATE TABLE blocks with inline or table-level PRIMARY KEY and FOREIGN KEY constraints.
Can I export a Mermaid ER diagram?
Yes, switch to the ER Diagram tab to copy Mermaid markup.
Is my database schema uploaded?
No, runs locally in your browser.
Can it format messy DDL?
Yes, uses sql-formatter for PostgreSQL, MySQL, and SQLite.
Related tools
SQL Formatter
Format SQL queries across PostgreSQL, MySQL, SQLite, BigQuery, Snowflake and T-SQL.
SQL Query Builder
Compose SELECT, JOIN, WHERE, GROUP BY and ORDER BY SQL queries visually with formatting.
JSON to TypeScript Converter
Generate TypeScript interfaces, types, Zod schemas, Kotlin, Swift, Dart and Go models.