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 | |
|---|---|---|
| 1StudentID INTEGER PRIMARY KEY | AName is a poor primary key because two students can have the same name. Use a unique ID number such as StudentID instead. | |
| 2INSERT INTO Students VALUES (101, 'Mia'); | BAdds a record whose ID 101 must not already be used by another record | |
| 3Auto-numbering lets the database give each new record the next unique ID automatically | CTwo records share the ID 101, so the primary key is not unique. Each record needs its own ID, such as 102 for Jack. | |
| 4A primary key is a field that is unique for every record in a table | DStudentID INTEGER PRIMARY KEY AUTOINCREMENT | |
| 5Name TEXT PRIMARY KEY | ECREATE TABLE Students (StudentID INTEGER PRIMARY KEY, Name TEXT); | |
| 6Students: ID 101 Mia, ID 101 Jack | FMakes the StudentID field the primary key, so every record has its own unique ID number |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
PRIMARY KEY — A field whose value is unique for every record in a table, such as a student ID number, so each record can be identified exactly. Names make poor keys because they can repeat.CREATE TABLE Pet (PetID INT PRIMARY KEY);CREATE TABLE Pet (
PetID INTEGER PRIMARY KEY AUTOINCREMENT,
Name TEXT);CREATE TABLE Student (StudentID INT,
Name TEXT, PRIMARY KEY (StudentID));SELECT * FROM Pet WHERE PetID = 7;CREATE TABLE Game (
GameID INT PRIMARY KEY, Title TEXT);