Topics / Databases / Database Validation

Database Validation

Validation is an automatic check to ensure that the data entered is sensible and feasible.

Validation cannot ensure data is actually accurate.

Database Management Systems allow for some handy validation methods to be implemented.

These are needed because it is easier to try and prevent users from entering garbage than attempting to fix mistakes later.

Validation methods for databases

Validation MethodDescription
Range checkChecks the data is between an upper and lower acceptable value, within a certain range
Type checkChecks that the data entered is of an expected type, e.g. a number or date
Length checkChecks the number of characters meets expectations, e.g. 8 character password
Format checkEnsures the data follows a set pattern (using an input mask), e.g. postcode
Drop down boxEnsures the user can only choose a predefined option from a list, reducing the chances of spelling mistakes or unwanted responses
Presence checkChecks the user has at least entered something into the field, stopping them from accidently leaving it empty


Topics / Databases / Database Validation