Primary Keys (Cambridge International IGCSE Computer Science)
Exam board Cambridge International · IGCSEUpdated 2026-01-05
Spec point — "3 Understand the purpose of a primary key and identify a suitable primary key for a given database table"
Primary Keys
What is a primary key?
-
A primary key is a unique field that can be used to identify a record in a table
-
customer_id is the primary key for the customers table below
-
Other examples of primary keys in database tables would include:
- Student_ID in a school database
- Car_Registration in a car database
- Product_ID in a shop database
| CustomerID | FirstName | LastName | DOB | PhoneNumber |
|---|---|---|---|---|
| 001 | Andrea | Bycroft | 05031976 | 0746762883 |
| 002 | Melissa | Langler | 22012001 | 0756372892 |
| 003 | Amy | George | 22111988 | 074637 |
Key database terminology
| Term | Definition |
|---|---|
| Table | A collection of records with a similar structure |
| Record | A group of related fields, representing one data entry |
| Field | A single piece of data in a record |
| Data type | Type of data held in a field |
| Primary key | A unique identifier for each record in a table, usually an ID number |
Worked Example A database has been developed for a dance club to store information about their members.
The database contains one table: Members
Figure A shows some data from the table.
Members
MemberID FirstName LastName DateJoined 1 Zarmeen Hussain 2024-01-19 2 Fyn Ball 2024-02-01 3 George Johnson 2024-02-25 4 Ella Franks 2024-03-04 State the name of the field from the Members table that is the most suitable to use as the primary key [1]
Final answer: Answer
- (a) MemberID
Was this revision note helpful?
Build on this topic