chapter 6acg4401.wikispaces.com/file/view/rais12_sm_ch18.docx  · web viewchapter 18. implementing...

36
Accounting Information Systems CHAPTER 18 IMPLEMENTING AN REA MODEL IN A RELATIONAL DATABASE SUGGESTED ANSWERS TO DISCUSSION QUESTIONS 18.1 How would the process of generating a cash disbursements journal from the REA data model presented in Figure 18-4 and Table 18-1 differ from the process for creating a sales journal? The steps required to create a cash disbursements journal would be simpler than the process used to create a sales journal. A cash disbursements journal typically lists all of an organization’s payments to its various suppliers (payroll disbursements are usually recorded separately from payments to suppliers). The information typically recorded in a cash disbursements journal includes the date, method of payment, payment identifier (e.g., check number or EFT transaction number), payee, amount, and description of the purpose. Note that all of this information can be found in the disburse cash event table. Thus, the information necessary to produce a cash disbursements journal can be found by querying only one table. The query would be restricted to those rows for which the supplier number, a foreign key, has values (null values for the supplier number would occur because the cash disbursements were for payroll). 18.2 Why take the time to develop separate REA diagrams for each business cycle if the ultimate objective is to combine them into one integrated enterprise-wide data model? Why not just focus on the integrated model from the start? 18-1 © 2011 Pearson Education, Inc. Publishing as Prentice Hall

Upload: hoanghuong

Post on 09-Feb-2018

233 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: CHAPTER 6acg4401.wikispaces.com/file/view/rais12_SM_CH18.docx  · Web viewCHAPTER 18. IMPLEMENTING AN REA MODEL IN A RELATIONAL DATABASE. SUGGESTED ANSWERS TO DISCUSSION QUESTIONS

Accounting Information Systems

CHAPTER 18

IMPLEMENTING AN REA MODEL IN A RELATIONAL DATABASE

SUGGESTED ANSWERS TO DISCUSSION QUESTIONS

18.1 How would the process of generating a cash disbursements journal from the REA data model presented in Figure 18-4 and Table 18-1 differ from the process for creating a sales journal?

The steps required to create a cash disbursements journal would be simpler than the process used to create a sales journal. A cash disbursements journal typically lists all of an organization’s payments to its various suppliers (payroll disbursements are usually recorded separately from payments to suppliers).

The information typically recorded in a cash disbursements journal includes the date, method of payment, payment identifier (e.g., check number or EFT transaction number), payee, amount, and description of the purpose. Note that all of this information can be found in the disburse cash event table.

Thus, the information necessary to produce a cash disbursements journal can be found by querying only one table. The query would be restricted to those rows for which the supplier number, a foreign key, has values (null values for the supplier number would occur because the cash disbursements were for payroll).

18.2 Why take the time to develop separate REA diagrams for each business cycle if the ultimate objective is to combine them into one integrated enterprise-wide data model? Why not just focus on the integrated model from the start?

One way to think about it is divide and conquer. Modeling each business cycle individually makes it easier to be sure to identify all the relevant resources, events, and agents for that cycle. Once the resources, events, and agents have been identified, the relationships between these entities can be prepared.

It is also easier to assign cardinalities to relationships in REA diagrams for a single business cycle because the relationships directly represent the organization’s business policies.

The data modeler can also show the single cycle REA diagram to the employees who participate in those activities to be sure that everything of importance is included in the model and that the business policies are represented correctly. Working with a single cycle REA diagram makes this review process easier by excluding information not relevant to a particular employee.

18-1© 2011 Pearson Education, Inc. Publishing as Prentice Hall

Page 2: CHAPTER 6acg4401.wikispaces.com/file/view/rais12_SM_CH18.docx  · Web viewCHAPTER 18. IMPLEMENTING AN REA MODEL IN A RELATIONAL DATABASE. SUGGESTED ANSWERS TO DISCUSSION QUESTIONS

Ch. 18: Implementing an REA Model in a Relational Database

Once each single cycle REA diagram is correct, the data modeler can combine them using the rules explained in chapters 17 and 18. This combination process can be done without the involvement of any employees. The integrated diagram, however, needs to be discussed with management to verify accuracy and completeness.

