04 — Practice solutions

← Questions

These are independently written explanations, not an official marking scheme.

04A

Candidate keys are {BookID} and {ISBN}. ISBN is the secondary/alternate key under the school’s convention. (BookID, Title) is not minimal because BookID alone identifies a record, so it is not a candidate key.

04B

Both bookings have identical values for all three key fields and cannot coexist under that primary-key constraint. Give each booking a unique BookingID, or add a suitable trip/booking identifier that genuinely distinguishes the occurrences. A timestamp works only if uniqueness is guaranteed at its stored precision. Booking.VehicleNo is a foreign key referencing Bus.VehicleNo; a non-null value must identify an existing bus.