Keys, types and forms
Answers are for parents and teachers.
1
Look at the table. How many fields and how many records does it have? Which field is the best primary key?
| TagNo | Name | Species | Age |
|---|---|---|---|
| 31 | Coco | cat | 2 |
| 32 | Rex | dog | 3 |
| 33 | Coco | dog | 3 |
| 34 | Pip | rabbit | 1 |
There are 4 fields and 4 records. TagNo is the best primary key, because every tag number is different. Name and Species both repeat.
2
Choose a data type for each field of a table about a school trip: Date of trip, Cost per child, Number of children, Permission slip returned (yes or no), Teacher’s name.
Date of trip: Date/Time. Cost per child: Currency. Number of children: Number. Permission slip returned: Yes/No. Teacher’s name: Text.
3
Why do schools give each pupil a pupil number, even if every pupil already has a name? Answer in two sentences.
Two pupils can have the same name, so the name cannot tell the records apart. A pupil number is different for every pupil, so it works as a primary key and the right record is always found.
4
Rewrite each line to make the form better: ‘Date: ______’, ‘Pet: ______’ (the answers are always dog, cat or other).
‘Date of birth: Day ___ Month ___ Year ____ (for example 05 / 09 / 2014)’ shows the format. ‘Pet (tick one): dog cat other’ uses multiple choice, so there are no spelling mistakes.
5
Make a data dictionary with five fields for a table that stores the books in a class library. Mark the primary key with a star.
Model answer: BookID (Autonumber, *), Title (Text, 40), Author (Text, 30), Pages (Number), OnLoan (Yes/No). Different sensible fields are fine if the types match and the key is unique.