18.3 Building separate tables for every relationship (1:1, 1:N, and M:N) does not violate any of the rules for building a well-structured database. Why then do you think that REA data modelers recommend building separate tables only for M:N relationships and using foreign keys to implement 1:1 and 1:N relationships?

To reduce the number of tables. It is more efficient to use foreign keys for relationships than to build separate tables.

This also simplifies queries because fewer tables are needed to retrieve information. Consider the task of generating a list of payments received from a particular customer. If the 1:N relationship between customers and the Receive Cash event is implemented using foreign keys, all the information needed can be found in the Receive Cash and Customer tables. The Receive Cash table would identify the date and amount of payments received from each customer; the customer table would be referenced in order to restrict the query to retrieving only those rows for which the foreign key value for customer number in the Receive Cash table matched the primary key value of a customer with a specific name in the Customer table. However, if the 1:N relationship were implemented as a separate table, then the query would also have to access the 1:N relationship table.

18.4 Assume that there exists a 1:1 relationship between the Receive Inventory and Disburse Cash events. How does the manner in which the relationship between the two events is implemented (i.e., in which table a foreign key is placed) affect the process used to record payments made to suppliers?

If the primary key of the Receive Inventory table was included as a foreign key in the Disburse Cash table, then recording payments to suppliers would involve adding a new row to the Disburse Cash table.

If, however, the primary key of the Disburse Cash table was included as a foreign key in the Receive Inventory table, then recording a payment to a supplier would involve not only creating a new row in the Disburse Cash table, but also updating the value of the check number (foreign key) column in the appropriate row of the Receive Inventory table.

18-2© 2011 Pearson Education, Inc. Publishing as Prentice Hall

Page 3: CHAPTER 6acg4401.wikispaces.com/file/view/rais12_SM_CH18.docx  · Web viewCHAPTER 18. IMPLEMENTING AN REA MODEL IN A RELATIONAL DATABASE. SUGGESTED ANSWERS TO DISCUSSION QUESTIONS

Accounting Information Systems

18.5 Refer to Figure 18-4 and Table 18-1. How would you determine the amount of cash that Fred’s Train Shop has at any point in time?

To calculate the amount of cash that Fred’s Train Shop has at a particular point in time, you would need to query three tables: Cash, Disburse Cash, and Receive Cash. The Cash table would include the cash on hand at the beginning of the current fiscal year. The Disburse Cash table includes an attribute for the amount of each disbursement made during the current fiscal year; summing this column would yield total cash outflows. Similarly, the Receive Cash table includes an attribute showing the amount of each cash receipt during the current fiscal year; summing this column would yield total cash inflows. Thus, cash on hand at particular point in time equals beginning cash on hand plus the sum of all receipts minus the sum of all disbursements.

18.6 Why does Figure 18-4 show only one cash disbursement entity if Fred’s Train Shop uses a general operating checking account for purchases of inventory, supplies, and operating expenses such as rent but also uses a separate checking account for payroll?

REA models do not represent actual physical accounts but types of accounts. Thus, even though Fred’s Train Shop uses two checking accounts, the REA displays a single entity for cash. This entity contains information about all of Fred’s individual checking accounts. Each row in the cash table for Fred’s train shop would provide information about a specific checking account. Each account would have its own primary key.

Then, when there is a cash disbursement it would be linked to the specific record or row in the cash table that represented which of the two checking accounts for Fred’s Train Shop was used to make a particular disbursement. This linking would involve using the primary key of the appropriate checking account as a foreign key in that row in the Disburse Cash event table.

18-3© 2011 Pearson Education, Inc. Publishing as Prentice Hall

Page 4: CHAPTER 6acg4401.wikispaces.com/file/view/rais12_SM_CH18.docx  · Web viewCHAPTER 18. IMPLEMENTING AN REA MODEL IN A RELATIONAL DATABASE. SUGGESTED ANSWERS TO DISCUSSION QUESTIONS

Ch. 18: Implementing an REA Model in a Relational Database

18.7 Examine Figure 18-4 and Table 18-1. Why do the Inventory, Customers, and Suppliers tables all have an attribute that contains data about the balance at the beginning of the current fiscal period?

The reason that all three entities contain an attribute that stores the beginning balance is that the related event tables typically contain information for only the current year. Thus, the beginning balance attribute represents information about prior years’ events.

