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 lastName, firstName FROM students; | AShows only the name and price columns; category and stock are left out of the output | |
| 2SELECT name, price FROM products; | BSELECT house FROM students; | |
| 3Swapping the field order makes the columns appear in the opposite order, with the points column before the firstName column | CSELECT points, firstName FROM students; | |
| 4With no WHERE clause, every record in the table appears in the output, and the heading row shows the field names | DShows two columns, lastName first and then firstName, for every student, because there is no WHERE | |
| 5Query: SELECT house, firstName FROM students; Student expects: firstName column first, then house | EThe fields are written in the wrong order. The output shows house first, so the query should be SELECT firstName, house FROM students; | |
| 6Query: SELECT firstName FROM students; Student expects: firstName and yearLevel columns | FyearLevel is not named after SELECT, so it is left out of the output. It should be SELECT firstName, yearLevel FROM students; |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
SELECT lastName, firstName FROM students; — The output has only the fields named, as columns in the order written after SELECT, with a heading row of field names and one row per record kept (all records if there is no WHERE).-- Output columns: lastName, firstName
SELECT lastName, firstName FROM students;SELECT firstName, points FROM students;-- Every record, name then price
SELECT name, price FROM products;-- Show points first, then firstName
SELECT points, firstName FROM students;-- Only studentId and mark are shown
SELECT studentId, mark FROM results;