Using validation on your Snowboarding database

advertisement
Lesson 16 – Data Structure Tables
Data Structure Table for the Hickley Health Club Database
Field Names
These are the categories of information you wish to store in a database. For example Forename, Surname or
Date of Birth. In your Hickley Health Club database there are 11 Field Names.
Activity 1 - Fill in the Field Name column on your Data Structure Table sheet.
Data Type
This is how the information is stored on your database. Whilst there is a range of data types the most
common are: Text – This can store both letters and numbers in it.
Number – This can only store numbers in it. Please remember telephone numbers would be stored in a text
field and not a number field. This is because all telephone numbers start with a zero. If you put a telephone
number in a number field, the zero will be deleted. This would make the telephone number useless!
Date/Time – This is perfect for dates of the year and times of the day.
Activity 2 - Fill in the Data Type column on your Data Structure Table sheet.
Choose either ‘Text’; ‘Number’ or ‘Date/Time’ data types
Field Size/Format
This is how many characters (letters, spaces and numbers) are available to store data or how data in other
formats should be displayed.
For all Text fields you need to decide the maximum amount of characters you will need to store the data in
that particular category. This will be a number between 1 and 255. For example for a ‘Forename’ field you
might set the Field Size to 15 as people’s first names are likely to be less than 15 letters long.
For all Number fields you need to choose how you wish the numbers to be displayed. The most common
number format is ‘Long Integer’ which means whole number.
For all Date/Time fields you will need to choose how you wish the date or time or time to be displayed. The
most common date format is ‘Short Date’ e.g. 23/07/2008.
Activity 3 - Fill in the Field Size/Format column.
For all Text fields choose number between 1 and 255.
For all Number fields choose ‘Long Integer’
For all Date/Time fields choose ‘Short Date’.
Using validation on your database
Validation is used by people setting up databases to stop people making mistakes when they enter data.
For this database we are going to consider four types of validation:  Combo boxes.
 Default Values.
 Input Masks.
 Validation Rules and Text.
Lesson 16 – Data Structure Tables
Combo Boxes
These are drop down lists, which save the person entering data time and prevent mistakes by offering a
choice of options. They are only useful for fields where there are only limited choices of options which are
made up from single words or short phrases. For example ‘Gender’ as there is only two choices – ‘Male’ or
‘Female’.
Activity 4 - Decide which fields will be suitable to use combo boxes on.
Write ‘Combo Box’ in the Validation column for the fields you have chosen
Default Values
These are the most common option likely to be selected. They will appear already printed into the field,
although the person entering data can overwrite them if necessary. For example in a database containing the
names and addresses of students at Kingsway School, you might put a Default Value of ‘Stockport’ in the
Address 3 field, as most students live close to Stockport.
Activity 5 - Decide which fields have repetitive information and so would be suitable to use Default
Values on.
Write ‘Default Value’ in the validation column for the fields you have chosen.
Input Masks
These are codes put into the computer to only allow certain types of data to be entered.
An Input Mask could be used to make sure the field begins with a capital letter but then follows in lower case
letters. For example you might use this type of Input Mask on a Forename field as all forenames should begin
with a capital letter.
Activity 6 – Decide which fields this kind of Input Mask would be suitable for.
Write ‘Input Mask’ in the validation column for the fields you have chosen.
Validation Rules & Text
These can be set to stop people entering data that is not reasonable, by ensuring that it meets certain
conditions. Otherwise an error message will appear.
For example, on a Date of Birth field, you might set a Validation Rule that stops people entering Dates of
Birth that are in the future or that are more than 100 years ago. Clearly such Dates of Birth are not
reasonable!
Activity 7 – Decide which fields Validation Rules & Text might be suitable for.
Write ‘Validation Rule’ in the validation column for the fields you have chosen.
Activities 8 - For any blanks left in the validation column, write ‘None’
Activity 9 - Type up your completed table in an MS Word document.
Title: - ‘Data Structure Table for the Hickley Health Club Database’
You will need to create a table with 4 columns and 12 rows.
Table -> Insert -> Table
Download