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 house IS NULL; | ALists every student record that has no value in the house field, so incomplete records can be found. | |
| 2SELECT * FROM results WHERE mark < 0 OR mark > 100; | BThis finds valid prices, not impossible ones. To find inaccurate records the condition should test for out-of-range values, such as WHERE price < 0. | |
| 3Count how many records are incomplete because a field has no value | CFinds results with impossible marks that fall outside the valid range of 0 to 100. | |
| 4Find duplicate records by grouping on a field and keeping groups that appear more than once | DNULL cannot be tested with the = operator. A comparison with NULL is never true, so no rows are returned. It should be WHERE house IS NULL. | |
| 5SELECT * FROM students WHERE house = NULL; | ESELECT COUNT(*) FROM students WHERE points IS NULL; | |
| 6SELECT * FROM products WHERE price > 0; | FSELECT firstName, COUNT(*) FROM students GROUP BY firstName HAVING COUNT(*) > 1; |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
IS NULL — Tests whether a field has no value. Use WHERE field IS NULL, often with COUNT(*), to find and count incomplete records when checking data quality.SELECT * FROM students WHERE house IS NULL;SELECT COUNT
(*) FROM students WHERE house IS NULL;SELECT * FROM results
WHERE mark < 0 OR mark > 100;SELECT lastName, COUNT(*)
FROM students GROUP BY lastName
HAVING COUNT(*) > 1;SELECT * FROM products WHERE stock < 0;