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 | |
|---|---|---|
| 1WHERE house = 'Red' AND points > 100 | AReturns students who are in Year 7 or in Year 8; only one condition needs to be true. | |
| 2WHERE yearLevel = 7 OR yearLevel = 8 | BReturns only students who are in Red house and also have more than 100 points; both conditions must be true. | |
| 3NOT reverses a condition, so this query returns every student who is not in Blue house | CWithout brackets, AND is worked out before OR, so Red students of any points are returned. It should be (house = 'Red' OR house = 'Blue') AND points > 90. | |
| 4Brackets control the order, so the OR is checked first and then the result must also pass the AND test | DWHERE NOT house = 'Blue' | |
| 5WHERE house = 'Red' AND house = 'Blue' | EA student has only one house, so both conditions can never be true at once and no rows are returned. It should use OR instead of AND. | |
| 6WHERE house = 'Red' OR house = 'Blue' AND points > 90 | FWHERE (house = 'Red' OR house = 'Blue') AND points > 90 |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
AND, OR, NOT — Combine WHERE conditions: AND needs both true, OR needs at least one true, NOT reverses a condition. Brackets set the order and decide which rows are returned.SELECT firstName, house FROM students
WHERE yearLevel = 7 AND house = 'Red';SELECT name, category FROM products
WHERE category = 'Tech' OR
category = 'Sport';SELECT firstName, house FROM students
WHERE NOT house = 'Red';SELECT firstName FROM students
WHERE (house = 'Red' OR house = 'Blue')
AND points > 100;SELECT name FROM products
WHERE category = 'Tech' AND NOT stock = 0;