Unit 5 Exercise Help. Data Properties.


Exercise 1: Distributor

In part 1 the structure of the Clients table needs to be edited:

1 Open the Cars database, located in the My exercises folder.

2 Go to the table design Clients by selecting it and clicking on the button in the Database window.

For all those fields in which the size need to be edited:

1 Click on the field to edit so that its properties appear at the lower part of the window.

2 Click on the Field Size property.

3 Type the new size.

In the Client Code field a validation rule needs to be assigned.

1 Click on the name of the field.

2 Click on the Validation rule in the lower part of the screen.

3 Write >0 AND <3001 so that we will only be allowed to introduce codes between 1 and 3000 (more than zero and less than 3001).

To improve the validation rule:

4 Click on the Validation text property in order to specify the message that will appear on the screen if we try to introduce a value that does not comply with the previous condition.

5 Write Code values must be between 1 and 3000.

In order for the postal code to always be composed of 5 numbers we need to assign to it an Input mask.

1 Click on the name of the field, Postal code.

2 Click on the Input mask property, type the mask 00000 ( the 0 represents a obligatory numeric digit so that letters can not be introduced, and if a value is introduced it will be obliged to contain 5 numbers.

Now we are going to specify the default value for State field in such a way that TX appears automatically in the field without having to type it.

1 Click on the Client State field.

2 Click on the Default Value property in the lower part of the window.

3 Type TX.

In order for the telephone to be introduced correctly

1 Click on the Client Phone field.

2 Click on the Input Mask property.

3 Click on the button that appears to the right of the property. You must save changes first, aswer YES to messages that will appear.

4 Follow the wizard and select a Phone Number Input Mask

5 Click on Finish Button.

Then we will change the date of birth format.

1 Click on the CLient Birth field.

2 Click on the Format property in the lower part of the window.

3 Click on the arrow that appears to the right of the property.

A drop down list will open.

4 Click on Short date.

Finally, we must save the changes:

1 Click on the button on the toolbar.

 

In part 3 to leave the code as 100 we can:

Click on the code and type the value 100, substituting the value 3500,

or,

Click twice on the button on the toolbar in order to undo changes.

 

In part 5 the structure of the Sold cars table needs to be edited:

1 Go to the table design, by selecting it and clicking on the button in the database window.

 

For all those fields in which the size need to be edited:

1 Click on the field to edit so that its properties appear at the lower part of the window.

2 Click on the Field Size property.

3 Type the new size.

The data type of Price field needs to be changed to Currency:

1 Click on datatype in Price field.

2 Click on the arrow to the right.

3 Select Currency.

Note: The Currency type uses the definition of currency contained in the Regional Options of Windows.

And finally save the table.

 

Exercise 2: Clinic

 

In part 1 the structure of the Patients table needs to be modified:

1 Open the Clinic database, located in the My exercises folder.

2 Go to the design of Patients table, by selecting it and clicking on the button in the Database window.

For all those fields in which the size need to be edited:

1 Click on the field to edit so that its properties appear at the lower part of the window.

2 Click on the Field Size property.

3 Type the new size.

In order for the Patient code field to be of Integer data type:

1 Click on the field.

2 Click on the Field Size property in the lower part of the window.

3 Click on the arrow to the right.

4 Select Integer value.

Then, we will change the date of birth format.

1 Click on the Patient Birth field.

2 Click on the Format property in the lower half of the screen.

3 Select Short Date option from the drop down list.

And finally we will save the table.

 

In part 2 the structure of Doctors table needs to be modified.

1 Go to the design of the Doctors table, by selecting it and clicking on the button in the Database window.

For all those fields in which the size need to be edited:

1 Click on the field to edit so that its properties appear at the lower part of the window.

2 Click on the Field Size property.

3 Type the new size.

And finally we will save the table.

 

In part 3 the structure of Entries table needs to be modified.

1 Go to the design window of the table, by selecting it and clicking on the button in the Database window.

To modify Entry Room field:

1 Click on Entry Room field.

2 Click on Field Size property in the lower part of the window.

3 Select Integer option from the drop down list.

 

To modify Entry Bed field:

1 Click on Entry Bed field.

2 Click on the Field Size property.

3 Type 1.

To change the Entry Date format:

1 Click on Entry Date field.

2 Click on Format property in the lower part of the window.

3 Select Short date option from the drop down list.

 

And finally we will save the table.

Lastly we will close the database by clicking on the button in the Database window.

 



 
Legal warning: Authorised on-line use only. It is not allowed the use of these courses in companies or private teaching centres.
© aulaClic. All rights reserved. Reproduction in any form whatsoever is prohibited. April-2006.