Вы находитесь на странице: 1из 4

CHAPTER 18

18.5

18.6
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 InventoryInventory

Purchase Order#,
Item#

Quantity, unit cost

Sales-Inventory

Invoice#, Item#

Quantity, unit price

Receive
InventoryInventory

Receiving Report#,
Item#

Quantity, condition

18.9
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
employees 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.

Вам также может понравиться