This information about beginning balances is needed in order to calculate current balances at any point in time. For example, the Inventory table would show the quantity on hand for each inventory item at the beginning of the current fiscal year. The M:N table linking the Receive Inventory and Inventory tables includes an attribute for the quantity received of a specific inventory item. The M:N table linking the Inventory and Sales tables includes an attribute for the quantity sold of a particular item. Thus, the quantity on hand at a particular point in time equals the beginning quantity on hand plus the sum of all receipts of that inventory item minus the sum of all sales of that item.

The Customer and Supplier tables contain information about the beginning balances of Accounts Receivable and Accounts Payable for specific customers and suppliers, respectively. Current balances can then be computed by adding the sum of all sales to a customer (purchases from a supplier) and subtracting the sum of all payments from a customer (payments to a supplier) during the current fiscal year.

18-4© 2011 Pearson Education, Inc. Publishing as Prentice Hall

Page 5: CHAPTER 6acg4401.wikispaces.com/file/view/rais12_SM_CH18.docx  · Web viewCHAPTER 18. IMPLEMENTING AN REA MODEL IN A RELATIONAL DATABASE. SUGGESTED ANSWERS TO DISCUSSION QUESTIONS

Accounting Information Systems

SUGGESTED ANSWERS TO THE PROBLEMS

18.1 Refer to Problems 17.1 and 17.2 for information about the revenue and expenditure cycle activities for Joe’s ice-cream shop in order to draw an integrated REA diagram of both cycles.

18-5© 2011 Pearson Education, Inc. Publishing as Prentice Hall

Page 6: CHAPTER 6acg4401.wikispaces.com/file/view/rais12_SM_CH18.docx  · Web viewCHAPTER 18. IMPLEMENTING AN REA MODEL IN A RELATIONAL DATABASE. SUGGESTED ANSWERS TO DISCUSSION QUESTIONS

Ch. 18: Implementing an REA Model in a Relational Database

18.2 Develop a set of tables to implement the integrated REA diagram you developed in Problem 18.1 for Joe’s ice-cream shop in a relational database. Specify a primary key for each table, and suggest at least one other attribute that should be included in each table.

Table Primary key Other attributes foreign keys in italics

Employees Employee# Name, date hired, salary, position

Vendors Vendor# Name, address, beginning account balance

Order Inventory Purchase Order# Date, vendor#, employee#

Receive Inventory Receiving Report# Date, vendor#, employee#, purchase order#, check#

Disburse Cash Check# Employee#, Vendor#, GLAccount#, amount

Inventory Item# Description, beginning quantity on hand, list price

Cash GLAccount# Account Name, beginning balance

Sales Invoice# Date, customer#, employee#, amount

Receive Cash Remittance# Date, customer#, employee#, invoice#, GLAccount#

Inventory Item# Description, quantity on hand, reorder quantity, reorder point

Order Inventory-Inventory

PurchaseOrder#, Item#

Quantity, UnitCost

Receive Inventory-Inventory

ReceivingReport#, Item#

Quantity, condition

Sales-Inventory Invoice#, Item# Quantity, UnitPrice

18-6© 2011 Pearson Education, Inc. Publishing as Prentice Hall

Page 7: CHAPTER 6acg4401.wikispaces.com/file/view/rais12_SM_CH18.docx  · Web viewCHAPTER 18. IMPLEMENTING AN REA MODEL IN A RELATIONAL DATABASE. SUGGESTED ANSWERS TO DISCUSSION QUESTIONS

Accounting Information Systems

18.3 Refer to Problems 17.3 and 17.4 for information about Sue’s Gallery’s revenue and expenditure cycle activities in order to draw an integrated REA diagram of both cycles.

18-7© 2011 Pearson Education, Inc. Publishing as Prentice Hall

Page 8: CHAPTER 6acg4401.wikispaces.com/file/view/rais12_SM_CH18.docx  · Web viewCHAPTER 18. IMPLEMENTING AN REA MODEL IN A RELATIONAL DATABASE. SUGGESTED ANSWERS TO DISCUSSION QUESTIONS

Ch. 18: Implementing an REA Model in a Relational Database

18.4 Develop a set of tables to implement the integrated REA diagram you developed in Problem 18.3 for Sue’s Gallery in a relational database. Specify a primary key for each table, and suggest at least one other attribute that should be included in each table.

Table Primary key Other attributes foreign keys in italics

