Six original Cambridge-style questions on primary keys, with worked solutions.
State the purpose of a primary key in a database table.
A vet stores data in a table PETS.
| PetID | Name | Species | OwnerSurname |
|---|---|---|---|
| P01 | Bella | Dog | Patel |
| P02 | Tom | Cat | Jones |
| P03 | Bella | Cat | Patel |
Identify the field that should be the primary key and give a reason.
Suppose every pet in the PETS table above had a different name. Explain why Name would still not be a suitable primary key.
Give two rules that the values in a primary key field must follow.
A sports centre stores bookings in a table with fields MemberName, Court, Date and StartTime. A member can make many bookings. Explain why none of these fields is a suitable primary key and suggest how the table could be given one.
A database designer chooses MobileNumber as the primary key for a table of customers. Give one problem with this choice and explain why it matters.
Mark this once you have attempted all six and checked your working. It records a Practiced badge on the topic and adds a one-time bonus. Revealing the solutions alone does not count.