9618/13/M/J/23 question 4: worked solution (May/June 2023, paper 13)

Show as plain text

Cambridge AS Level Computer Science 9618 · 8.1 Database Concepts Worked solution from the Databases Paper 1 Theory Fundamentals booklet, Part 1 of 2. Q6 9618/13/M/J/23 original Q4 Structured · 17 marks Worked solution (a) Give two ways, each with the reason (any two): Reduces data redundancy [1] ...because linked tables mean each data item is stored only once [1] Reduces data inconsistency (improves integrity) [1] ...because data stored once only needs updating once, so linked data cannot differ between tables [1] Other accepted: program-data independence (data is separate from the software), complex queries are easier, different views for different users. (b) Complete the table: Term Description Entity An object that data is stored about. Tuple A row of data in a table about one instance of an object. Secondary key An additional key used as well as the primary key to find data (a candidate key not chosen as primary key). Foreign key A field in one table that is linked to a primary key in another table. Entity [1] Tuple description [1] Secondary key description [1] Foreign key [1] (c) Split into three tables: car details depend on the registration, customer details on the customer, and the booking links them. A CustomerID is a better key than a first name. In the written answer, underline the primary keys: BookingID, CarRegistration and CustomerID. BOOKING(BookingID, CarRegistration, CustomerID, StartDate, EndDate) CAR(CarRegistration, CarModel, CarColour) CUSTOMER(CustomerID, CustomerFirstName, CustomerLastName, EmailAddress, TelephoneNumber) Three tables with suitable identifiers [1] Suitable primary key underlined in each table [1] BOOKING holds the primary keys of CAR and CUSTOMER as foreign keys [1] All original fields are in the correct tables [1] (d)(i) Write two checks (any two): Length check : the registration must be 6 characters [1] Format check : letter, digit, digit, digit, letter, letter [1] A type check (alphanumeric) is also accepted. (d)(ii) Write two verification methods: Visual check : compare the number typed with the source document [1] Double entry : type it twice and the computer compares the two entries [1] (d)(iii) Write: the number may be in the correct format and match the document, but be the wrong registration for that car (the source itself may be wrong). [1] KEY IDEA Validation checks that data is sensible; verification checks it was copied correctly; neither proves it is true. TOTAL 17 marks Official mark scheme VIDEO ▶ Starts at Q4 (45:30) Starts at Q4 (45:30) · by Pseudocode Pro. Tap the picture to open it on YouTube.