Vendor Vendor# Name, address, phone, contact, account balance

Employees Employee# Name, date hired, salary, date of birth, position

Purchases Purchase Order# Date, employee#, vendor#

Disburse Cash Check# GLAccount#, employee#, vendor#, purchase order#, date, amount

Inventory Item# Purchase order#, invoice#, cost, sales price, description

Cash GLAccount# Account name, beginning balance

Sales Invoice# Customer#, employee#, date

Receive Cash Remittance# Date, amount, employee#, customer#, invoice#, GLAccount#

Customer Customer# Name, address, beginning balance

Note: The cost and sales price are attributes of the inventory table because each unique item is only purchased once and sold once.

18-8© 2011 Pearson Education, Inc. Publishing as Prentice Hall

Page 9: CHAPTER 6acg4401.wikispaces.com/file/view/rais12_SM_CH18.docx  · Web viewCHAPTER 18. IMPLEMENTING AN REA MODEL IN A RELATIONAL DATABASE. SUGGESTED ANSWERS TO DISCUSSION QUESTIONS

Accounting Information Systems

18.5 The following tables and attributes exist in a relational database:

Table Attributes

Vendor Vendor#, name, street address, city, state

Purchases P.O.#, date, amount, vendor#, purchasing agent#

Inventory Receipts Receiving report#, date, receiving clerk#, remarks, P.O.#

Cash Disbursed Check#, date, amount

Inventory Receipts – Cash Disbursed

Check#, receiving report#, amount applied to invoice

Draw an REA diagram for this database. State any additional assumptions you need to make about cardinalities.

The solution appears on the following page. Students should be able to suggest adding the entities connected by dotted lines, even though they are not listed in the problem. Key assumptions about cardinalities include the following:

Vendors do not make partial shipments. If you assume otherwise, then the cardinality from Purchases to Inventory Receipts should be adjusted. Note that the presence of P.O. number as an attribute in the Receive Inventory table rules out the possibility that this is an M:N relationship.

The inventory in question is not unique one-of-a-kind items. If it were, the maximum cardinality from Inventory to both events would be 1.

The existence of an Inventory Receipts – Cash Disbursed table with an attribute in it suggests that this is a M:N relationship: the company can make installment payments on purchases and also runs a tab, paying periodically for all purchases made during a specified time. The amount-applied attribute informs the seller how to apply the payment.

18-9© 2011 Pearson Education, Inc. Publishing as Prentice Hall

Page 10: CHAPTER 6acg4401.wikispaces.com/file/view/rais12_SM_CH18.docx  · Web viewCHAPTER 18. IMPLEMENTING AN REA MODEL IN A RELATIONAL DATABASE. SUGGESTED ANSWERS TO DISCUSSION QUESTIONS

Ch. 18: Implementing an REA Model in a Relational Database

18-10© 2011 Pearson Education, Inc. Publishing as Prentice Hall

Page 11: CHAPTER 6acg4401.wikispaces.com/file/view/rais12_SM_CH18.docx  · Web viewCHAPTER 18. IMPLEMENTING AN REA MODEL IN A RELATIONAL DATABASE. SUGGESTED ANSWERS TO DISCUSSION QUESTIONS

Accounting Information Systems

18.6 Refer to Problems 17.8 and 17.9 for information about the revenue and expenditure cycles for the Computer Warehouse and use that information to draw an integrated REA diagram for both cycles.

18-11© 2011 Pearson Education, Inc. Publishing as Prentice Hall

Page 12: CHAPTER 6acg4401.wikispaces.com/file/view/rais12_SM_CH18.docx  · Web viewCHAPTER 18. IMPLEMENTING AN REA MODEL IN A RELATIONAL DATABASE. SUGGESTED ANSWERS TO DISCUSSION QUESTIONS

Ch. 18: Implementing an REA Model in a Relational Database

18.7 Develop a set of tables to implement the integrated REA diagram you developed in Problem 17.6 for the Computer Warehouse in a relational database. Specify a primary key for each table, and suggest at least one other attribute that should be included in each table.

Table Primary key Other attributes (foreign keys in italics)

Vendor Vendor# Name, address, phone, contact

Employees Employee# Name, date hired, salary, date of birth, position

Order Inventory Purchase Order# Date, vendor#, employee#

Receive Inventory Receiving Report# Date, vendor#, employee#, check#, purchase order#

