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 | |
|---|---|---|
| 1age INTEGER | APhone numbers often start with 0 and are not used for maths, so INTEGER would drop the leading 0. TEXT is the better type. | |
| 2birthdate DATE | Bname TEXT | |
| 3A field that stores words and letters, such as a student's name, should use a text type. | CA price is a number you may add up or compare, so it should use a number type such as DECIMAL, not TEXT. | |
| 4A yes/no field, such as whether a student has paid an excursion fee, should use a boolean type. | DThe age field only accepts whole numbers, so a value like 'fifteen' or 15.5 is rejected. | |
| 5phone INTEGER | EThe birthdate field only accepts a real calendar date, so '31/02/2010' or 'banana' is rejected. | |
| 6price TEXT | Fpaid BOOLEAN |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
data type — A setting on a database field that decides what kind of value it accepts, such as text, integer, date or yes/no, so wrong entries are rejected. It is a first form of validation.CREATE TABLE Pet (
name TEXT, age INTEGER
);CREATE TABLE Pet (
name TEXT, age INTEGER
);CREATE TABLE Member (
birthday DATE, name TEXT
);CREATE TABLE Member (
paid BOOLEAN, name TEXT
);CREATE TABLE Contact (
phone TEXT, name TEXT
);