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 firstName, points FROM students WHERE house = 'Red' ORDER BY points DESC; | AShows the name and price of products that have no stock left. | |
| 2SELECT name, price FROM products WHERE stock = 0; | BShows the first name and points of students in Red house, with the highest points first. | |
| 3The SELECT part tells you which fields (columns) appear in the results. | CSELECT firstName FROM students ORDER BY firstName ASC; | |
| 4The ORDER BY part tells you the order the records appear in, such as A to Z. | DSELECT name shows only the name field, not all fields. WHERE price > 10 picks the records, but the SELECT part limits the fields. | |
| 5Plain English: SELECT name FROM products WHERE price > 10 means 'show all fields of products costing over 10'. | ESELECT lastName, yearLevel FROM students; | |
| 6Plain English: SELECT firstName FROM students WHERE house = 'Blue' means 'show Blue house students sorted by name'. | FThere is no ORDER BY clause, so the query does not sort the results. WHERE only picks the Blue house records. |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
SELECT WHERE ORDER BY — Read a query one clause at a time: SELECT names which fields are shown, WHERE picks which records, and ORDER BY sets the order the results appear in.SELECT firstName, points
FROM students
ORDER BY points DESC;SELECT firstName
FROM students
WHERE house = 'Red';SELECT name, price
FROM products
ORDER BY price DESC;SELECT firstName, points
FROM students
WHERE points > 100;SELECT firstName
FROM students
ORDER BY points DESC;