PHS CyberSchool
Computer Studies SG
Modified 08 June 2004
Taxi Advertising Database - Queries
The advertising sales manager has determined a number of questions that he
wants
the database management system to answer. You must obtain answers to the
questions posed by the manager. Open the database file Cape Town City Taxi
Company you created in Taxi Advertising Database - Basic.
Simple and parameter queries
Create the following queries for the Advertiser table.
(Use the tip
sheets for assistance.) Give each query a clear name such as
c-City begins with P.
- Display and save the Advertiser Id, Name, Balance and Amount Paid
fields for all the records in the table. (Simple query)
- Display and save the Name and Balance fields for all
the advertisers
where the Balance is greater than R200. (Simple query)
- Display and save the Name and City fields for all the
advertisers
where the City begins with the letter P. (Simple query)
- Display and save the Name and Sales Rep Number fields for
all the advertisers where the Sales Rep Number is 24. (Simple
query)
- Display and save only the Name and Balance fields for
all the advertisers
where the Sales Rep Number is 29 AND the Amount Paid is greater than
R1000. Do NOT show the Sales Rep Number and Amount Paid
fields. (Simple query)
- Display and save only the Name and Balance fields for all the advertisers
where the Sales Rep Number is 29 OR the Balance is less than R50.
Do NOT show the Sales Rep Number field. (Simple query)
- Display the Name and Balance fields for a parameter query
where Balance is less than a certain amount. (Parameter query)

- Display only the Advertiser ID, Name and Amount Paid for a parameter
query where the Amount Paid is more than a certain amount.
(Parameter query)

Sorting
- Include only the Name, Postal Code and City fields in the design grid of the
query. Sort the records in ascending order by City within Postal
Code. Display and print the results. The Postal Code field
should display in the result to the left of the City field.

- Display and save just the Cities in ascending order. Each City should
display only once. (Unique values)

Calculations in queries
Display and save the following statistics:
- Total Balance for all advertisers
- Total Amount Paid for all advertisers
- Total Balance and Total Amount Paid for all advertisers
- Total Balance for advertisers of Sales Rep 29
- Total Amount Paid for each Sales Rep

Different kinds of calculations in queries, and joining tables
Join the Advertiser and Sales Rep tables by the Sales Rep fields in the query
dynaset.
Display and save print the First Name, Last Name and Comm Rate fields
from the Sales Rep table, and Name and Balance fields from the Advertiser
table.
- Calculate the Pending Commission [Balance]*[Comm Rate] for the
Sales Rep table.
- Sort the records in ascending order by Last Name.
- Format Pending Commission as currency.

Display and save the Advertiser ID, Name, Balance and Amount Paid from the Advertiser
table, and the First Name, Last Name and Comm Rate fields from the Sales Rep
table.
- Restrict the records retrieved above to only those whose advertisers that
are in Table View. Display and save.
- Save the database for future tasks.
- Consult the Access Help pages on Queries, then look at all the pages on
Simple select query and Select query, and Parameter queries.
- Consult the Access Help pages on Calculate, then look at Perform
calculations in a query. Examine all the pages referred to.
(based on Access 2000 by Shelly, G.B., Cashman, T.J. and Pratt, P.J.
published by Course Technology in 2000 www.scsite.com
)
Return to Computer
Studies lesson plan index. This work may be freely copied for non-commercial use only.
Copyright © Pam Miller.