You are on page 1of 3

Exercise 1 – scope a small database

A local medical practice have asked you to help design a simple database to track the costs of treating
patients. Their paper based system means that it takes a long time to work out how much they are spending.
What do we need to be able to do?

 Record exact costs of treatments against each person


 Record name, description, and cost of a range of treatment types
 Track costs by treatment type
 Track costs by age
 Track costs by sex
 Track costs by post code

Tasks

Decide what the main table names should be


Note down the fields that belong to each table
Choose an appropriate data type for each field

Exercise 2 – Create a table

Using the same technique as used to build the Patients table, create the Treatments table

Tasks

Create a new table in Design view (CREATE > Table Design)


Enter the fields as in the table below
Nominate the ID field as primary key
Add a validation rule to the currency field so that values must be greater than or equal to zero
Add some validation text to the effect that “Treatments costs cannot be below zero
Save the table and call it Treatments

Field Name Data Type


ID AutoNumber
Treatment Short Text
Description Long Text
Cost Currency
Exercise 3 – Create a relational table

Using the same technique as used to create the lookup for the Patient field, create the lookup for the
Treatments field table

Tasks

Change the data type of the Treatments field to Lookup Wizard


Step through the wizard making sure you choose the Treatments table as the data source
Add the ID, Treatment Name, and Cost fields
Sort the lookup by Treatment Name, then Cost fields
Enable Data Integrity and Restrict Deletes
Save the changes when prompted

Exercise 4 – Import data

Using the same technique as used to import the Patients.xlsx workbook, import the data from
Treatments.xlsx into the Treatments table

Tasks

Launch the import from Excel wizard (EXTERNAL DATA > Import & Link > Excel)
Browse for and select the Treatments.xlsx workbook
Choose to append a copy of the records to the Treatments table
Step through each prompt on the wizard as there won’t be any changes needed
Finish and close the wizard
Open the Treatments table to confirm that the records imported correctly.
Repeat the process for the Patient Treatments.xlsx workbook to import the data into the Patient
Treatments table
Exercise 5 – Query the database

Using any combination of criteria or techniques work out the following

Tasks

Find out how many men are in the Patients table who are less than 35 years old
Find out how many treatments have been given to people from the EN56 post code
Calculate the total cost of treating all patients
Calculate the cost of treating patients by post code
Count the number of treatments for each sex
How many surnames start with the letters ‘We’ (any number of letters can follow)
How many surnames contain the letters ‘an’ at any part of the name
How many first names end with ‘er’ (any number of letters can precede)

Exercise 6 – Create a form

Build some forms!

Tasks

Create a single item form based on the Patients table, save it as “Patients form”
Create a multiple items form based on the Patients table, save it as “Patient List”
Modify the Patient List form by removing the Address Line 1 and Post Code fields
Resize the fields by reducing the height so that you can see a more people on the screen.
Save your changes

Exercise 7 – Create a report

Build a report using the wizard!

Tasks

Build a report based on the Patients table that includes the ID, Surname, First Name, Date of Birth,
and Sex fields
Group the report by sex
Sort by date of birth in descending order
Use the Block layout and portrait orientation
Save the report as “Grouped patient list”
Switch to layout or design view and resize any fields whose boxes are too narrow

You might also like