Choosing a suitable primary key from a table
The field chosen to identify each record. Its values must be unique and never blank, like an ID number. Names and dates of birth can repeat, so they are unsuitable.
Understanding Choosing a suitable primary key from a table in IGCSE Computer Science Paper 2
What it does: Names and dates of birth can repeat between records, so neither can identify one record reliably. A new ID field can be given a different value for each record, so it makes a suitable primary key when no existing field is unique. StudentID is different for every student. Two students can easily share the same name. A primary key must be unique. Many people share a date of birth, so the values can repeat. Date/time is a valid data type, so that is not the problem. A product code is unique to each product. Prices can be the same for many products.
Common mistakes: Name is the wrong primary key because two students can share the same name. The key should be the unique ID field, so the line should be PRIMARY KEY (StudentID). DOB has been made a primary key, but pupils can share a date of birth. Only PupilID, which is different for every pupil, should be the primary key. The line should be DOB DATE,.
Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.
This module's key terms are also in a printable crossword (Modules 500–522) and word search (Modules 500–538).
Take this worksheet further — free with Cloodit
Each concept is reinforced from every angle — learned, then applied, then tested.
Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.
Over 100 of them, across seven natural biomes.
Turns their work into revision material ready for Flash Cards and Exam study.
Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.
Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.
Quick Questions
Match the Pairs
Key Term
PRIMARY KEYFill in the Blanks
Spot the Error
Student with a class code? Join your class →