ExamBank Scot · N5 Computing Science question bank · All N5 Computing Science questions

N5 Computing Science 2026 Question 15

10 marks · Data dictionary and validation

Explain why the borrowRef field is stored as a text data type. A publishing company asks the library to provide the contact details of all members who have borrowed an adventure book. Design a query that could be used to generate a list of names and phone numbers of members who have borrowed an adventure book before 15/03/2026 with the most recent date borrowed first. Field(s) Table(s) Search criteria Sort order A member has complained that they have been contacted by the publishing company. The member tells the library that they have breached UK General Data Protection Regulation (UK GDPR). Explain why the library has breached UK GDPR. A new member has joined the library. Their details are added to the Member table by executing the following SQL statement. INSERT INTO Member (memberName, contactNum, memNum, dateOfBirth) VALUES ("Darcy Hughes", "01415831584", "CH0S1162", "07/07/2003"); Once they have a membership, they borrow the ‘Classic’ book ‘Beyond the Veil’ by Billy Jameson on 28 April 2026. Write an SQL statement that will add this record to the Borrowed table, using the borrowRef ‘678 0061’. The librarian tries to add a new record to the Borrowed table, but the error message below is displayed. Error - referential integrity! The relationship does not allow this record to be inserted. Explain why referential integrity has been broken. A library uses a relational database to store the details of books that have been borrowed and the members who have borrowed them. A sample of the data stored in each table is shown below. Member memberName contactNum memNum dateOfBirth Jo Thompson 07721454187 B4L04062 25/08/1988 Skyler Parker 07895582319 DB3S3741 01/08/2003 Sam Smart 07378565190 K2S06536 11/09/2010 Casey Kim 01415571239 LO6N6448 16/10/1991 Ellis Chen 07178251143 MN567379 20/06/2012 Aliyah Taylor 01415829631 T2D26905 05/06/2009 Ari Morgan 01418529637 V0D33927 30/01/1993 … … … … Borrowed title author genre borrowRef memNum dateBorrowed Hunting the Skylark Harper Bea Historical 678 0062 B4L04062 09/02/2026 Hunting the Skylark Harper Bea Historical 678 4578 DB3S3741 28/12/2025 The Drifter’s Diary J Dorean Fiction 678 0316 T2D26905 21/04/2026 Year Zero Brodie Arwen Horror 678 0454 K2S06536 13/04/2026 Blooded Prince Bran Harper Horror 678 0486 T2D26905 14/02/2026 Forgotten Map H.P.P. Sullen Adventure 678 0547 V0D33927 03/03/2026 The Silver Masquerade J. Ronald Fitzgerald Classic 678 0743 DB3S3741 21/02/2026 Vanity and Valor Janey Alexander Classic 678 1563 LO6N6448 19/03/2026 … … … … … …

Marking scheme

The data contains a space. Field(s) • memberName, contactNum Table(s) • member, borrowed Search Criteria • genre = Adventure • dateBorrowed < 15/03/2026 Sort order • dateBorrowed DESC Fields: • fields can be in any order • do not award a mark if additional fields have been included • allow use of dot notation with fields Table(s): • table names can be in any order Search Criteria: • conditions can be in any order • equi-join not required • logical operators not required • date could have any format Sort Order: • accept description of descending order • using the personal data for the wrong purpose • data has been shared without customer permission Award 1 mark for any one bullet. • insert into Borrowed with no fields stated or with all 6 fields stated • correct 6 matching values INSERT INTO Borrowed (title, author, genre, borrowRef, memNum, dateBorrowed) VALUES ("Beyond the Veil", "Billy Jameson", "Classic", "678 0061", "CH0S1162", 28/04/2026) The new record includes a memNum that doesn’t exist in the Member/other table.

Previous question: N5 Computing Science 2026 Question 14

Next question: N5 Computing Science 2026 Question 16