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 Method | Description |
---|---|
Range check | Checks the data is between an upper and lower acceptable value, within a certain range |
Type check | Checks that the data entered is of an expected type, e.g. a number or date |
Length check | Checks the number of characters meets expectations, e.g. 8 character password |
Format check | Ensures the data follows a set pattern (using an input mask), e.g. postcode |
Drop down box | Ensures the user can only choose a predefined option from a list, reducing the chances of spelling mistakes or unwanted responses |
Presence check | Checks the user has at least entered something into the field, stopping them from accidently leaving it empty |