IGCSE · Practice questions · Primary keys

Unique, every time.

Six original Cambridge-style questions on primary keys, with worked solutions.

Original questions All questions on this page are original work, written in the Cambridge IGCSE style. They are not from past papers. They test the same concepts and skills the syllabus rewards.
Keep these straight

Can it ever repeat?

01
Recall
[1 marks]

State the purpose of a primary key in a database table.

  • To uniquely identify each record in the table. ✓
02
Apply
[2 marks]

A vet stores data in a table PETS.

PetIDNameSpeciesOwnerSurname
P01BellaDogPatel
P02TomCatJones
P03BellaCatPatel

Identify the field that should be the primary key and give a reason.

  • PetID. ✓
  • It is different for every pet; Name (Bella), Species (Cat) and OwnerSurname (Patel) all repeat. ✓
03
Explain
[2 marks]

Suppose every pet in the PETS table above had a different name. Explain why Name would still not be a suitable primary key.

  • A primary key must be unique for every record that could ever be stored, not just the ones shown. ✓
  • Two different pets could be given the same name in future, so uniqueness is not guaranteed. ✓
04
Recall
[2 marks]

Give two rules that the values in a primary key field must follow.

  • Each value must be unique (no two records have the same value). ✓
  • Each record must have a value (it cannot be left empty). ✓
05
Apply
[3 marks]

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.

  • MemberName repeats because one member makes many bookings; Court, Date and StartTime are also shared by many bookings. ✓
  • So no single field uniquely identifies a booking. ✓
  • Add a new field, e.g. BookingID, with a different value for every booking, and make it the primary key. ✓
06
Analysis
[2 marks]

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.

  • Problem: a customer may have no mobile number, or two customers (e.g. in one family) may share a number, or a customer may change their number. ✓
  • Why it matters: the key would then be empty or repeated, so it would no longer uniquely identify each record. ✓

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.