Disburse Cash Check# Date, amount, vendor#, employee#, GLaccount#

Inventory Item# Description, beginning quantity on hand, reorder quantity, reorder point

Cash GLaccount# Account name, beginning balance

Sales Invoice# Date, employee#, customer#, remittance#

Receive Cash Remittance# Date, amount, employee#, customer#, GLaccount#

Customers Customer# Name, address, beginning balance

Order Inventory-Inventory

Purchase Order#, Item#

Quantity, unit cost

Sales-Inventory Invoice#, Item# Quantity, unit price

Receive Inventory-Inventory

Receiving Report#, Item#

Quantity, condition

18-12© 2011 Pearson Education, Inc. Publishing as Prentice Hall

Page 13: CHAPTER 6acg4401.wikispaces.com/file/view/rais12_SM_CH18.docx  · Web viewCHAPTER 18. IMPLEMENTING AN REA MODEL IN A RELATIONAL DATABASE. SUGGESTED ANSWERS TO DISCUSSION QUESTIONS

Accounting Information Systems

18.8 Explain how to calculate the total amount of Accounts Payable:

Total Accounts Payable can be calculated in five steps, as follows:

Step 1: Normally, only orders actually received are considered purchases for purposes of calculating accounts payable. Therefore, begin with a query of the Receive Inventory table (or M:N relationship table linking the Order Inventory and Receive Inventory events) to determine which orders have been received this fiscal period.

Step 2: Query the Order Inventory – Inventory table to determine the total amount purchased this fiscal period by summing the product of quantity ordered by its unit cost for those purchase orders for which there is a corresponding receipt of inventory (from step 1).

Step 3: Retrieve the total beginning balance of Accounts Payable by querying the Suppliers table and summing the beginning balance column.

Step 4: Query the Disburse Cash table to calculate the total amount paid to suppliers this fiscal period by summing the amount column for every row in which the supplier number is not null. It is important to exclude rows where the supplier number is null, as those represent other types of payments (e.g., payroll).

Step 5: Total Accounts Payable = Answer to Query 2 + Answer to Query 3 – Answer to Query 4.

18-13© 2011 Pearson Education, Inc. Publishing as Prentice Hall

Page 14: CHAPTER 6acg4401.wikispaces.com/file/view/rais12_SM_CH18.docx  · Web viewCHAPTER 18. IMPLEMENTING AN REA MODEL IN A RELATIONAL DATABASE. SUGGESTED ANSWERS TO DISCUSSION QUESTIONS

Ch. 18: Implementing an REA Model in a Relational Database

18.9 Refer to Figure 18.4 and Table 18-1 to write the query logic needed to answer the following questions. (Optional: If requested by your instructor, write your queries in SQL or a Query-By-Example graphical interface.) Some answers may require more than one query—try to write the most efficient queries possible.

a. Accounts payable for all suppliers in Arizona

Step 1: Normally, only orders actually received are considered purchases for purposes of calculating accounts payable. Therefore, begin with a query of the Receive Inventory table (or M:N relationship table linking the Order Inventory and Receive Inventory events) and the Supplier table to determine which orders have been received this fiscal period. The supplier table is needed in order to restrict the result to only those suppliers located in Arizona.

Step 2: Query the Order Inventory – Inventory table to determine the total amount purchased this fiscal period by summing the product of quantity ordered by its unit cost for those purchase orders for which there is a corresponding receipt of inventory (from step 1).

Step 3: Retrieve the total beginning balance of Accounts Payable by querying the Suppliers table and summing the beginning balance column, restricting the sum operation to only those suppliers located in Arizona.

Step 4: Query the Disburse Cash and Supplier tables to calculate the total amount paid to suppliers located in Arizona this fiscal period by summing the amount column for every row in the Disburse Cash table for which the supplier number equals the primary key of a row in the Supplier table that has a value of Arizona in its address column.

Step 5: Total Accounts Payable to Arizona Suppliers = Answer to Query 2 + Answer to Query 3 – Answer to Query 4.

b. Total amount of sales to a customer named Smith

Step 1: Identify all sales to Smith by writing a query that joins the Sales and Customer tables, where the value of the customer# in the Sales table equals the primary key in the row of the Customer table where the name = Smith.

