Data integrity: reasonableness

Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.

Data integrity: reasonableness

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. A student's age is recorded as 250 in a dataset. Is this value reasonable?
A No, it is not plausible for a person's age
B Yes, it is a valid number so it is reasonable
2. Which best describes data integrity: reasonableness?
A Values are stored in the correct data type only
B Values are sensible and plausible for what they describe
3. A reasonableness check on an age field uses a range of 0 to 120. Which value passes?
A -5
B 34
4. Which value fails a reasonableness check on a range of 0 to 100 for a test percentage?
A 135
B 87
5. What does a range check do when testing for reasonableness?
A Tests whether a value lies between a minimum and a maximum
B Tests whether a value is typed in capital letters

Match the Pairs

Draw a line connecting each item on the left to its match on the right.

Left columnRight column
1IF age < 0 OR age > 120 THEN reject ABeing a valid number does not make a value reasonable. A negative age is implausible and should fail the check.
2age = 250 BAn unreasonable value because no person could be 250 years old
3A reasonableness check tests whether a value sits inside a sensible range CA range-based reasonableness check that rejects any age outside 0 to 120
4A plausible age passes a reasonableness check on a range of 0 to 120 DThe range is too wide to be a useful reasonableness check, because an age of 250 would still be accepted. A sensible upper limit is about 120.
5Range check for age: 0 to 1000 Eage = 16
6age = -5 passes because it is a number FIF mark >= 0 AND mark <= 100 THEN accept

Definitions

reasonableness

Fill in the Blanks

Complete each line of code by filling in the missing parts.

1.
SELECT name FROM people WHERE age _ 120;
2.
=IF(___(B2>=0,B2<=120),"OK","Check")
3.
IF age < 0 __ age > 120 THEN DISPLAY "Age not reasonable" END IF
4.
SELECT * FROM people WHERE age _______ 0 AND 120;
5.
=_______(B2:B30,">120")

Spot the Error

Shade in the letter of the line that contains an error.

Question 1
A lo ← 200
B hi ← 120
C IF age >= lo AND age <= hi
D OUTPUT 'Reasonable'
Question 2
A INPUT age
B IF age >= 0 AND age <= 120
C OUTPUT 'Not reasonable'
D ELSE
E OUTPUT 'Not reasonable'
Question 3
A age ← 250
B valid ← FALSE
C IF age >= 0 AND age <= 120
D valid ← FALSE
E OUTPUT valid
Question 4
A hi ← 1200
B lo ← 0
C IF age < lo OR age > hi
D OUTPUT 'Check age'
Question 5
A INPUT age
B valid ← TRUE
C IF age < 0 AND age > 120
D valid ← FALSE
E OUTPUT valid

Answer Key

Data integrity: reasonableness
Section A: Quick Questions
Q1
A — No, it is not plausible for a person's age
Q2
B — Values are sensible and plausible for what they describe
Q3
B — 34
Q4
A — 135
Q5
A — Tests whether a value lies between a minimum and a maximum
Section B: Match the Pairs
Q1
IF age < 0 OR age > 120 THEN reject → A range-based reasonableness check that rejects any age outside 0 to 120
Q2
age = 250 → An unreasonable value because no person could be 250 years old
Q3
A reasonableness check tests whether a value sits inside a sensible range → IF mark >= 0 AND mark <= 100 THEN accept
Q4
A plausible age passes a reasonableness check on a range of 0 to 120 → age = 16
Q5
Range check for age: 0 to 1000 → The range is too wide to be a useful reasonableness check, because an age of 250 would still be accepted. A sensible upper limit is about 120.
Q6
age = -5 passes because it is a number → Being a valid number does not make a value reasonable. A negative age is implausible and should fail the check.
Section C: Definitions
Q1
reasonableness — Data is reasonable when its values are sensible and plausible for what they describe. An age of 250 fails a reasonableness check on a range, such as 0 to 120.
Section D: Fill in the Blanks
Q1
SELECT name FROM people WHERE age > 120;
Q2
=IF(AND(B2>=0,B2<=120),"OK","Check")
Q3
IF age < 0 OR age > 120 THEN DISPLAY "Age not reasonable" END IF
Q4
SELECT * FROM people WHERE age BETWEEN 0 AND 120;
Q5
=COUNTIF(B2:B30,">120")
Section E: Spot the Error
Q1
A — The lower limit of the range must be 0, not 200. With a lower limit above the upper limit of 120, no age could ever pass the reasonableness check. It should be lo ← 0.
Q2
C — This branch runs when the age is inside the range 0 to 120, so the value is reasonable. The output should be OUTPUT 'Reasonable'.
Q3
D — When the age is inside the range 0 to 120 the value is reasonable, so valid must be set to TRUE. It should be valid ← TRUE.
Q4
A — An upper limit of 1200 is not a plausible human age, so an age of 250 would wrongly pass the check. The upper limit should be hi ← 120.
Q5
C — No age can be below 0 and above 120 at the same time, so the condition is never true and an age of 250 would pass. It needs OR: IF age < 0 OR age > 120.