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 lastName = 'Nguyen'; | ASELECT * FROM students ORDER BY lastName; | |
| 2CREATE INDEX idx_lastName ON students(lastName); | BSecondary key values do not have to be unique. Two students can have the same surname. Only a primary key must be unique. | |
| 3A secondary key is a non-primary field used to sort records, and its values do not have to be unique | CBuilds an index on a secondary key so searches by surname run faster | |
| 4A primary key finds exactly one record, while a secondary key can match many records | DSearches the students table using lastName, a secondary key, and may return more than one record | |
| 5A secondary key must be unique, so no two records can share the same lastName. | EUsing a surname as the primary key is wrong because surnames repeat. lastName is better as a secondary key, with a unique field like studentId as the primary key. | |
| 6PRIMARY KEY (lastName) | FWHERE studentId = 1 (primary) versus WHERE house = 'Red' (secondary) |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
secondary key — A non-primary field used to search or sort records, such as surname. Unlike a primary key, its values need not be unique, and it is often indexed to make searches faster.CREATE INDEX idxSurname
ON students(lastName);SELECT firstName, lastName FROM students
WHERE lastName = 'Nguyen';SELECT * FROM students
ORDER BY lastName;CREATE INDEX idxHouse
ON students(house);SELECT * FROM students
WHERE studentId = 3;