Accounting Information Systems

CHAPTER 18

IMPLEMENTING AN REA MODEL IN A RELATIONAL DATABASE

SUGGESTED ANSWERS TO DISCUSSION QUESTIONS

18.1How would the process of generating a cash disbursements journal from theREA data model presented in Figure 18-4 and Table 18-1 differ from the process forcreating 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.2Why take the time to develop separate REA diagrams for each business cycle if the ultimate objective is to combine them into one integrated enterprise-widedata 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.

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.

16

17

18

18.3 Building separate tables for every relationship (1:1, 1:N, and M:N) does notviolate any of the rules for building a well-structured database. Why then do you thinkthat REA data modelers recommend building separate tables only for M:N relationshipsand 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 andDisburse Cash events. How does the manner in which the relationship between the twoevents is implemented (i.e., in which table a foreign key is placed) affect the processused 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.5 Refer to Figure 18-4 and Table 18-1. How would you determine the amount ofcash 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 TrainShop uses a general operating checking account for purchases of inventory, supplies, andoperating 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.7 Examine Figure 18-4 and Table 18-1. Why do the Inventory, Customers, andSuppliers tables all have an attribute that contains data about the balance at the beginningof 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.

SUGGESTED ANSWERS TO THE PROBLEMS

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

18.2Developa 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 primarykey foreach table, and suggest at least one other attribute that should be included in each table.

Table /

Primary key

/ Other attributesforeign 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
OrderInventory-Inventory / PurchaseOrder#, Item# / Quantity, UnitCost
ReceiveInventory-Inventory / ReceivingReport#, Item# / Quantity, condition
Sales-Inventory / Invoice#, Item# / Quantity, UnitPrice

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

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

Table /

Primary key

/ Other attributesforeign 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-1

© 2011 Pearson Education, Inc. Publishing as Prentice Hall

Accounting Information Systems

18.5The 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 tomake 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-1

© 2011 Pearson Education, Inc. Publishing as Prentice Hall

Accounting Information Systems

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

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 aprimary key for each table, and suggest at least one other attribute that should beincluded 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
OrderInventory / PurchaseOrder# / Date, vendor#, employee#
ReceiveInventory / Receiving Report# / Date, vendor#, employee#, check#, purchaseorder#
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
OrderInventory-Inventory / PurchaseOrder#, Item# / Quantity, unit cost
Sales-Inventory / Invoice#, Item# / Quantity, unit price
ReceiveInventory-Inventory / Receiving Report#, Item# / Quantity, condition

18.8Explain 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.9 Refer to Figure 18.4 and Table 18-1 to write the query logic needed to answerthe following questions. (Optional: If requested by your instructor, write your queriesin SQL or a Query-By-Example graphical interface.) Some answers may require morethan one query—try to write the most efficient queries possible.

  1. 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.

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.