Databases: tables, fields, records and primary keys Cambridge IGCSE Computer Science (9–1) revision
Not started
Learn it
In plain words
A database is an organised store of data. The kind in this syllabus is a single table, like a neat grid: one row for every item, and one column for every fact about it.
5 things to know
- A table holds the data. A record is one row: all the data about one person or thing. A field is one column: one item of data that is stored for every record.
- Each field has a data type: text or alphanumeric, character, Boolean, integer, real, or date/time.
- A primary key is a field that uniquely identifies each record. No two records can have the same value in it.
- A name is a poor primary key, because two people can share one. An ID number given to each record is the usual choice.
- Validation can be applied to fields, so that only sensible data is accepted into the table.
Worked example
A club keeps a table of members with the fields MemberID, Name, DateJoined, Fee and Active. Choose a data type for each, and a primary key.
- MemberID, such as M0042: text (alphanumeric). Name: text.
- DateJoined: date/time. Fee, such as 12.50: real. Active, yes or no: Boolean.
- The primary key is MemberID, because it is the only field that is different for every member.
Tips and tricks
- To count the fields, count the columns. To count the records, count the rows, leaving out the row of headings.
- Justify a primary key with the word "unique": it uniquely identifies each record.
It lands in your notebook with its questions as flashcards.
Databases: tables, fields, records and primary keys: 6 questions and answers
These are the quiz’s questions. Do the quiz first, then come back here for the ones that got you.
In a database table, what is a record?
Each row is a record.
In a database table, what is a field?
Each column is a field.
What is a primary key?
No two records share a value in it.
Which field would make the best primary key for a table of students?
It is the only one certain to be different for every student.
Which data type suits a field that records whether a book is on loan?
It has two possible values: yes or no.
A table has 6 columns and 40 rows of data. How many records does it hold?
One record for each row of data.
Quiz
6 questions
Tap an answer and you’ll see straight away whether it’s right, and why.
Worksheet
3 questions, 7 marks. Write your answers on paper, then check them.
Databases: tables, fields, records and primary keys
Cambridge IGCSE Computer Science (9–1) 0984 · 7 marks · papermunch.org
Name ______________________________ Date ______________
Describe what is meant by a record and by a field.[2]
Show answerHide answer
A record is all the data about one item or person: one row of the table. A field is one item of data stored for every record: one column.
Explain why a pupil's surname is not a suitable primary key.[2]
Show answerHide answer
A primary key must be unique for each record. Two pupils could have the same surname.
State a suitable data type for each field: a date of birth, a price, and whether an order has been paid.[3]
Show answerHide answer
Date of birth: date/time. Price: real. Paid: Boolean.
Answers: Databases: tables, fields, records and primary keys
- 1. A record is all the data about one item or person: one row of the table. A field is one item of data stored for every record: one column.
- 2. A primary key must be unique for each record. Two pupils could have the same surname.
- 3. Date of birth: date/time. Price: real. Paid: Boolean.



