What does "size" mean here?
A builder gets your diagram and sees a field called size. Is it a number of centimetres, a word like "large", or a count of characters?
A page of descriptions answers questions like that before anybody has to ask.
Key words
| Word | What it means |
|---|---|
| Data dictionary | a table that describes every attribute: its type, size, rules and an example |
| Data type | the kind of value an attribute holds, such as whole number, text or date |
| Field size | the largest length or value an attribute may have |
| Validation | a check that data is sensible when it goes in |
| Verification | a check that data was copied correctly, such as typing it twice |
| Data assurance | the checks that make data accurate and reliable |
| Attribute | one fact about an entity, such as a name |
The cells students fill in are left blank in this preview.
By the end of this lesson
Note
I can write a data dictionary with types, sizes and rules, and name the data assurance checks that go with it.
Starter
Have a go
Starter
3 questionsYour answers are marked here and are not kept. A college account keeps every student’s marks.
This is practice
Important
The real task comes from the exam board. This lesson uses an invented organisation and its own made-up data. Your teacher tells you how the real tasks are set and what you may bring.
Worked example: a dictionary for Customer
| Attribute | Type | Size | Key | Required | Rule | Example |
|---|---|---|---|---|---|---|
| customer_id | Whole number | n/a | Primary | Yes | Unique, given by the system | 17 |
| name | Text | 40 | No | Yes | At most 40 characters | Maya Ford |
| town | Text | 30 | No | No | May be empty | Hillside |
| date_joined | Date | 10 | No | Yes | A real date, YYYY-MM-DD | 2026-02-01 |
| points | Whole number | n/a | No | Yes | Zero or more | 3 |
The cells students fill in are left blank in this preview.
Choose a type and a size
Choose the smallest type that always fits. A whole number for a count, text for a name, a date for a date.
Money is best stored as whole pence, because a decimal number can be a tiny bit wrong. A phone number is text, not a number: you never add two of them, and a leading zero must stay.
Run it: a dictionary turned into a table
SELECT name, type, "notnull" AS required, pk AS is_key
FROM pragma_table_info('customer');Data assurance in plain words
Validation checks a value when it goes in. Is it present? Is it the right type? Is it in range? Is it the right format? Is it short enough?
Verification checks it was copied right, for example by typing an email twice.
Write the rule in the dictionary. Then build it into the table, so the table refuses a bad value.