Types of Validation:
Type Check:
Sometimes you only want data of a certain type entered into a field.
For example, in a clothes shop, dress sizes may range from 8 to 18. A number data type would be a suitable choice for this data. By setting the data type as number, only numbers could be entered and you would prevent anyone trying to enter ‘ten’ or ‘ten and a half’.
Range Check:
Sometimes you only want data from a certain amount to a certain amount being entered.
For example, a shop may only sell items between the price of £10.00 and £50.00. To stop mistakes being made, a range check can be set up to stop £500.00 being entered by accident.
Presence check:
There might be an important piece of data that you want to make sure is always stored.
For example, a school will always want to know an emergency contact number, a video rental store might always want to know a customer's address, a wedding dress shop might always want a record of the brides wedding date.
A presence check makes sure that a vital field cannot be left blank, it must be filled in.
Picture or format check:
Some things are always entered in the same format.
Think about postcode, it always has a letter, letter, number, number, letter and letter e.g. BB1 9PB. There may be the odd occasion where it differs slightly e.g. a Birmingham postcode B19 8WR, but the letters and numbers are still in the same order.
A picture or format check can be set up to make sure that you can only put letters where letters should be and numbers where numbers should be.
Check Digit:
This is used when you want to be sure that a range of numbers has been entered correctly for example a barcode or an ISBN number:
ISBN 1 84146 201 2
The check digit is the final number in the sequence, so in this example it is the final ‘2’.
The computer will perform a complex calculation on all of the numbers and then compare the answer to the check digit. If both match, it means the data was entered correctly.
Verification:
It was mentioned earlier that validation cannot make sure data that you enter is correct, it can only check that it is sensible, reasonable and allowable. However, it is important that the data in your database is as accurate as possible.
Verification can be used to help make sure that the data in your database contains as few mistakes as possible.
Definition: Verification means to check the data that you have entered against the original source data.
It can be done in a number of ways:
- Entering the data twice.
- Checking the data on the screen against the original paper document.
- Printing out a copy of the data and comparing the printout to the original paper document.
How to create a validation?: