Unit 7 exercise help. Queries


Exercise 1: Distributer

In part 2 we need to create a query from the Sold cars table.

1 Position yourself in the Queries tab of the Database window.

2 Click on the Create query in design view option.

Next the Show table box will open.

3 Click on the Sold cars table.

4 Click on the Add button.

5 Click on the Close button to close the dialogue box.

6 Double click on the Registration field.

7 Double Click on the Make field.

8 Double click on the Model field.

9 To run the query click on the button on the toolbar.

Observe how we are only shown the three fields.

10 Close the query.

11 Write the name as Sold cars query.

 

In part 3, the previous query needs to be edited to extend its criteria.

1 Click on the Sold cars query name in the Database window.

2 Click on the button.

3 Drop down the File menu and select the Save as... option.

4 Type the name Ford cars. We will save it first so as not to pulverize the previous query.

5 Double click on the Price field.

6 Type Ford in the Make column of the Criteria: row.

7 To run the query click on the button.

8 Click on the button.

9 Close the query.

 

In part 4 , the previous query needs to be edited to extend its criteria.

1 Click on the Ford cars name in the Database window.

2 Click on the button.

3 Drop down the File menu and select the Save as... option.

4 Type the name Ford superiors. We will save it first so as not to loose the previous query.

5 Write >16000 in the Price column of the Criteria: row, the same row than Ford.

6 To run the query click on the button.

7 Click on the button.

8 Close the query.

 

In part 5 we need to create another query with the Clients and Sold cars tables.

1 Click on the Create query in design view option in the Queries tab of the Database window

2 Double click on the Sold cars table.

3 Double click on the Clients table.

4 Click on the Close button to close the dialogue box.

In the tables area, the two tables appear joined.

5 Double click on the Client City field.

6 Double click on the Client Surname field.

7 Double click on the Make field.

8 Type Ford in the Make column of the Criteria: row.

9 Type Audi in the same column of the or: row.

10 Select Ascending in the Client City column of the Sort: row.

11 Select Ascending in the Client Surname column of the Sort: row.

12 To run the query click on the button on the toolbar.

15 Click on the button.

16 Type the name Ford and Audi clients.

17 Close the query.

 

Exercise 2: Clinic

 

In part 2:

1 Position yourself in the Queries tab of the Database window.

2 Double click on the Create query in design view.

Next the Show table box will open.

3 Double click on the Patients table.

4 Click on the Close button to close the dialogue box.

6 Double click on Patient surname field.

7 Double click on Patient Address field.

8 Double click on Patient Birth field.

9 Type < 01/01/60 in the Patient Birth column in the Criteria: row.

10 Double click on the Patient zip Code field.

11 Type 78767 in the Patient zip Code column of the Criteria: row.

12 Uncheck the check box in Show: row in the Patient zip Code column.

13 To run the query click on the button on the toolbar.

14 Close the query.

15 Write the name as Patients from 78767.

 

In part 3 we need to create another query with the Patients, Doctors and Admissions tables.

1 Double click on the Create option in design view option in the Queries tab of the Database window.

2 Double click on the Patients table.

3 Double click on the Doctors table.

4 Double click on the Admissions table.

5 Click on the Close button of the dialogue box.

The three tables are joined in the tables area.

6 Double click on the Patient surname field.

7 Double click on the Patient Birth field.

8 Double click on the Entry date field.

9 Double click on the Doctor surname field.

10 Double click on the Doctor Speciality field.

11 Type < 12/31/98 in the Entry date column of the Criteria: row.

12 To run the query click on the button on the toolbar.

13 Click on the button.

14 Type the name Patients with doctor.

15 Close the query and the database.

 



 
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.