Developer and Text Tools

How to Build a Data Dictionary from a SQL Schema or CSV

Create a data dictionary from SQL DDL or CSV files, describe columns, keys and owners, flag personal data and publish it as HTML, Excel or Markdown.

Saizul Amin
Saizul Amin2 Nov 2026 · 3 min read
How to Build a Data Dictionary from a SQL Schema or CSV

How to Build a Data Dictionary from a SQL Schema or CSV

Every database eventually reaches the point where nobody remembers what half the columns mean. Is amount stored in pounds or pence? Does status include refunded orders? Which table holds the real customer email? A data dictionary answers these questions in one place, and it is one of the cheapest ways to prevent wrong reports and wasted analyst time. This guide shows how to build one quickly from what you already have and keep it alive.

What belongs in a data dictionary

For each table: what one row represents, who owns it and where the data comes from. For each column: its name and type, whether it can be empty, whether it is a primary key, a foreign key or unique, its default, a plain-language description, a realistic example, the allowed values if it has a fixed set, whether it holds personal data and who to ask about it. That is enough for most teams. Resist adding twenty more fields that nobody will fill in.

Start from the schema, not a blank page

Typing table and column names by hand is slow and goes out of date. Instead, export the schema. Most database tools can produce the CREATE TABLE statements for every table, for example pg_dump with the schema-only option for PostgreSQL, mysqldump with no data for MySQL, or the generate scripts command in SQL Server tools. Paste or drop that SQL into the Data Dictionary Builder.

The import reads tables, columns, types, NOT NULL, primary keys, foreign keys, unique constraints and defaults. Any documentation that already lives in the database comes along too: COMMENT ON statements and inline column comments become descriptions. Many teams find they have more existing documentation than they realised.

If your data lives in files rather than a database, drop the CSV or Excel files instead. Each file or sheet becomes a table, and types, nullability, examples and short lists of allowed values are guessed from the rows themselves.

Write descriptions that actually help

A good description says what the value means in business terms and anything surprising about it. Order value including VAT, in pence is helpful. The amount is not. Mention units, currencies, time zones, how nulls should be read and any known quirks, such as a column that was only filled from a certain date. Add an example value; it often clarifies more than a sentence.

Work through the tables with the filter that shows only undocumented columns and watch the described percentage rise. Prioritise the tables people query most rather than trying to document everything at once.

Ownership and personal data

Assign an owner to every table, and to individual columns where responsibility differs. Owners are who people ask when something looks wrong, and who approves changes. The builder counts tables without an owner so gaps are visible.

Columns whose names suggest personal data, such as email, phone, name, address or date of birth, are flagged automatically. Review the flags, add any the names do not reveal, and use the list when answering privacy questions or planning access controls. Remember that a name-based flag is a starting point, not a legal assessment.

Publish where people will look

Documentation nobody can find is not documentation. Export a single HTML page with a table of contents and share it on your intranet or wiki. Export Markdown if your team lives in a Git repository. Export Excel when colleagues prefer to review and fill in descriptions in a spreadsheet; the builder can import that sheet back, so their work is not lost.

The SQL export writes CREATE TABLE statements with COMMENT ON lines. Running the comment statements against your database puts the descriptions where developers and many BI tools will see them automatically.

Keep it current

After each schema change, import the new DDL again. Table structures are refreshed, while descriptions, owners, examples and allowed values already written for unchanged columns are kept. New columns show up undocumented, which makes them easy to spot. Save the project file alongside your schema, and the dictionary becomes part of normal development rather than a one-off project.

Completely freeNo cost, no sign-up
Files stay privateEverything runs in your browser
Easy in your languageAvailable in many languages