Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.
Shade in the A or B circle for each question.
Draw a line connecting each item on the left to its match on the right.
| Left column | Right column | |
|---|---|---|
| 1SELECT name, price FROM products WHERE stock = 0; | AThe requirement is not linked to a task and names no SQL statement, so it does not say what the solution must contain | |
| 2Linear search on studentId | Bmax <- marks[1] for i from 2 to 20 if marks[i] > max then max <- marks[i] | |
| 3Query needed: the function 'show total points for each house' needs this SQL statement | CThe list leaves out the algorithms for processing data, so some functions have nothing to carry them out | |
| 4Linking a requirement to a task: 'Find the highest mark' needs an algorithm in the programming requirements | DAn algorithm requirement: the solution needs this to find one student record in an unsorted array | |
| 5Requirement: Show a student's marks (no SQL statement or task listed) | ESELECT house, SUM(points) FROM students GROUP BY house; | |
| 6Requirements list: SQL queries only (no algorithms for validating or sorting data) | FA query requirement: the solution needs this SQL to list the products that are out of stock |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
programming requirements — The list of SQL statements and algorithms a data-driven solution must include so it can carry out each of its functions, with each requirement linked to a task.-- Req 1: list all Red house students
SELECT firstName FROM students
WHERE house = 'Red';-- Req 2: count students per house
SELECT house, COUNT(*) FROM students
GROUP BY house;-- Req 3: algorithm totals all points
total ← 0
for i from 1 to 10: total ← total + p[i]-- Req 4: rank students by points
SELECT firstName, points FROM students
ORDER BY points DESC;-- Req 5: algorithm counts marks over 80
count ← 0
if mark > 80 then count ← count + 1