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 COUNT(*) FROM Students; | AThe boundary value 16 is left out because > excludes it. Use >= 16 so the Age 16 row is included. | |
| 2WHERE Mark >= 50 | BA condition where a test row with Mark 50 should be included, so you check that the boundary row appears | |
| 3Check that a JOIN returns only the rows where the foreign key matches a primary key | CCounts the rows in the table so you can compare the total with the number of rows you expected | |
| 4Predict which rows a query should return, then run it and compare the actual result with the prediction | DThe actual row count does not match the prediction, so the query fails the test. Investigate the query, such as a missing WHERE condition or a bad JOIN, and fix it. | |
| 5WHERE Age > 16 (a test row has Age 16 and should appear in the results) | ESELECT * FROM Students WHERE Year = 11; | |
| 6Predicted 5 rows, query returned 8 rows, so the query is marked as correct | FSELECT * FROM Orders JOIN Customers ON Orders.CustomerID = Customers.CustomerID; |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
Test a query — Predict the rows a query should return from a small sample, run it, then compare the actual result with your prediction. Check row counts, boundary values and JOIN matches.SELECT COUNT(*) FROM Students;SELECT * FROM Students WHERE Mark >= 50;SELECT * FROM Orders
INNER JOIN Customers
ON Orders.CustID = Customers.CustID;SELECT * FROM Orders
JOIN Customers
ON Orders.CustID = Customers.CustID;SELECT COUNT(*)
FROM Students
WHERE Mark > 50;