Step 2: Sum the product of quantity sold times unit price in the M:N Sales-Inventory table for only those rows with sales invoice numbers identified in step 1.

18-14© 2011 Pearson Education, Inc. Publishing as Prentice Hall

Page 15: CHAPTER 6acg4401.wikispaces.com/file/view/rais12_SM_CH18.docx  · Web viewCHAPTER 18. IMPLEMENTING AN REA MODEL IN A RELATIONAL DATABASE. SUGGESTED ANSWERS TO DISCUSSION QUESTIONS

Accounting Information Systems

c. Total wage expense

Pay rates are likely to differ across employees. Therefore, calculate total wage expense by summing the wage expense for each employ, as follows:

Step 1: Query the Time Worked table to sum the total hours worked, grouped by employee number.

Step 2: Query the table produced in step 1 and the Employee table to calculate the total wages earned by each employee (by multiplying total hours worked times that employee’s pay rate).

Step 3: Sum the total amounts in the table produced in step 2.

d. Total wages payable

Total wages payable equals wages earned but not yet paid. Thus, use the same procedure as used to calculate total wage expense, except restrict step 1 to only those rows in the Time Worked table for which the paycheck# column is null. e. Net increase (decrease) in quantity-on-hand for a particular inventory item

Step 1: Write a query to sum the quantity received in the M:N relationship table linking the Receive Inventory event and the Inventory table for only those rows with a particular value in the item# column.

Step 2: Write a query to sum the quantity sold in the M:N Sales-Inventory relationship table for only those rows with the same item# as used in step 1.

Step 3: Net change in quantity-on-hand for that item = Query 1 – Query 2.

f. The proportion of sales made to walk-in customers (i.e., no order)

Step 1: Write a query to calculate total sales by summing the product of quantity sold times unit price in the Sales-Inventory M:N relationship table.

Step 2: Write a query to identify all sales to walk-in customers by listing all sales invoices in the Sales table for which the order number column is null.

Step 3: Repeat step 1, but restrict the calculation to only those rows in the Sales-Inventory table for which the sales invoice number appeared in the step 2 query.

Step 4: Divide query 3 by query 1.

18-15© 2011 Pearson Education, Inc. Publishing as Prentice Hall

Page 16: CHAPTER 6acg4401.wikispaces.com/file/view/rais12_SM_CH18.docx  · Web viewCHAPTER 18. IMPLEMENTING AN REA MODEL IN A RELATIONAL DATABASE. SUGGESTED ANSWERS TO DISCUSSION QUESTIONS

Ch. 18: Implementing an REA Model in a Relational Database

g. The salesperson who made the largest amount of sales in October

Step 1: Write a query to calculate total sales by summing the product of quantity sold times unit price in the Sales-Inventory M:N relationship table.

Step 2: Write a query to identify all sales to walk-in customers by listing all sales invoices in the Sales table for which the order number column is null.

Step 3: Repeat step 1, but restrict the calculation to only those rows in the Sales-Inventory table for which the sales invoice number appeared in the step 2 query.

Step 4: Divide query 3 by query 1.

h. The salesperson who made the most sales in October

Step 1: Write a query to identify all rows in the Sales table that occurred in October.Step 2: Write a query that counts the number of rows in the response to query 1, grouped

by employee number.Step 3: Write a query that identifies the employee number in query 2 that has the

maximum value in the count column.Step 4: Write a query that joins the result of query 3 with the employee table to display

both the employee number and name.

i. The most popular item, in terms of total units sold

Step 1: Write a query against the M:N Sales-Inventory relationship table that sums the quantity sold column, grouped by product number.

Step 2: Write a query against the table resulting from query 1, that identifies the item number with the maximum value in the total quantity sold column.

Step 3: Write a query that joins the result of query 2 with the inventory table to display both the item# and its description.

18-16© 2011 Pearson Education, Inc. Publishing as Prentice Hall

Page 17: CHAPTER 6acg4401.wikispaces.com/file/view/rais12_SM_CH18.docx  · Web viewCHAPTER 18. IMPLEMENTING AN REA MODEL IN A RELATIONAL DATABASE. SUGGESTED ANSWERS TO DISCUSSION QUESTIONS

Accounting Information Systems

18.10 Refer to Problem 17.10 and develop a set of tables to implement the REA diagram you developed for Stan’s Southern Barbeque Supply Store. Identify the primary and foreign keys for each table, and don’t forget to address any M:N relationships.

