Welcome to A-level ICT
Data validation
A check to see if data is 'valid' before it is processed...i.e. that it is sensible data.
There are a number of different data validation checks which can be carried out...These are some of them...
A check that makes sure some data fields are present. It requires that a value must be entered
Example:
An application for a passport must have the applicant's surname.
The details of an order are being input, the order
cannot be processed unless an order number is entered and the routine will return an error if the box is left empty.
A check to see if data lies within a specific range. The data must be a value that falls between 2 prescribed values.
Examples:
The 'day' part of a date must be in the range 1..31
An exam grade should be in the range 'A'...'G' or 'U
The data of birth of a pupil must lie between 01/09/83 and 31/08/95, any date that falls out of the range is rejected. '
Checks to see of data is of the right type. Data type – data must be of a specified type i.e. numerical, text, Boolean, image,
Examples:
Exam marks should be numbers (integers i.e. whole numbers)
Exam grades should be letters.
Data entered for the number in stock must be numerical, if a text item is entered it must be rejected.
A check that data is in a particular format. The data must conform to a prescribed layout, a NI number consists of 2 letters 6 digits
and then a letter. If the operator tries to enter a different combination an error is returned. e.g. (an Input Mask setup in MS Access)
Example:
A postcode must be 2 letters, 2 digits, a space, a digit and 2 letters.
Checks to see if data has the correct number of characters in it.
Examples:
Bank account numbers should be 8 characters.
Postcodes should be 4 characters... a space... and then 3 characters.
A check digit is a numerical calculation on a code number and comparing it with the final digit, if the
same value is not found then an error message is displayed.
A check digit is an extra digit added on to a number. This check digit is the result of a calculation performed on the digits of the number.
When the data is entered into the computer, it performs the same calculation to see if the check digit is correct...ie it checks the check digit!
Examples
The last digit of a bar code is a check digit.
The last digit of an ISBN number on a book is a check digit.
Incidentally...this is one reason why you cannot 'invent' credit card numbers!
Data must conform to one of the values in a predefined list i.e. for gender only m or f is allowed, entering anything else will result in an error message