Easier to read with cream paper, a tint, more contrast or larger text? Choose your colours and text, once, for every page.

Preview

Data dictionary and ERD

This is the first page of the lesson. Read it and have a go at the activities. The rest is in the full lesson.

45 minutes

Sign up for a club

A school has chess, football and drama clubs. A student can join many clubs. A club has many students.

What must the system remember? The name? The year? Which club? What if someone types year 20? In UK schools, the years go from 7 to 13.

Before you build tables, you write down every fact and every rule. This is the design step.

Key words

WordWhat it meansExample
DatabaseAn organised store of data that programs can search and change.
Data dictionaryA list of every field in the database, with its type, size and rules.
FieldOne fact in a table, such as a name. It is one column.
Data typeThe kind of value a field holds, such as text, whole number or date.
ValidationA check that data is sensible before it is stored.year must be 7 to 13
Primary keyA field that is different for every row. It finds one row.
Foreign keyA field that holds the primary key of a row in another table.
EntityA thing the database stores facts about, such as a member or a club. Each entity is a table.
ERDEntity relationship diagram. A picture of the tables and how they link.
One-to-manyOne row in table A links to many rows in table B.
Many-to-manyMany rows in A link to many rows in B. It needs a link table between them.

The cells students fill in are left blank in this preview.

Warm up: what to remember

Have a go

Warm up: what to remember

3 questions
Have a go: your answers are marked here and then forgotten. Sign in if you would like your score kept, and to pick up where you left off.Sign in to keep your score

Your answers are marked here and are not kept. A college account keeps every student’s marks.

The data dictionary

A data dictionary has one row for each field. Everybody on the team reads the same list. Nobody guesses.

For each field it says the name, the type, the size, if it is required, and the validation rule. Read the one below for the member table. Then answer the quick check.

A data dictionary for member

FieldTypeSizeRequiredValidationKey
member_idWhole numberUp to 6 digitsYesDifferent for every memberPrimary key
nameTextUp to 40 charactersYesNot empty
yearWhole number2 digitsYesFrom 7 to 13
emailTextUp to 80 charactersNoMust contain @

The cells students fill in are left blank in this preview.

Quick check: reading the dictionary

Have a go

Quick check: reading the dictionary

3 questions
Have a go: your answers are marked here and then forgotten. Sign in if you would like your score kept, and to pick up where you left off.Sign in to keep your score

Your answers are marked here and are not kept. A college account keeps every student’s marks.

The lesson goes on

8 more parts of this lesson are in the full curriculum, with the tasks, the final check and the labs. A college account gives your students all of it.