Template: Describe Your Table in a Simple Data Dictionary

A data dictionary is a plain description of your tables: what each column means, what type it is and what rules apply. It sounds formal, but for a small project it is just a short table you keep next to your code. It helps you, your teammates and your teacher understand the data.

The template

Copy this for each table.

TABLE: <table name>
PURPOSE: <one sentence: what does each row represent?>
PRIMARY KEY: <column(s)>

| Column | Type | Required? | Unique? | Meaning | Example |
|--------|------|-----------|---------|---------|---------|
|        |      |           |         |         |         |

LINKS TO OTHER TABLES:
- <column> refers to <other_table>.<column>

NOTES:
- <anything surprising, such as units or special values>

How to fill it in

Example: a small library app

TABLE: books
PURPOSE: Each row is one book the library owns.
PRIMARY KEY: id

| Column      | Type    | Required? | Unique? | Meaning                         | Example             |
|-------------|---------|-----------|---------|---------------------------------|---------------------|
| id          | INTEGER | yes       | yes     | Number the database gives a book | 17                  |
| title       | TEXT    | yes       | no      | The book's title                | The Hobbit          |
| author_id   | INTEGER | yes       | no      | Who wrote it                    | 4                   |
| isbn        | TEXT    | no        | yes     | Book number printed on the cover | 978-0-00-000000-0   |
| added_on    | DATE    | yes       | no      | When the library got it         | 2025-03-01          |

LINKS TO OTHER TABLES:
- author_id refers to authors.id

NOTES:
- isbn may be NULL for very old books without one.

Why bother?

  1. It catches design problems. Writing "Meaning" for each column often reveals two columns that mean the same thing, or one column doing two jobs.
  2. It helps others. A classmate joining your project understands the data in minutes.
  3. It helps future you. Three months later, "what does status 2 mean?" has an answer.

Keeping it up to date

Store the dictionary in your project, for example as a markdown file next to your code. Whenever you change a table, change the dictionary in the same step. A dictionary that is out of date is worse than none, because people trust it.

Related pages

Schema Designer for Your First Tables helps you sketch the tables, and Understanding SQL Data Types When You Are Just Starting helps with the Type column.

A free learning page for beginners. Practise on a test database, never on real customer data, and check the official documentation for your database version.