9618/12/M/J/23 question 2: worked solution (May/June 2023, paper 12)
Show as plain textHide plain text
Cambridge AS Level Computer Science 9618 · 8.3 Data Definition Language (DDL) and Data Manipulation Language (DML) Worked solution from the Databases Paper 1 Theory Fundamentals booklet, Part 2 of 2. Q21 9618/12/M/J/23 original Q2 Structured · 17 marks Worked solution (a) Complete the table: Name Description Data dictionary Data about the data in the database (metadata about its structure) Query processor Software that lets the user enter criteria, then finds and returns the matching result (runs SQL queries) Logical schema A model of a database that is not specific to one DBMS Developer interface A software tool that allows the user to create items such as tables, forms and reports Data dictionary description [1] Query processor description [1] Logical schema [1] Developer interface [1] (b) Give three reasons (any three of these): Referential integrity keeps the data consistent [1] Every foreign key has a matching primary key , so no record points to data that does not exist [1] It stops records being added, deleted or changed incorrectly [1] Other accepted: data is up to date, changes in one place show in all related records, queries return accurate and complete results. (c)(i) Write two validation methods (any two): Presence check : makes sure a rider level is entered [1] Lookup check : makes sure it is only Beginner, Intermediate or Advanced [1] Length check (8 or 12 characters) or type check also score. (c)(ii) Select the horse names where the level is either value. SELECT Name FROM HORSE WHERE HorseLevel = "Intermediate" OR HorseLevel = "Beginner"; SELECT the field Name [1] FROM table HORSE [1] WHERE with Intermediate [1] OR with Beginner [1] (c)(iii) Find and fix four errors: Error Correction SUM used to count riders COUNT(STUDENT.RiderLevel) StudentID = StudentID has no table names STUDENT.StudentID = LESSON.StudentID OR joins the date test AND Date = #09/09/2023# Beginner has no speech marks STUDENT.RiderLevel = "Beginner" SUM should be COUNT [1] Table names needed in STUDENT.StudentID = LESSON.StudentID [1] OR should be AND [1] "Beginner" needs speech marks [1] KEY IDEA Know the DBMS tools, why referential integrity matters and how to read an SQL join for errors. TOTAL 17 marks Official mark scheme VIDEO ▶ Starts at Q2 (19:09) Starts at Q2 (19:09) · by Zafar Ali Khan (ZAK). Tap the picture to open it on YouTube.