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.

Practise this in the app: instant marking and a fix for every mistake. Free, no email needed to start.

Practise this lesson

The six checks

CheckWhat it doesAccess validation ruleSQL equivalent
PresenceThe field must not be left emptyIs Not NullNOT NULL
RangeThe value must lie between limitsBetween 5 And 60CHECK (DailyRate BETWEEN 5 AND 60)
ListThe value must be one of a fixed setIn ("Road","Mountain","Hybrid","Electric")CHECK (BikeType IN ('Road', 'Mountain', 'Hybrid', 'Electric'))
FormatThe value must match a patternLike "B##"CHECK (BikeID LIKE 'B__')
LengthThe number of characters must be within limitsLen([BikeID]) = 3CHECK (length(BikeID) = 3)
LookupThe value must exist in another table or list (often a combo box)Lookup Wizard / combo box with Limit To List = YesFOREIGN 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:

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:

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.

  1. Validation Rule: Between 100 And 1500 (or >=100 And <=1500). SQL: CHECK (MinSellingPrice BETWEEN 100 AND 1500).
  2. Validation Text: 'Minimum selling price must be between 100 and 1500 pounds.'
  3. 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.

Key idea: Presence, range, list, format, length and lookup checks; put the rule in Validation Rule and a what-is-wrong-and-how-to-fix message in Validation Text; test with valid, invalid and boundary data; validation checks reasonableness, verification checks accurate copying.

Check yourself

  1. 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.

  2. 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.

  3. 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.

  4. 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.

  5. 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.

  6. 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.

  7. 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.

  8. 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.

Practise with instant feedback

Sources

Last updated 8 November 2026. Spotted a mistake? Tell us.