Learn in your language
Skip to content
IGCSE · Cambridge (CIE) · 0478

Choose a suitable primary key from a table

Compare candidate fields against the actual records and select a unique identifier.

Cambridge IGCSE Computer Science 0478 · Databases · 2026–2028 Version 6 · Topic 9
Exam scope and assessment notes

This sequence follows Cambridge IGCSE Computer Science 0478, 2026–2028 syllabus Version 6, Topic 9. It covers single-table databases only and the specified SELECT, FROM, WHERE, ORDER BY, SUM, COUNT, AND and OR content. The official specimen also demonstrates NOT in a filter. Multi-table joins, GROUP BY, database implementation and the separate 2029–2031 syllabus are not mapped here. Practice is original, self-checked and does not award an official Cambridge grade. Full timed papers and human subject-teacher review remain outstanding.

Before you begin

  • Be able to read a small table and compare values. Each lesson introduces the database and SQL terms it uses.

Work on paper. Try each question before revealing help, and explain why your method works.

Quick readiness check

What should you inspect before selecting a key?

What you will learn

  • Test whether candidate values repeat
  • Distinguish unique data from likely unique data
  • Justify a key choice from table evidence

Use the table as evidence

Inspect the values in each candidate field. A key is unsuitable if any two records share the same value or if a required value is missing.

A field may appear unique in a small sample but still be allowed to repeat by its meaning. Explain whether the data rule guarantees uniqueness, not only whether current rows happen to differ.

Prefer stable identifiers

A code specifically assigned to one record is generally more dependable than a mutable description such as title or address.

If no single field is unique, a combination may distinguish rows, but the Cambridge question often expects you to state that none of the listed fields is suitable and give a reason.

Pause and explain

An example table shows unique names, but names are not guaranteed unique for future records. What is the best conclusion?

Put the idea to work

Worked example

Rows show ShowNumber SN11, SN12, SN13; Type Jazz, Drama, Jazz; Title Blue, Blue, Night. Which field is suitable as the key?

Show the worked solution
  1. ShowNumber differs in each record.
  2. Type repeats Jazz.
  3. Title repeats Blue.

Answer ShowNumber is suitable because the shown records have distinct values; Type and Title are not unique.

Try a topic test

Choose Easy, Normal or Difficult. Save your answers and open worked review after finishing.

Test this topic →

From guided practice to a new situation

Write your answer and reasoning first. Use a hint only if you are stuck. The model solution is for self-checking; your written work is not automatically marked.

1 · Guided

A table lists RoomCode R1, R2, R3 and Capacity 20, 20, 30. Which field can distinguish these rooms?

Give me a hint

Check which values repeat.

Compare my reasoning
  1. Capacity repeats 20.
  2. RoomCode has distinct values in the rows.
  3. RoomCode is the suitable candidate based on the table.

RoomCode; Capacity is not unique.

Look for these in your work

  • Duplicate detected
  • Candidate justified
2 · Independent

A customer table includes Email, Surname and CustomerNumber. Give one reason CustomerNumber may be a better key than Email.

Give me a hint

Consider stability and assigned identity.

Compare my reasoning
  1. Email addresses may change.
  2. Surnames can repeat.
  3. A distinct assigned number can remain the record identifier.

CustomerNumber may be a stable unique identifier, while email can change and surnames can repeat.

Look for these in your work

  • Alternative limitations
  • Key rationale
3 · Transfer

The only fields available are Type and Date, and two rows share both values. Explain why neither field alone nor their combination identifies every row.

Give me a hint

Test the duplicate pair against each candidate.

Compare my reasoning
  1. Type repeats.
  2. Date repeats, and the Type-Date pair repeats together.
  3. A new unique identifier is needed.

Neither is unique, and combining them still leaves duplicate pairs; add a unique ID field.

Look for these in your work

  • Single-field test
  • Combined-key test
  • Design fix

Common mistakes

  • Choosing the field with the most varied values without checking duplicates
  • Claiming current uniqueness when the field's meaning allows repeats
  • Using a value that can change as the record's identity
Recall without your notes

What can you explain now?

If a candidate field repeats in two rows, can it identify each row alone?

Compare with the explanation

No

A repeated value does not distinguish those records.

After trying it yourself, choose your next review. This is your self-assessment.

Your review choice appears on Today. Sign in to sync it across devices.

Make it stick

Why is a unique-looking sample value not always enough to prove key suitability?

If you needed the solution, close it and solve the problem again from a blank page. A correct answer is stronger when you can explain the reason for each step.

Keep learning Computer Science

Course scope and assessment

165 original lessons map the listed objectives across all 10 main topics in the 2026–2028 Version 6 syllabus, with worked explanations and guided, independent and transfer practice. This is mapped teaching coverage, not proof of full exam readiness. Three earlier starter lessons remain available but are not counted as syllabus-mapped teaching. Practical programming experience in an executable browser workspace, full timed-paper practice, human subject-teacher review and the separate 2029–2031 syllabus remain outstanding. Practice is self-checked and does not award an official Cambridge grade.

StudyForA · Learn with understanding

Original teaching content and links to official sources. Check your exam year and qualification before using a resource.