Sie sind auf Seite 1von 1

Exercise 2 Querying the Restaurant Supply Database

The restaurant supply company has determined a number of questions that they want the database
management system to answer. You must obtain the answers to the questions posted by the company.
Instructions
Use the Restaurant Supply Database created in the Exercise 1. Open the Restaurant Supply database
and create the following queries for the Customer table.
1. Create a query to display the customer number, name, balance, and amount paid fields for all the
records in the table. Name the query Prac2_Q1.
2. Create a query to display the customer number, name, and balance fields for all customers where
the sales rep number is 51. Name the query Prac2_Q2.
3. Create a query to display the customer number, name, and, and balance fields for all customers
where the balance is greater than $100. Name the query Prac2_Q3.
4. Create a query to display the customer number, name, and amount paid fields for all customers
where the sales rep number is 49 and the amount paid is greater than $1,000. Name the query
Prac2_Q4.
5. Create a query to display the customer number, name, and address fields for all customers with an
address on Devon. Name the query Prac2_Q5.
6. Create a query to display the customer number, name, and balance fields for all customers where
the sales rep number is 49 or the balance is less than $50. Name the query Prac2_Q6.
7. Include the customer number, name, and balance fields in the design grid. Sort the records in
descending order by the balance field. Name the query Prac2_Q7.
8. Create a query to display the customer number, name, and amount paid fields for all customers
where the sales rep number is 44 or 49 and both balance are greater than $100. Name the query
Prac2_Q8.
9. Create a query to display the customer number, name, balance, and amount paid fields from the
customer table and the first name, last name, and comm rate fields from the sales rep table. Name
the query Prac2_Q9.
10. Restrict the records retrieved in task 9 above to only those customers that have a balance of 0.
Name the query Prac2_Q10.
11. Clear the design grid and add the first name, last name, and comm rate fields from the sales rep
table to the grid. Add the name and balance fields from the customer table. Calculate the pending
commission (balance * comm rate) for the sales rep table. Sort the records in ascending order by
last name and format pending commission as currency. Run the query and save as Prac2_Q11.
12. Display the following statistics: the total balance and total amount paid for all customers
(Prac2_Q12A); the total balance for customers of sales rep 44 (Prac2_Q12B); and the total amount
paid for each sales rep (Prac2_Q12C).
13. Create a query that includes the sales rep number, last name, first name, customer number, name,
balance, amount paid fields. Sort the query in ascending order by the sales rep number field. Run
the query and save the query as Sales Reps and Customers.
1

Das könnte Ihnen auch gefallen