Table Primary key Foreign Keys Other attributes

Order Inventory Purchase Order#

Employee#, Vendor#, Receiving Report#

Date

Receive Inventory

Receiving Report#

Vendor#, Employee#

Date, vendor invoice #

Disburse Cash Check# Vendor#, Employee#, GLAccount#

Date, amount, description

Cash GLAccount# Balance, beginning balance

Inventory Item# Description, beginning quantity on hand, reorder quantity, reorder point

Employee Employee# Name, hire date, position, payrate

Vendor Vendor# Name, address, contact, beginning account balance, performance rating

Order Inventory- Inventory

Purchase Order#, Item#

Quantity, unit cost

Receive Inventory-Inventory

Receiving Report#, Item#

Quantity, condition

Receive Inventory-Cash Disbursement

Receiving Report#, Check#

Amount applied

18-17© 2011 Pearson Education, Inc. Publishing as Prentice Hall

Page 18: CHAPTER 6acg4401.wikispaces.com/file/view/rais12_SM_CH18.docx  · Web viewCHAPTER 18. IMPLEMENTING AN REA MODEL IN A RELATIONAL DATABASE. SUGGESTED ANSWERS TO DISCUSSION QUESTIONS

Ch. 18: Implementing an REA Model in a Relational Database

SUGGESTED ANSWERS TO THE CASES

18.1 The specific solution will vary depending upon the DBMS and REA data model used. Therefore, we present only the query logic here for the model depicted in Figure 18.4.

1. Calculate total Accounts Receivable.

a. Calculate beginning Accounts Receivable by summing the beginning balance attribute in the Customer table.

b. Calculate total new Sales this fiscal period by summing the product of quantity sold times unit price from the Sales – Inventory M:N relationship table.

c. Calculate total cash received from customers by summing amount received column in the Receive Cash table.

d. Total Accounts Receivable = Query A + Query B – Query C

2. Calculate Accounts Receivable for a specific customer.

This requires a similar set of queries as used to calculate total Accounts Receivable:

a. Calculate beginning Accounts Receivable by summing the beginning balance attribute in the Customer table for the customer of interest.

