SQL Data Dictionary Generator
Paste the CREATE TABLE statements of your schema and get a ready-to-share data dictionary: every column with its type, nullability, default, primary key, foreign key and unique flags, the table it references, and its description. Comments are read from MySQL COMMENT clauses, PostgreSQL COMMENT ON statements, SQL Server extended properties and trailing -- comments. Export the database data dictionary as Markdown with a table of contents, a printable HTML page, CSV or JSON. Everything runs in your browser, so your schema is never uploaded.
| Column | Type | Null | Default | Key | References | Description |
|---|---|---|---|---|---|---|
| id | BIGINT UNSIGNED | NO | AUTO_INCREMENT | PK | Surrogate key | |
| VARCHAR(255) | NO | UQ | Login email, unique per customer | |||
| full_name | VARCHAR(120) | YES | NULL | Customer's display name | ||
| tier | ENUM('free','pro','enterprise') | NO | 'free' | Pricing tier | plan | ||
| created_at | DATETIME | NO | CURRENT_TIMESTAMP |
| Column | Type | Null | Default | Key | References | Description |
|---|---|---|---|---|---|---|
| id | BIGINT UNSIGNED | NO | AUTO_INCREMENT | PK | ||
| customer_id | BIGINT UNSIGNED | NO | FK | customers.id (ON DELETE CASCADE) | Who placed the order | |
| status | VARCHAR(20) | NO | 'pending' | pending, paid, shipped or cancelled | ||
| total | DECIMAL(12,2) | NO | '0.00' | Order total incl. tax | ||
| note | TEXT | YES | Free-text note, e.g. 'leave at door' | |||
| updated_at | TIMESTAMP | YES | CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP |
| Column | Type | Null | Default | Key | References | Description |
|---|---|---|---|---|---|---|
| order_id | BIGINT UNSIGNED | NO | PK, FK | orders.id | ||
| line_no | SMALLINT | NO | PK | |||
| sku | VARCHAR(40) | NO | stock keeping unit | |||
| quantity | INT | NO | 1 | |||
| unit_price | DECIMAL(10,2) | NO |
Do more than sql data dictionary generator — meet Chat2DB
Chat2DB is an AI-powered SQL client for Windows, macOS and Linux. Write SQL in natural language, format and optimize queries automatically, and manage MySQL, PostgreSQL, Oracle and 20+ other databases in one workspace.
Where the descriptions come from
A data dictionary is only as good as its descriptions. The generator reads every place a database stores documentation in DDL, so an export straight from your server produces a documented dictionary without extra work. Explicit comments always win over the trailing line-comment fallback.
MySQL and MariaDB
Column comments are written inline as COMMENT 'text' and table comments as the table option COMMENT='text' after the closing parenthesis. Both appear in SHOW CREATE TABLE and in mysqldump --no-data output. Escaped quotes such as 'it''s' and \' are decoded.
PostgreSQL
PostgreSQL keeps descriptions in separate COMMENT ON TABLE and COMMENT ON COLUMN statements, which pg_dump --schema-only writes after the CREATE TABLE statements. Keys added later with ALTER TABLE ONLY ... ADD CONSTRAINT ... PRIMARY KEY or FOREIGN KEY are merged into the table they belong to.
SQL Server
SQL Server stores descriptions as MS_Description extended properties. Script your tables from SSMS with "Script extended properties" enabled and the EXEC sp_addextendedproperty calls are picked up for both tables and columns. GO batch separators, [bracketed] names and IDENTITY columns are supported.
SQLite and everything else
SQLite has no comment syntax, so the generator falls back to -- comments written on the same line as a column, and to a comment on the CREATE TABLE line for the table description. The .schema command of the sqlite3 shell keeps those comments, so they make it into the dictionary.
How to use
- Export your schema as DDL (mysqldump --no-data, pg_dump --schema-only, SSMS Generate Scripts or sqlite3 .schema) and paste it, including any ALTER TABLE and COMMENT ON statements.
- Leave the dialect on Auto-detect or pick MySQL, PostgreSQL, SQL Server or SQLite, then check the preview and any warnings about unresolved keys or comments.
- Choose Markdown, HTML, CSV or JSON output and copy it or download the file for your wiki, README, spreadsheet or documentation site.
Frequently asked questions
What is a data dictionary in SQL?
A data dictionary is a reference document that lists every table and column of a database together with its data type, whether it accepts NULL, its default value, the keys and relationships it takes part in and a plain-language description. Databases keep this metadata internally (information_schema, pg_catalog, sys.columns), and a data dictionary generator turns it into a readable document that analysts, new developers and auditors can use without querying the catalog themselves.
How do I generate a data dictionary from an existing database?
Export the schema without data: mysqldump --no-data mydb for MySQL, pg_dump --schema-only mydb for PostgreSQL, Generate Scripts with extended properties in SQL Server Management Studio, or .schema in the sqlite3 shell. Paste the output here and the generator builds the dictionary, including composite primary keys, foreign keys added later with ALTER TABLE and all table and column comments. Nothing leaves your browser.
Can I browse and document a live database instead of pasting DDL?
This page works from DDL text only. Chat2DB is a free AI database client that connects to MySQL, PostgreSQL, SQL Server, Oracle and 20+ other databases, shows table structures, keys and comments, lets you edit column comments in place and can explain a schema with AI. Download it at https://chat2db.ai/download or use the web version at https://app.chat2db.ai.
