All subjects · Information Technology · WIT14 3 hour practical exam on database solutions
Validation checks and error messages
Edexcel IAL Information Technology · WIT14 3 hour practical exam on database solutions
Validation makes sure data entered is reasonable and suitable for processing (specification 18.3.1 to 18.3.3). You must implement presence, range, lookup, list, format and length checks, write helpful error messages, and test the rules. The first exam question often includes one.
The six checks
| Check | What it does | Access validation rule | SQL equivalent |
|---|---|---|---|
| Presence | The field must not be left empty | Is Not Null | NOT NULL |
| Range | The value must lie between limits | Between 5 And 60 | CHECK (DailyRate BETWEEN 5 AND 60) |
| List | The value must be one of a fixed set | In ("Road","Mountain","Hybrid","Electric") | CHECK (BikeType IN ('Road', 'Mountain', 'Hybrid', 'Electric')) |
| Format | The value must match a pattern | Like "B##" | CHECK (BikeID LIKE 'B__') |
| Length | The number of characters must be within limits | Len([BikeID]) = 3 | CHECK (length(BikeID) = 3) |
| Lookup | The value must exist in another table or list (often a combo box) | Lookup Wizard / combo box with Limit To List = Yes | FOREIGN KEY ... REFERENCES |
In Access, # in Like matches one digit; in SQL, _ matches one character.
Validation in action
SQLite applies the Harbour Bike Hire rules and rejects bad data:
- Presence check:
UPDATE tblCustomer SET Surname = NULL WHERE CustomerID = 2;is rejected withNOT NULL constraint failed: tblCustomer.Surname - Range check:
UPDATE tblBike SET DailyRate = 75 WHERE BikeID = 'B01';is rejected withCHECK constraint failed: DailyRate BETWEEN 5 AND 60 - List check:
UPDATE tblBike SET BikeType = 'Tandem' WHERE BikeID = 'B01';is rejected withCHECK constraint failed: BikeType IN ('Road', 'Mountain', 'Hybrid', 'Electric') - Format check:
INSERT INTO tblBike VALUES ('X07', 'Mini', 'Road', 9);is rejected withCHECK constraint failed: BikeID LIKE 'B__' AND length(BikeID) = 3 - Length check:
INSERT INTO tblBike VALUES ('B007', 'Mini', 'Road', 9);is rejected withCHECK constraint failed: BikeID LIKE 'B__' AND length(BikeID) = 3
In Access, the Validation Rule property holds the rule and the Validation Text property holds the message the user sees. Pearson's 2024 examiner report notes that setting Required to Yes was not credited where a validation rule such as Is Not Null with a suitable error message was expected.
Helpful error messages
A good message says what is wrong and how to fix it, in the user's language:
- Poor: 'Invalid entry.' or a system message about constraints.
- Good: 'Daily rate must be between 5.00 and 60.00. Please re-enter.'
- Good: 'Bike ID must be B followed by two digits, for example B07.'
Keep the tone neutral and the message short, and name the field.
Testing a rule, and what validation cannot do
Test every rule with valid, invalid and boundary (extreme) data, and record the expected and actual result. For Between 5 And 60: 18 should be accepted (valid), 75 rejected (invalid), 5 and 60 accepted and 4.99 and 60.01 rejected (boundaries). The 2025 examiner report notes many candidates tested only rejected data: show accepted data too.
Validation checks that data is reasonable, not that it is correct: a rate of 20.00 typed instead of 22.00 passes. Verification (double entry, or visually checking against the source) checks that data was copied accurately.
Worked example
Write validation for a MinSellingPrice field that must be between 100 and 1500, with an error message, and give test data.
- Validation Rule: Between 100 And 1500 (or >=100 And <=1500). SQL: CHECK (MinSellingPrice BETWEEN 100 AND 1500).
- Validation Text: 'Minimum selling price must be between 100 and 1500 pounds.'
- Tests: 750 accepted (valid); 2000 rejected (invalid); 100 and 1500 accepted, 99.99 and 1500.01 rejected (boundaries).
Answer: A range check with a clear message, tested with valid, invalid and boundary data.
Check yourself
- A rule only accepts 'S', 'M', 'L' or 'XL' in a Size field. Which check is this?
- Range check
- Presence check
- Length check
- List check
Show answer
List check. The value must be one of a fixed set.
- Which check stops a BikeID such as 'X07' being entered when IDs must be B followed by two digits?
- Range check
- Format check
- Presence check
- Lookup check
Show answer
Format check. A pattern (B then two digits) is a format check: Like "B##" in Access.
- Which is the most helpful error message for a range check on Days?
- Error 3317
- Invalid.
- You made a mistake.
- Days must be a whole number from 1 to 14. Please re-enter.
Show answer
Days must be a whole number from 1 to 14. Please re-enter.. It names the field, the rule and what to do.
- A validation rule is Between 5 And 60. Which value is boundary test data that should be accepted?
- 60
- 61
- 75
- -5
Show answer
60. 60 is on the boundary and the rule includes it.
- For the rule Between 5 And 60 on DailyRate, a tester tries 4.99, 5, 18, 60, 60.01 and 75. How many of these should be accepted?
Show answer
3. SQLite accepts 5, 18 and 60 and rejects 4.99, 60.01 and 75.
- A receptionist types a customer's correct-looking but wrong phone number. Which technique could catch this?
- Verification, such as reading the number back to the customer
- A length check
- A format check
- A presence check
Show answer
Verification, such as reading the number back to the customer. The wrong number is still a valid format, so only verification against the source catches it.
- According to Pearson's 2024 examiner report, which approach to making a field compulsory lost marks where a validation rule was expected?
- Using Is Not Null with a clear validation text
- Testing the rule with an empty value
- Setting the Required property to Yes instead of using Is Not Null with validation text
- Explaining the rule in the evidence
Show answer
Setting the Required property to Yes instead of using Is Not Null with validation text. The expected answer was a validation rule with a suitable error message.
- Explain why validation cannot guarantee that data is correct.
Show answer
Validation only checks that data is reasonable or fits the rules, so a wrong value that is still within the rules, such as 20 typed instead of 22, is accepted.. Validation tests reasonableness against rules, not truth; verification is needed to check accuracy against the source.
Sources
- Pearson Edexcel International Advanced Level in Information Technology specification (Issue 2, February 2021): Unit 4, Topics 17 to 19
- Pearson: WIT14/01 examiner report, June 2024
- Pearson: WIT14/01 examiner report, June 2025
- Pearson: WIT14/01 mark scheme, June 2024
Last updated 8 November 2026. Spotted a mistake? Tell us.