Download presentation
Presentation is loading. Please wait.
1
Accounting Information Systems: A Business Process Approach Chapter Six: Understanding and Designing Queries and Reports
2
Exhibits: 6.2, 6.3 Tables: 6.1 - 6.10
3
Exhibit 6.2 Query Design Template TableTable 1Table 2Table 3 1. What attributes do users require in the query output? 2. What criteria will be used to generate the output? What attributes will be used in the criteria? 3. What foreign keys link the information in a table to the primary keys of other tables in the query?
4
Exhibit 6.3 Report Design Template: Content and Organization Title on Report Header Type of Report Source by TableTable 1Table 2Table 3 1. Attributes displayed on report 2a. Attributes not displayed on report, but necessary for a calculation 2b. Criteria for selection of records in table 3. Foreign keys that link this table to the others used in the report (if any) Content PlacementAttribute Names* and Calculations** Used Report header Report details*** Order by Report footer For grouped detail reports: Group by Group header Group detail Order detail by roup footer Formulas for calculations: *Enter the attribute name in the row for each section where it is reported. Precede each attribute name with an abbreviation of the source table’s name. **Indicate the label for the calculation in the row for the section where it is to be displayed, and show the formula for the calculation on the bottom row of the template. ***For grouped detail reports, the report details sections consist of data about each group. For such reports, we specify what appears in the report details area by completing the information in the “For grouped detail reports” section of this template.
5
Table 6.1 Summary of ELERBE’s Database Design and Sample Data Design of Tables Primary Table NameKeyForeign KeyOther Attributes InventoryISBNAuthor, Title, Price, Quantity_On_Hand, Quantity_Allocated CustomerCustomer#Name, Address, Contact_Person, Phone OrderOrder#Customer# (links toOrder_Date Customer Table) Order_DetailOrder#,Order# (links to Order Table)Quantity ISBN*ISBN (links to Inventory Table) *compound primary key Inventory TableQuantity_ ISBNAuthorTitlePriceOn_HandAllocated 0-256-12596-7BarnesIntroduction to Business$78.354,000300 0-127-35124-8CromwellBuilding Database Applications$65.003,500 0 0-135-22456-7CromwellManagement Information $68.005,000 50 Systems 0-146-18976-4JohnsonPrinciples of Accounting$70.008,000260 0-145-21687-7PlattIntroduction to E-commerce$72.005,000 40 0-235-624-6RosenbergHTML and Javascript Primer$45.006,000 0
6
Table 6.1 Summary of ELERBE’s Database Design and Sample Data (Concluded) Customer Table Customer#NameAddressContact_PersonPhone 3450Brownsville C.C.Brownsville, TXSmith956-555-0531 3451Educate, Inc.Fairhaven, MACosta508-888-4531 3452Bunker Hill C.C.Bunker Hill, MALaFrank617-888-8510 Order_Detail Table Order#ISBNQuantity 01000110-256-12596-7200 01000110-146-18976-4150 01000120-135-22456-7 50 01000120-146-18976-4 75 01000120-145-21687-7 40 01000130-146-18976-4 35 01000130-256-12596-7100 Order Table Order#Order_DateCustomer# 010001105/11/20033451 010001205/15/20033451 010001305/16/20033450
7
Table 6.2 Query Design for QUERY A QUERY A: List of all publications by Cromwell Inventory Table 1. What attributes do users require in the queryISBN, Author, Title output? 2. What criteria will be used to generate the output?Author=“Cromwell” What attributes will be used in the criteria?
8
Table 6.3 Results of Query A ISBNTitleAuthor 0-127-35124-8Building Database ApplicationsCromwell 0-135-22456-7Management Information SystemsCromwell Note: For the full Inventory Table, see Table 6.1 on page 244.
9
Table 6.4 Query Design for QUERY B QUERY B: List of all orders on 05/15/2003 Order Table 1. What attributes do users require in the queryOrder#, Order_Date, output?Customer# 2. What criteria will be used to generate the output?Order_Date5#05/15/2003# What attributes will be used in the criteria?
10
Table 6.5 Panel A: Query Design for QUERY C The marketing manager wants a report that shows all orders for a book identified as ISBN 0-127-35124-8 during the year 2002. The information needed includes Name, Address, Contact_Person, Phone, and Quantity. TableOrderOrder_DetailCustomer 1. What attributes doQuantityName, Address, users require in theContact_Person, query output?Phone 2. What criteria will beOrder_Date.#12/31/2001#ISBN=0-127-35124-8 used to generate theand Order_Date,#01/01/2003# output? What attributes will be used in the criteria? 3. What foreign keys linkCustomer# (to identifyOrder# (to link to the the information in aappropriate customer)Order records) table to the primary keys of other tables in the query?
11
Table 6.5 (Continued) Panel B: Query Design for QUERY D The marketing manager wants a report that shows all orders for a book identified as ISBN 0-127-35124-8, regardless of year of order. The information needed includes Name, Address, Contact_Person, Phone, and Quantity. TableOrderOrder_DetailCustomer 1. What attributes doQuantityName, Address, users require in the Contact_Person, query output?Phone 2. What criteria will beISBN=0-127-35124-8 used to generate the output? What attributes will be used in the criteria? 3. What foreign keysCustomer# (to identifyOrder# (to link to link the informationappropriate customer)the Order records) in a table to the primary keys of other tables in the query?
12
Table 6.5 (Concluded) Panel C: Query Design for QUERY E The marketing manager wants a report that shows all orders for a book with the title, “Building Database Applications,” during the year 2002. The manager does not know the ISBN for that book. The information needed is Name, Address, Contact_Person, Phone, and Quantity. TableOrderOrder_DetailInventoryCustomer 1. What attributesQuantityName, Address, do users requireContact_Person, in the queryPhone output? 2. What criteria willOrder_Date.#12/31/2001#Title = be used to gener-and “Building ate the output?Order_Date,#01/01/2003# Database What attributes Applications” will be used in the criteria? 3. What foreign keysCustomer# (toOrder# (to link to link the informa-identify appropriatethe Order records) tion in a table tocustomer)ISBN (to link to the the primary keysInventory record) of other tables in the query?
13
Table 6.6 Fairhaven Convenience Store: Tables with Sample Data Manager Table SSNLast_NameFirst_NameAddressFile_Status Exemptions 105-50-1234GreenCindyPlainville, MISingle1 154-08-8304OlaPatrickNewport, MIMarried3 012-50-1237BarleyThomasWareham, MISingle1 023-45-8921MelloJayParis, MIMarried4 Inventory Table Product#DescriptionSupplierReorder_PointBegin_OH 101Regular gasShell100010000 102Engine oilMobil50 100 103AntifreezeDow30 10 Sale Table Sale#SSNDateSales_Tax 201105-50-123412/15/03$0.85 202105-50-123412/15/03$1.45 203154-08-830412/15/03$1.00 204154-08-830412/16/03$0.15
14
Table 6.6 Fairhaven Convenience Store: Tables with Sample Data (Concluded) Sale_Detail Table Sale#Product#Quantity_SoldPrice 20110113$2.00 201103 1$1.50 20210114$1.50 202102 2$3.00 20310110$2.00 204102 1$3.00 Deposit Table Deposit#DateAmount 80112/15/03$77.80 Note: In the examples in this chapter, we will assume that the quantity on hand is updated only periodically. Thus, the Quantity_On_Hand field in the Inventory Table has been replaced by the Begin_OH field. The Begin_OH represents the quantity on hand at the beginning of the period.
15
Table 6.7 Report Content for the Grouped Detailed Status Report in Figure 6.6A Title on Report HeaderDetailed Inventory Status Report Type of ReportGrouped detail status report Source by TableSale (S)Sale_Detail (SD)Inventory (I) 1. Attributes displayedDateSale#,Product#, on reportQuantity_SoldDescription, Supplier, Begin_OH 2a. Attributes not displayed on report, but necessary for a calculation 2b. Criteria for selection ofN/AN/AN/A records in table 3. Foreign keys that link thisProduct#, table to the others usedSale# in the report (if any)
16
Table 6.8 Report Organization for Grouped Detailed Status Report in Figure 6.6A Attribute Names Content Placementand Calculations* Used Report headerNo attributes or calculations DetailsSee group details Order byI: Product# Report footerN/A For grouped detail reports: Group bySD: Product# Group headerI: Product#, Description, Supplier, Begin_OH Group detailSD: Sale#, Quantity_Sold; S: Date Order detail bySD: Sale# Group footerCurrent_Quantity_On_Hand* *Formulas for calculations: Current_Quantity_On_Hand = Begin_OH - Sum (Quantity_Sold) I = Inventory Table; SD = Sales_Detail Table; S = Sales Table
17
Table 6.9 Sample Data for H & J Tax Preparation Service Services Table Year-to-Date Service#Service_DescriptionFeeRevenues 1040Federal Individual Income Tax Form 1040 (long form)$100$120,000 Sch-A1040 Schedule A (itemized deductions)$50$ 51,000 Sch-B1040 Schedule B (interest & dividend earnings)$50 $ 53,300 Sch-C1040 Schedule C (sole proprietorship)$110 $ 84,000 StateState Income Tax Return$80 $ 81,000 CorpCorporate Income Tax$30 (per hr.) $103,000 Client Table Client#Client_NameAddressTelephoneBeg_Bal 1001Robert Barton242 Greene St., St. Louis, MO314-222-3333$0 1002Donna Brown123 Walnut St., St. Louis, MO314-541-3322$0 1003Sue Conrad565 Lakeside, St. Louis, MO314-541-6785$0 Service_Request Table Request#Client#Accountant#Date 1041001405-60-223402/12/03 1051003405-60-223402/15/03 1061002512-50-123602/16/03
18
Table 6.9 Sample Data for H & J Tax Preparation Service (Concluded) Accountant Table Accountant#Accountant_Name 405-60-2234Jane Smith 512-50-1236Michael Speer Service_Request_Detail Table Request#Service#Fee 1041040$100 104Sch-A$ 50 104Sch-B$ 50 104State$ 80 1051040$100 105State$ 80 1061040$100 106Sch-A$ 50 106Sch-B$ 50 106Sch-C$110 106State$ 80 Invoice Table Invoice#Request#Invoice_DateAmount 30510402/13/03$280 30610602/22/03$390 30710502/23/03$180
19
Table 6.10 Grouped Detail Status Report Content and Organization Title on Report HeaderDetailed Inventory Status Report Type of ReportGrouped detail status report Source by TableSale (S)Sale_Detail (SD)Inventory (I) 1. Attributes displayedDateSale#,Product#, Descrip- on reportQuantity_Soldtion, Supplier, Begin_OH 2a. Attributes not displayed on report, but necessary for a calculation 2b. Criteria for selection of records in table 3. Foreign keys that link thisProduct# table to the others usedSale# in the report (if any)
20
Table 6.10 Grouped Detail Status Report (Concluded) Content PlacementAttribute Names and Calculations* Used Report headerNo attributes or calculations Report detailsSee group details Order byProduct# group Report footerN/A For grouped detail reports: Group byI: Product# Group headerI: Product#, Description, Supplier, Begin_OH Group detailSD: Sale#, Quantity_Sold S: Date Order detail bySD: Sale# Group footerCurrent_Quantity_On_Hand* *Formulas for calculations: Current_Quantity_On_Hand = Begin_OH - Sum (Quantity_Sold) for a particular product
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.