b. Select only those rows in the Sales table that represent sales to the customer of interest (i.e., those rows in the Sales table which have a value in the Customer# foreign key column equal to the Customer# of the particular customer of interest).

c. Calculate total new Sales this fiscal period by summing the product of quantity sold times unit price from the Sales – Inventory M:N relationship table for only those rows which have an invoice number in the set of invoice numbers from query b.

d. Calculate total cash received from customers by summing amount received column in the Receive Cash table for only those rows which have a value in the Customer# foreign key column equal to the Customer# of the particular customer of interest.

e. Total Accounts Receivable = Query A + Query C – Query D.

18-18© 2011 Pearson Education, Inc. Publishing as Prentice Hall

Page 19: CHAPTER 6acg4401.wikispaces.com/file/view/rais12_SM_CH18.docx  · Web viewCHAPTER 18. IMPLEMENTING AN REA MODEL IN A RELATIONAL DATABASE. SUGGESTED ANSWERS TO DISCUSSION QUESTIONS

Accounting Information Systems

3. Create a sales invoice form that references the appropriate tables and inputs data about attributes into the proper tables.

The syntax for doing this will vary depending upon the DBMS used. Solutions should be tested to ensure that the form adds new rows to the following tables:

Sales

Sales-Inventory

It will also need to reference the Customer and Inventory tables to identify relevant information (shipping and billing addresses, item description, etc.).

4. Calculate as many financial statement items as possible from the data model you implement.

Income Statement items derivable from Figure 18.4:

Only Sales and Wage Expense can be definitively calculated; cost of goods sold requires making assumptions about inventory cost/valuation method (FIFO, LIFO, weighted average, specific identification).

Sales

Sum the product of quantity sold times unit price for all rows in the M:N Sales-Inventory relationship table

Wage expense

Step 1: Query the Time Worked table to sum the total hours worked, grouped by employee number.

Step 2: Query the table produced in step 1 and the Employee table to calculate the total wages earned by each employee (by multiplying total hours worked times that employee’s pay rate).

Step 3: Sum the total amounts in the table produced in step 2.

18-19© 2011 Pearson Education, Inc. Publishing as Prentice Hall

Page 20: CHAPTER 6acg4401.wikispaces.com/file/view/rais12_SM_CH18.docx  · Web viewCHAPTER 18. IMPLEMENTING AN REA MODEL IN A RELATIONAL DATABASE. SUGGESTED ANSWERS TO DISCUSSION QUESTIONS

Ch. 18: Implementing an REA Model in a Relational Database

Balance Sheet items derivable from Figure 18.4:

Only Cash, Accounts Receivable, Accounts Payable, and Wages Payable can be definitively calculated. Inventory valuation requires an assumption about inventory method (FIFO, LIFO, weighted average, specific identification).

Cash

Step 1: Calculate the beginning balance of cash by summing the amount column in the Cash table.

Step 2: Calculate total cash receipts by summing the amount column in the Receive Cash table.

Step 3: Calculate total cash disbursements by summing the amount column in the Disburse Cash table.

Step 4: Ending Cash Balance = Answer to Query 1 + Answer to Query 2 – Answer to Query 3.

Accounts Receivable

a. Calculate beginning Accounts Receivable by summing the beginning balance attribute in the Customer table.

b. Calculate total new Sales this fiscal period by summing the product of quantity sold times unit price from the Sales – Inventory M:N relationship table.

c. Calculate total cash received from customers by summing amount received column in the Receive Cash table.

d. Total Accounts Receivable = Query A + Query B – Query C

18-20© 2011 Pearson Education, Inc. Publishing as Prentice Hall

Page 21: CHAPTER 6acg4401.wikispaces.com/file/view/rais12_SM_CH18.docx  · Web viewCHAPTER 18. IMPLEMENTING AN REA MODEL IN A RELATIONAL DATABASE. SUGGESTED ANSWERS TO DISCUSSION QUESTIONS

Accounting Information Systems

Accounts Payable

Step 1: Normally, only orders actually received are considered purchases for purposes of calculating accounts payable. Therefore, begin with a query of the Receive Inventory table (or M:N relationship table linking the Order Inventory and Receive Inventory events) to determine which orders have been received this fiscal period.

Step 2: Query the Order Inventory – Inventory table to determine the total amount purchased this fiscal period by summing the product of quantity ordered by its unit cost for those purchase orders for which there is a corresponding receipt of inventory (from step 1).

Step 3: Retrieve the total beginning balance of Accounts Payable by querying the Suppliers table and summing the beginning balance column.

Step 4: Query the Disburse Cash table to calculate the total amount paid to suppliers this fiscal period by summing the amount column for every row in which the supplier number is not null. It is important to exclude rows where the supplier number is null, as those represent other types of payments (e.g., payroll).

Step 5: Total Accounts Payable = Answer to Query 2 + Answer to Query 3 – Answer to Query 4.

Wages Payable

Step 1: Query the Time Worked table to sum the total hours worked, grouped by employee number, restricted to only those rows for which the check number column is null.

Step 2: Query the table produced in step 1 and the Employee table to calculate the total wages earned by each employee (by multiplying total hours worked times that employee’s pay rate).

Step 3: Sum the total amounts column in the table produced in step 2.

18-21© 2011 Pearson Education, Inc. Publishing as Prentice Hall

Page 22: CHAPTER 6acg4401.wikispaces.com/file/view/rais12_SM_CH18.docx  · Web viewCHAPTER 18. IMPLEMENTING AN REA MODEL IN A RELATIONAL DATABASE. SUGGESTED ANSWERS TO DISCUSSION QUESTIONS

Ch. 18: Implementing an REA Model in a Relational Database

5. Design appropriate input controls for the sales invoice form created in step 3.

The syntax required will vary depending upon the DBMS used. Students should be encouraged to review material from chapter 10 to identify appropriate input controls. Solutions should include the following:

1. Auto-number the sales invoice to prevent creating duplicate or null primary keys.

2. Validity check on item numbers.

3. Sign check on quantity sold and price fields.

4. Completeness checks on customer information (billing and shipping address) – this information should ideally be automatically populated upon entering the customer number.

5. Completeness checks on inventory information (description, list price, etc.) – this information should ideally be automatically populated upon entering the item number.

6. Validity check on sales date (check against the current system date).

18-22© 2011 Pearson Education, Inc. Publishing as Prentice Hall