Objectives

Students will be able to:

  • describe a variety of common validation rules and why they are necessary.
  • create validation rules for a database field.

Valid Data Only Please!

eCabby Recruitment Form


An eTaxi company is recruiting staff in the age range 18-31. Potential recruits simply visit the company website and fill out a form. The company will send further details about the position at a later date.

Look at the form above. Try using it. What happens if:

  • you don't enter a first name?
  • you enter a number outside the range 18-31?
  • the email address is not an email address?
  • the password is too short or too long?

Yes, that's right! Databases can be programmed to accept valid data only!

Database engineers design data validation rules to help minimise the rick of invalid data entry. Here are some of the kinds of rules that can be designed:

  1. format validation check
  2. presence validation check
  3. length validation check
  4. range validation check
  5. data type validation check

Using the form above, what kind of validation rule has been created for each data entry element?

   Skill-up 1 - Create a form.

Import the file below into your application and figure out how to create a form. Make it pretty!

Can you figure out how to create a to add a new record to the form?

data file

Be smart! Download the file and save it in a new project folder. Don't leave it in the downloads folder of your computer. You are not a newbie!

   Skill-up 2 - Creating validation rules.

Research Data Validation for the database application you are using. Test your validation rules by attempting to enter valid and invalid data into the database table.

Common validation checks are:

  • presence checks
  • range checks
  • length checks

You may also be able to design data type and format checks, too.

data file

Be smart! Download the file and save it in a new project folder. Don't leave it in the downloads folder of your computer. You are not a newbie!

   Evidence

In your evidence document, paste a screenshot of each validation rule you designed, along with the name of the rule.

Food For Thought

Data validation is critical in the design of database systems. Imagine if you signed up for Facebook and you were allowed to enter ggg.xxx.3 as your email address! Or 23/10/1843 as your date of birth!

Homework




essential vocabulary

database import evidence table integer screenshot record text field double data type


SUBSCRIBE

Join my mailing list to receive updates on the latest blog posts and other things.