Databases · 5 question types
Past paper frequency (2018 to 2024)
This topic accounts for approximately 4% of your exam marks.
SQL SELECT queries and database structure (tables, fields, records) appear as 4 to 6 mark questions.
Every single-table database is made of three building blocks: fields, records and (usually) a primary key.
A field is one specific piece of information about each item; it appears in the table as a single column.
Examples of fields for a customer database: CustomerID, FirstName, LastName, DateOfBirth, PhoneNumber.
A record is the collection of fields that all belong to one specific item; it appears in the table as a single row.
For the customers table, each customer is one record. If there are 200 customers, there are 200 records.
Easy way to remember: fields are columns, records are rows.
A primary key is a single field whose value is unique for every record in the table. It uniquely identifies each record so the database can tell one from another.
Examples:
StudentID in a school students table.CarRegistration in a vehicles table.ProductCode in a shop's products table.MemberID in a club's members table.A primary key cannot be left blank, and no two records can share the same primary-key value. This matters because the database needs an unambiguous way to refer to each record, especially when records are updated or deleted.
| StudentID | FirstName | LastName | MarkSubmitted | Percentage |
|---|---|---|---|---|
| 2014501 | Aisha | Khan | Y | 62 |
| 2014502 | Ben | Cooper | N | 18 |
| 2014503 | Chen | Wei | Y | 81 |
| 2014504 | Dara | O'Neill | Y | 73 |
| 2014505 | Emma | Foster | Y | 41 |
| 2014506 | Faisal | Ahmed | N | 55 |
In this table:
StudentID, FirstName, LastName, MarkSubmitted, Percentage. There are 5 fields.StudentID because every student has a unique seven-digit ID.