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 * FROM students WHERE age >= 15; | AThe comparison operator is written backwards. It should be >= not =>. | |
| 2WHERE town = 'Perth' OR town = 'Darwin' | BWHERE subject = 'Maths' | |
| 3Text values in a WHERE condition must be wrapped in quotes | CThe text value Perth is missing quotes. It should be 'Perth'. | |
| 4AND keeps a row only when both conditions are true | DKeeps rows where the town is either Perth or Darwin | |
| 5SELECT * FROM students WHERE town = Perth; | EShows only the students who are 15 or older | |
| 6SELECT * FROM students WHERE age => 15; | FWHERE age >= 15 AND year = 10 |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
WHERE — An SQL clause that keeps only the rows meeting a condition, such as WHERE age >= 15 or WHERE town = 'Perth'. Text goes in quotes, and AND or OR can combine conditions.SELECT * FROM students WHERE age >= 15;SELECT name FROM students WHERE age >= 15;SELECT * FROM students
WHERE town = 'Perth' AND age >= 15;SELECT name FROM students
WHERE town = 'Perth' OR town = 'Hobart';SELECT title FROM books
WHERE price < 20;