Validation

A feature of good database design is validation.

Validation is a series of checks that can be carried out on the data entered into the fields

It is good practise to limit fields so that the values they accept :

  • Are sensible
  • Are valid
  • Don’t waste storage space

Presences Check 

A presence check can be used to ensure that data must be entered in a field.

Makes sure that the field is not left empty

For example:

  • Postcode
  • DOB

 

 

 

Field Length Check

A field length check can be used to limit the number of characters in a field.

For example:

  • Forename (e.g. maximum 12 characters)
  • Surname (e.g. maximum 15 characters)
  • Postcode (e.g. maximum 8 characters)

 

 

 

 

 

Range Check

A range check can be used to ensure that data falls between two values.

For example:

  • Enter a date (1 to 31)
  • Enter a rating (0 to 100)
  • Enter the temperature (-50 to 50)

 

 

 

 

 

Restricted Choice 

A restricted choice check can be used to limit the user entry to a list of acceptable values.

For example:

  • Day of week (Mon, Tue, Wed, Thu, Fri, Sat, Sun)
  • Driving licence (Full, Provisional, None)
  • Gender (Male, Female)
  • Salutation (Mr, Mrs, Miss, Ms, Master, Lord, Lady, Other)