Databases and SQL: Question 1
Syllabus 9.2
"Locked Room Adventures" runs several escape rooms and stores every booking made for them in a single database table called ROOM_BOOKING, shown below.
| BookingID | TeamName | RoomName | GroupSize | BookingDate |
|---|---|---|---|---|
| BK1001 | The Falcons | Pharaoh's Curse | 4 | 2 March 2026 |
| BK1002 | Night Owls | Pharaoh's Curse | 6 | 2 March 2026 |
| BK1003 | The Falcons | Vault 13 | 4 | 5 March 2026 |
| BK1004 | Quiz Wizards | Vault 13 | 5 | 5 March 2026 |
Which field should be chosen as the primary key for the ROOM_BOOKING table?
Show worked solution Hide worked solution
Worked solution
Step 1: Recall what a primary key must do
A primary key must hold a value that is different for every record in the table, so that any single record can always be identified precisely.
Step 2: Check each candidate field for repeated values
- TeamName: “The Falcons” appears twice (BK1001 and BK1003), so it repeats.
- RoomName: “Pharaoh’s Curse” and “Vault 13” each appear twice, so it repeats.
- BookingDate: 2 March 2026 and 5 March 2026 each appear twice, so it repeats.
- BookingID: BK1001, BK1002, BK1003 and BK1004 are all different from one another.
Step 3: Confirm the match
Only BookingID gives a genuinely different value for every record shown, and there is no reason to expect two bookings would ever share the same BookingID, so it is the only field able to serve reliably as the primary key.
Final answer
The primary key should be BookingID, option D.