IS 312, Information Systems for Business Database Project in Access Department of Accounting & Information Systems College of Business & Economics 2010-2015 by David W. Miller, Ph.D. This document created and for exclusive use by students in the above identified course. No other use of this document is authorized without the consent of the author. The document was last updated on November 17, 2015. INTRODUCTION: This assignment is based on a fictitious small business the Coffee Roasting Company (CRC). CRC produces and sells gourmet coffees to institutional customers (i.e., restaurants and coffee houses). CRC buys green (i.e., raw) coffee beans from various suppliers, combines them in varying quantities and roasts the beans creating the finished goods inventory of mixes. Quantities of the mixes are then packaged based on sales orders from standing customers. A database has been created that records transactions related to these activities. You are provided with a copy of the database to use for analysis. You will conduct analyses creating queries to search the database for information to answer questions that are posed to you below. DATABASE OVERVIEW: The entity-relationship diagram depicted in Figure 1 shows the entities (tables), attributes (fields) and their relationships for the CRC database. There are three major components or areas to the database: sales, purchases, and production note that there is overlap between the areas. The tables contained within the yellow border are the sales component and include data on customers, their business locations (restaurants), sales orders (invoices and items sold), and sales inventory. Tables contained within the red border are of the purchasing component and includes data on suppliers of the materials used in production, the locations that suppliers ship from, purchase orders (materials purchased), and materials inventory. Within the blue border are tables of the production component including the production schedule and the materials needed to make each product as well as manufacturing-materials and finishedgoods inventories. As you examine the database structures you will notice that the sales and purchasing components are near-mirror images of one another. The basic data structures are quite similar with the primary difference being the flow of the data. In the sales component, data flows into CRC in the form of sales orders from customers and product flows out to restaurants. On the purchasing side, data flows out in the form of purchase orders and materials flow in from suppliers. ASSIGNMENT OVERVIEW: You will download the Coffee_Roasting_Company.zip folder which is in compressed (zipped) folder format. This folder contains the database file, Coffee_Roasting_Company.accdb, a Microsoft Access database file. You will need to extract the files from the compressed format before you can do any work with them. The database file is in Microsoft Access 2007 format. You may complete the project using either MS Access 2007, 2010, or later. These instructions are written for the MS Windows 7/Access 2013 environment. I have not created instructions specific to any other MS Windows environment. However, there is a great deal of similarity between the instructions that I have provided and the other Windows environments such that you should not have difficulty adjusting them to those environments. Contact me for assistance if you do have difficulty.
The database contains fifteen data tables. The tables meet the specifications designated in the CRC_DataDictionary.pdf document (note that if you find discrepancies between the table structures and their definitions in the Data Dictionary, the structures in the database are the default values). You are to use the query capabilities of Microsoft Access to create queries as directed in the sections below. The queries select fields from tables and limit the number of rows you look at. You will also use the aggregate (Totals) function to group data for certain queries. Finally, you will need to create fields in queries from expressions (formulas) combining data from different fields in tables. Figure 1. Entity-Relationship Diagram (E-RD) for CRC Database GETTING STARTED: What follows is a self-guided tutorial of Microsoft s Access database management application in how to query the data and provides problems to test your understanding of the skills learned in the tutorial. Download the database files: Download and save to disk the Coffee_Roasting_Company.zip folder which is in compressed (zipped) folder format. This folder contains the Coffee_Roasting_Company.accdb Microsoft Access database file. Extract the database files once you have saved the folder to your computer, simply double-click on the folder, click the Extract all files option in the Folder Tasks section of the dialog to launch the Extraction Wizard. Follow the instructions in the wizard to extract (un-zip) the files. The database file is in Microsoft Access 2007 (current) format. You may complete the project using any version of MS Access that will accept this file format. Open the database file: Open Access and the Coffee_Roasting_Company.accdb database file. Access Database Project Page 2 of 9
QUERY TUTORIAL: The data contained in the tables of the database can be queried to manipulate and process the data into meaningful information. There are a number of different query operations that can be easily created in Access that will manipulate the data in different ways. This section provides tutorials of how to create basic queries from the CRC database to be included in your project. Create a simple Select Query with a Join condition: Create a query that will display the shipping address, shipping zip code, and the contact name for each customer. Select the All Access Objects option from the drop-down list of the Navigation pane (if not already selected). You will create this query in Design View so select the Create tab and the Query Design icon. The query Design View will be launched and the Show Table dialog will be displayed. The data that you need for this query is contained in the Customer and Restaurant tables. Add these tables to the query design. Note the line and symbols indicating the relationship between the tables. If selecting tables that are not directly related, it would necessary to add the other tables needed to make the (indirect) connection between the tables. Add the fields from the table in the order in which you want the columns to appear in your query results. CustName CustShipAddr CustShipCSZ CustContact Save the query as 01 Customer Shipping Address. Note: be sure to number the queries in the order in which they appear in the instructions Execute the query by clicking on the Run (exclamation mark) icon. The Datasheet view of the query should display 33 records (corresponding to the number of records in the Restaurant table). Add a single criterion to a Select Query: Create a query that will display all of the customers names and the contact person and phone number for those customers with a discount greater than five percent. Begin by creating the query in design view. All of the fields needed for this query are contained in the Customer table, so add only that table to the query. Add the desired fields to the query in the order in which you want the columns to appear. CustName CustDiscount CustContact CustPhone Access Database Project Page 3 of 9
Add criteria to the CustDiscount column to limit the data to those values that are greater than.05 (5%). Note that this will not include those customers whose discount rate is exactly 5.0%. Run the query. There will be ten records displayed in the Datasheet view of the query. Save the query. Name the query 02 Customers with High Discount Rates. Queries with multiple criteria: There are two logical functions that can determine the results of your query. The AND logical function will limit your results to only those records that meet all of the criteria you have entered. The OR logical function will increase your results, giving you all of the records that meet each of the criteria that you have entered. Using the AND logical function Create a query that lists all of the Regular Mix varieties that are greater than five dollars. Begin by creating the query in design view. All of the fields needed for this query are contained in the Mix table, so add only that table to the query. Add the desired fields to the query in the order in which you want the columns to appear. MixName MixVariety MixBasePrice Add criteria to the MixVariety column to limit the data to those values that are Regular. Add criteria to the MixBasePrice column to limit that data to those values that are greater than $5.00. Note that this criterion is entered on the same row as the MixVariety criteria. Run the query. There will be two records displayed in the Datasheet view of the query. Save the query. Name the query 03 Regular Mixes Greater Than $5. Using the OR logical function Create a query that lists all of the Regular Mix varieties as well as all Mixes that are greater than five dollars. Begin by creating the query in design view. All of the fields needed for this query are contained in the Mix table, so add only that table to the query. Add the desired fields to the query in the order in which you want the columns to appear. MixName MixVariety MixBasePrice Add criteria to the MixVariety column to limit the data to those values that are Regular. On a separate row, add criteria to the MixBasePrice column to limit that data to those values that are greater than $5.00. Note that this criterion is entered on a different row from the MixVariety criterion. Run the query. There will be seven records displayed in the Datasheet view of the query. Access Database Project Page 4 of 9
Save the query. Name the query 04 Regular Mixes and Greater Than $5. Create a Query that uses aggregate functions: Create a query that shows the total quantity sold and the average unit price for each mix variety. Begin by creating the query in design view. All of the fields needed for this query are contained in the Mix and Sales Order Item tables, so add these tables to the query. Add the desired fields to the query in the order in which you want the columns to appear. MixVariety QtySold UnitPrice Select the Totals function (the epsilon,, on the Design ribbon). Note that a Total: row has been added to the query and that each field displays Group By. Since the MixVariety field is in the first column the query results will be grouped on each unique instance of a variety in the Mix table. Therefore, leave the Totals value as Group By. The QtySold field is to be the total sold for each variety of mix, so set the Total: row value to Sum. Right-click anywhere in the QtySold column and select Properties from the menu. Change the Caption to Total Quantity Sold. The UnitPrice field is to be the average of the unit price for each variety of mix sold, so set the Total: row value to Avg. Right-click anywhere in the UnitPrice column and select Properties from the menu. Change the Caption to Average Unit Price thus providing a column (field) heading that is more easily read. Run the query. There will be four records displayed in the Datasheet view of the query. Resize the columns so that the full column names are visible. Save the query as 05 Sales by Mix Variety. Add an Expression (Calculated Field) to a Query: Modify the Sales by Mix Variety query to add fields that calculate the total and average sales per Mix Variety. Begin by opening the Sales by Mix Variety query in design view. Position the insertion point in the blank Field text box to the right of the UnitPrice field, and then click the Build button on the tool bar. The Expression Builder dialog box opens. The expression elements help you build an expression. Note that the Sales by Mix Variety query is already selected in the left expression element list. The fields within that query are listed in the center expression element list. Access Database Project Page 5 of 9
To calculate the total and average sales for each Mix Variety, you will need to multiply the UnitPrice by the QtySold. You will need to navigate within the Expression dialog expression element list to the table containing those fields (Sales Order Item). You will then need to insert the fields into the expression box along with the appropriate arithmetic operators. Expand the Coffee_Roasting_Company.accdb folder in the list in the left expression element list by clicking on the + Expand the Tables folder in the list in the left expression element list by clicking on the +. Scroll down the list until you see the Sales Order Item table and click on it. A list of the fields will be displayed. Select the UnitPrice field name and click the Paste button, [Sales Order Item]![UnitPrice] will be displayed in the expression box. Type the * for multiplication, then select the QtySold field name and click the Paste button. The expression is complete with [Sales Order Item]![UnitPrice] * [Sales Order Item]![QtySold] displayed in the expression box. Click the OK button to close the Expression Builder dialog. Since you are asked to do two operations (sum and average), you need to add another expression field. Follow the above instructions to add the same expression to the next field column of the query. Now that you have the two expressions needed to multiply UnitPrice by QtySold, you need to set the proper aggregate functions to give you the total and average values as well as add captions for each field. Position the insertion point in the Total: text box of the first expression field. Open the list of aggregate functions. This first expression will be the total sales per Mix Variety, so select the Sum function from the list. Right-click anywhere in the field area for this expression and select Properties from the menu. Enter the caption Total Sales. Position the insertion point in the Total: text box of the second expression field. Open the list of aggregate functions. This second expression will be the average sales per Mix Variety, so select the Avg function from the list. Right-click anywhere in the field area for this expression and select Properties from the menu. Enter the caption Average Sales. Run the query. The results should be similar to those in the following figure. Save the query by clicking on the Office Button, then Save As from Access Database Project Page 6 of 9
the menu bar and save the query as 06 Aggregate Sales by Mix Variety. ADDITIONAL QUERIES: You have acquired the basic skill set needed to create queries in Microsoft Access. Use those skills to complete the remaining queries in the project. The details of the instructions will diminish and/or the complexity of the queries will increase as you progress through this section and, presumably, your skills with Microsoft Access improve. Sales per Customer Query: Create a query to provide information on the sales volume for each of the customers CRC does the business with. From the Customers table, you need the Customers names and from the Sales Order Item table, you need the quantity sold. Note that that there is no relationship line between these two tables meaning that there is no direct relationship between them. You will have to add the Sales Order table to the query to provide a relationship path between the Customers and Sales Order Item tables, even though you are not using any fields from the Sales Order table. Create an expression in the third query field that will compute the sales price for each item sold. Multiply the QtySold times the UnitPrice from the Sales Order Item table. Use the aggregate (Totals) function to group on the Customers names and provide the total quantity sold and total sales for each customer. Sort the data in descending order on the total sales. Be sure to add appropriate captions to the aggregated and calculated fields. Save the query naming it: 07 Sales per Customer. Sales per Restaurant Query: Create a query that shows the amount of sales CRC received for each restaurant (individual locations CRC shipped goods to). The key to this query is realizing that some customers have more than one restaurant and that CRC delivers directly to the restaurant location and not the Customers billing addresses. The query needs the Shipping Address from the Restaurant table, the Customer Name from the Customer table and the quantity sold from the Sales Order Item table. Again, you need to include the Sales Order table in the query to provide the path between the Sales Order Item and Customer tables. Create an expression in the fourth query field that will compute the total sales amount for each restaurant. Group on the Shipping Address and sort descending on the Total Sales field. Be sure to add appropriate captions to the aggregated and calculated fields. Save the query naming it: 08 Sales per Restaurant. Sales per Mix Query: Create a query to let us compare the goods (mixes) sold in terms of the quantity sold and sales amount. The query needs the Mix Name for the Mix table and the Quantity Sold from Sales Order Item table. It also needs a calculated field (an expression) that shows the mixes in terms of the sales price. Make sure that all of the tables added to the query have a path that relates all of the tables in the query. Do you need to add more tables? Use appropriate grouping and sorting for the query. Save the query naming it: 09 Sales per Mix. Access Database Project Page 7 of 9
Purchases per Bean Query: Using the same sort of procedures described for queries 07 through 09 above, create a query that compares the Production Materials (Beans) that had been purchased. Note that the structure of the tables on the purchasing (materials, i.e., Bean) side of the database are similar to the table sales (finished goods, i.e., Mix) side. Meaning, that the data structures between the purchases and sales sides of the database (see Figure 1) are very similar; the main difference is in the direction of the data flow. On the sales side, data flows in (in the form of orders) and finished goods (mixes) flow out. On the purchases side, data flows out (in the form of purchase orders) and materials (beans) flow in. The data at rest (i.e., data stored in the database) is very similar between the sales and purchases sides of the database. Therefore, for this query, you should see a query from the sales side of the database that is looking at similar data to the question posed for this query. Save the query naming it: 10 Purchases per Bean. Purchases per Supplier Query: Using the same sort of procedures described for queries 07 through 09 above, create a query that compares the Suppliers CRC purchases Production Materials (Beans) from. Save the query naming it: 11 Purchases per Supplier. Minimum Inventory Levels Query: Create a query that displays the amount that goods (Mixes) CRC sells are above or below the minimum inventory level (level at which more mix is ordered from production) on the last inventory date for each mix that CRC sells. The Mix table contains a field (MixMinLevel) that contains data on the minimum allowable inventory level before product is reordered also known as the reorder point. You need an expression that shows the amount that the quantity of mix on hand is above (or below) the reorder point for the last inventory date for each type of mix sold. Note that of the aggregate (Totals) functions, this is one called Last that will return the last (most recent) value of a series within a field. Save the query naming it: 12 Mix Minimum Inventory Levels Ordered Mix On Hand Query: These last two queries investigate a hypothetical Finished Goods and Materials inventory problem. Let s say that on November 19 CRC receives an order from its best customer for the following types and quantities to be delivered by November 23: 200 lbs. of French Roast 150 lbs. of French Roast Decaf 50 lbs. of Colombian Dark The first query needs to see if there is sufficient quantity of goods (Mix) on hand to satisfy the order. The order fulfillment process requires that the stored Mix be ground and packed and shipped to customers at least one day before it is scheduled to arrive, meaning that you want to know how much of each type of product is scheduled to be available for shipment (on hand) on the shipping date. So, you will want a query that will return the amount of each variety of coffee ordered on hand (MixOH) on 3/22/2014 (MixInvDate) the day before it is to be received by the customer. Save the query naming it: 13 Ordered Mix On Hand, 11/22/2014 Note the amount scheduled to be on hand. Is it enough to satisfy the order? Check Production Inventory Query: There would be little point in asking the question if there were enough on hand to satisfy the order; meaning that, at least one of the varieties ordered will not have a sufficient quantity in finished goods inventory to satisfy the order. Therefore, you will need to see if there is enough Bean inventory Access Database Project Page 8 of 9
scheduled to be on hand so that a batch of the coffee with the deficient quantity can be produced to satisfy the order. The production process requires one day to mix and roast the beans with the beans needing to be in materials inventory the day before production. Therefore, production needs to occur on November 21, meaning that the beans need to be in materials inventory on November 20 noting also, that if a sufficient quantity of each type of bean needed is not already scheduled to be in inventory on November 20, then CRC cannot fulfill the order because there is not sufficient time to order beans from a supplier. A production batch results in 1000 lbs. of Mix regardless of which Mix is being made or what amount of Beans are needed to make that batch. So, the next thing you will need to know is what Beans are needed to make a batch of the Mix in question. Create a query that searches the Bean to Mix table for the types and amounts of Beans needed to make a batch of the Mix in question and also searches the Bean Inventory table for the amount of Beans on hand (BeanOH). The query should also contain a field that compares the scheduled quantity on hand to the quantity needed for each Bean to quantity needed to make a batch of the Mix in question. Include the Bean to Mix Product, Bean and Bean Inventory tables in the query. Add the MixCode, BeanCode and BeanRequired fields from the Bean to Mix Product table. Add the BeanName field from the Bean table. Add the BeanInvDate and BeanOH fields from the Bean Inventory table. Add a calculated field that subtracts the Beans needed from the Beans scheduled to be on hand for each Bean Code needed to make a batch of the Mix in question. Use the aggregate (Totals) function selecting the Last function for the BeanInvDate, BeanOH and calculated field. Knowing that you are looking at the last inventory date before the production date, enter a criterion for the BeanInvDate of less than (<) 11/20/2014. You want to look only at those Beans in inventory needed to make a batch of the Mix in question so add a criterion to filter the results for only French Roast Mix. Save the query naming it: 14 Check Production Inventory. SUBMISSION INSTRUCTIONS: You are to turn in the completed Coffee_Roasting_Company.accdb database file including the queries you have created. Rename the file using your last name followed by your first name as the filename. For instance, the filename I would create would be MillerDavid.accdb (note that there is no space, comma, etc. in the file name). Note too, that if you do not have the folder option turned on to display the file extensions of known file types (that is the default setting so it is likely that this option is not on for your computer) then the.accdb file extension will not be displayed. Do not add the.accdb if you do not see file extensions when you look at the file name in Windows Explorer. Send the file as an email attachment. Attached the file to an email message and sent to your instructor at david.w.miller@csun.edu. (Remember, I do not have two email address, dwm3265@csun.edu is the same mailbox, so do not send it twice.) Be sure to enter the following as the subject with the proper course number for your class: IS 312 Database File Failure to insert a proper subject can cause your database file to be misrouted and not be scored. Email the project file by the beginning time of class on the date identified on the course schedule page. Access Database Project Page 9 of 9