Primary Keys (CIE IGCSE Computer Science)

Revision Note

Test Yourself
Amy Fellows

Expertise

Computer Science

Primary Keys

  • Each table has a primary key field which acts as a unique identifier
    • Each item of data in this field is unique
    • Duplicate data items would be blocked if they were entered into the primary key field
  • Because the items of data are unique within the primary key field they can be used to identify individual records

A Database Table Containing Customer Details


CustomerID


FirstName


LastName


DOB


PhoneNumber

1

Andrea

Bycroft

05031976

0746762883

2

Melissa

Langler

22012001

0756372892

3

Amy

George

22111988

0746372821

  • In the example customer table, the primary key would be the CustomerID because each customer’s ID is unique
  • If there was a customer with the same name they could be identified correctly using the CustomerID

Worked example

A database table containing the details of dogs


DogID


Name


Breed


Age


Gender

DG12

Smokey

Poodle

12

M

DG34

Harvey

Springer Spaniel

10

M

DG48

Maisie

Labradoodle

3

F

DG49

Maggie

Labradoodle

3

F

DG88

Winston

Bulldog

7

M

DG95

Shona

Golden Retriever

6

F



Which field would be suitable for the primary key? Explain why

[2]

DogID  [1]

It is a unique identifier [1]

It does not contain any duplicate data items [1]

You've read 0 of your 0 free revision notes

Get unlimited access

to absolutely everything:

  • Downloadable PDFs
  • Unlimited Revision Notes
  • Topic Questions
  • Past Papers
  • Model Answers
  • Videos (Maths and Science)

Join the 100,000+ Students that ❤️ Save My Exams

the (exam) results speak for themselves:

Did this page help you?

Amy Fellows

Author: Amy Fellows

Amy has been a passionate Computing teacher for over 9 years, teaching Computer Science across the East Midlands, at all levels. Amy has also been a GCSE examiner for seven years.