1. Database Structure: Tables, Fields, and Records
A database is an organised collection of data, stored electronically. Think of it like a digital filing cabinet where information is easy to find. The data is structured into tables. A table holds data about a single type of item, like 'Students' or 'Products'. Each table is made up of fields, which are the columns that define what information is stored (e.g., 'FirstName', 'Price'). A complete row of data, containing all the fields for one specific item, is called a record. For example, all the information about one particular student is a single record.
Key term
Examiner insight
Common pitfall
Worked example 13 marks
The table below, named 'Pets', is used by a vet.
| PetID | PetName | AnimalType | Age |
|---|---|---|---|
| P01 | Buddy | Dog | 5 |
| P02 | Whiskers | Cat | 2 |
| P03 | Rocky | Dog | 8 |
Identify:a) The names of all the fields.b) The full record for the pet named 'Whiskers'.c) The total number of records in the table.
- 1
a) The fields are the column headings: PetID, PetName, AnimalType, and Age.
- 2
b) The record for 'Whiskers' is the entire row of data for that pet: {P02, Whiskers, Cat, 2}.
- 3
c) There are three rows of data (excluding the header), so there are 3 records in the table.
Recap
- A database stores data in one or more tables.
- A table contains data about a single topic, like 'Customers'.
- A field is a column in a table that stores a single category of information, like 'Postcode'.
- A record is a row in a table that contains all the information about one item.
Quick check
- If a table has 5 columns and 20 rows of data, how many fields and records does it have?2 marks