You are on page 1of 5

VEGGIE BOX DELIVERY

Setting up a Relational Database to Create Tables, Forms, Queries,


and Reports
PREVIEW
In this case, you will create a relational database for a local farm that delivers boxes of
fresh fruits and vegetables to local customers on a weekly basis. First, you will create three
tables and populate them with data. Next, you will create a form and sub-form for
recording new customers and their orders. You will create four queries: a select query, a
parameter query, a totals query, and a query used as the basis for a report. Finally, you will
create the report from the fourth query.

PREPARATION
• Before attempting this case, you should have some experience using Microsoft
Access.
• Complete any part of Access Tutorial B that your instructor assigns, or refer to the
tutorial as necessary.

BACKGROUND

More and more people are buying “local” to be more environmentally friendly. In addition,
many people feel that they can taste the difference between locally grown produce and
produce that is grown far away and shipped to their grocery store. In response, a farm just
outside of Atlanta, Georgia is selling boxes of its in-season fruits and vegetables to Atlanta
residents. Customers sign up for the so-called “veggie boxes” and pay on a monthly basis.
The veggie boxes are delivered to customers’ homes every Thursday afternoon. The
contents of the box are a surprise; for example, customers do not know if they will receive
fresh asparagus, peaches, blueberries, or other fruits and vegetables that were picked that
morning.

The veggie box is growing in popularity, and the owners of the farm need your help. The
owners have heard that you are proficient in Microsoft Access, and they have asked you to
computerize their ordering system. They had hired a summer intern last year, so the
database design is already created.

Your first job is to create the tables and populate them with data. Until now, customer
orders have been tracked manually. The database design includes three tables, as shown in
Figures 1-1, 1-2, and 1-3: Customers, which keeps track of each customer’s ID number,
name, address, e-mail address, and credit card number for billing purposes; Boxes, which
keeps track of the three box types, their description, and monthly price; and Orders, which
keeps track of each order number, customer ID, box type, and start date of the service.

The owners have a few requirements for information output in the database beyond simply
recording the data. First, they would like to have an easier way to record a new customer’s

Page 1 of 5
information and the type of box the customer ordered. You can accomplish this task by
creating a form and sub-form.

In addition, the owners would like the database to answer some questions. To enable
efficient delivery of the veggie boxes, the drivers want to be able to print the delivery
addresses on their routes and order the list by zip code. In addition, the owners want to
know how many orders they receive for each type of box so they can plan for next year’s
crop and subsequent harvest.

The “C” box type contains three vegetables and three fruits. The owners realize that they
priced these boxes too cheaply, so they want to notify all customers who ordered the “C”
boxes that the price will be increased by 20 percent next year. The owners want a listing of
these customers so they can prepare a masse-mail that explains the price increase. Finally,
the owners want to be able to produce a list of bills for a particular month. Ideally, this
information should be stored in a nicely formatted report.

ASSIGNMENT 1: CREATING TABLES

Use Microsoft Access to create the tables with the fields shown in Figures 1-1 through 1-3;
these tables were discussed in the Background section. Populate the database tables as
shown. Add your name to the Customers table with an appropriate customer ID; complete
the entry by adding your address, phone number, e-mail address, and a fictional credit card
number.

Figure 1-1 CUSTOMER Table

Figure 1-2 BOX Table

Page 2 of 5
Figure 1-3 ORDER Table

ASSIGNMENT 2: CREATING A FORM, QUERIES, AND A REPORT

Assignment 2A: Creating a Form

Create a form for easy recording of new customers and their orders. The main form should
be based on the Customers table, and the sub-form should be inserted with the fields from
the Orders table. Save the form as Customers. View one record and, if required by your
instructor, print the record. Your output should resemble that in Figure 1-4.

Figure 1-4 Customer form

Assignment 2B: Creating a Parameter Query

Create a parameter query that prompts for a zip code and subsequently lists columns for
the Last Name, First Name, Address, Zip Code, and Box Type of all customers in the
respective zip code. Save your query as Delivery by Zip Code. Your output should
resemble Figure 1-5 when you enter the zip code 30600 at the prompt.

Page 3 of 5
Figure 1-5 Delivery by Zip Code query

Assignment 2C: Creating a Totals Query

Create a query that adds up the number of boxes on order for the month of July. Your
output should show the box type, description, monthly price, and number of orders for
July. (Note that the Number of Orders heading is a column heading change from the
default setting provided by the query generator.) Save your query as April Order Summary.
Your output should resemble that shown in Figure 1-6. Print the output if desired.

Figure 1-6 April Order Summary query

Assignment 2D: Creating a Query with a Calculated Field

Create a query that calculates the new price of a “C” box, which is 20 percent higher than
the current price. Include columns that list the Last Name, First Name, and Email Address
of all “C” box recipients, along with the new price. Save the query as Price Increase
Notification. Your output should resemble that shown in Figure 1-7. Print the output if
desired.

Figure 1-7 Price Increase Notification query

Page 4 of 5
Assignment 2E: Generating a Report Generate a report based on a query.

The query should display the last name, first name, and address of all customers who
receive veggie boxes in April, along with the monthly price and start date. Save the query
as April Bills. From that query, create a report with a grand total of all monthly payments
at the bottom. Make sure that all fields and data are visible, and title the report April Bills.
Your report output should resemble that in Figure 1-8.

Figure 1-8 April Bills Report

DELIVERABLES
Assemble the following deliverables for your instructor in electronically form:
1. Three tables
2. Form and sub-form: Customers
3. Query 1: Delivery by Zip Code
4. Query 2: July Order Summary
5. Query 3: Price Increase Notification
6. Query 4: April Bills
7. Report: April Bills
8. Any other required tutorial printouts or electronic media

Page 5 of 5

You might also like