Databases : Validation

Sophisticated database packages can validate data that you enter into a database to ensure that it is sensible. Data can be validated as it is typed into a file or form. Validation checks on fields in a file are usually specified at the time that the file is created. Here are some common types of validation checks that can be carried out by database software :

Validation Checks
Presence Check Checks that data has been entered into a field and that it has not been left blank. e.g. check that a surname is always entered into each record in a database of addresses.
Type Check Checks that an entered value is of a particular type. e.g. check that age is numeric.
Length Check Checks than an entered value e.g. surname is no longer than a set number of characters.
Range Check Checks that an entered value falls within a particular range. For example the age of a person should be in the range 0 to 130 years.
Format Check Checks that an entered value has a particular format. e.g. a new-style car registration number should consist of a letter followed by 1 to 3 numbers followed by 3 letters.
Table Lookup Check Checks that an entered value is one of a pre-defined list of valid entries which should be allowed.

GCSE ICT Companion 04 - (C) P Meakin 2004