149k views
4 votes
Suppose that you are a manufacturer of product BCDE, which is composed of parts B, C,D and E. Each time a new product BCDE is created, it must be added to the product inventory, using the PROD_QOH in a table named PRODUCT. Also, each time the product is created, the parts inventory, using PART_QOH in a table named PART, must be reduced by one each of parts B, C,D and E. The sample database contents are shown below

TABLE NAME: PRODUCT TABLE NAME: PART
PROD_CODE PROD_QOH PART_CODE PART_QOH
BCDE 1,205 B 98
C 549
D 117
E 28

How many database requests can you identify for an inventory update for both

User NPn
by
8.6k points

1 Answer

4 votes

Final answer:

For product BCDE, five database requests are needed for inventory updates: one to increment PROD_QOH in the PRODUCT table, and four to decrement PART_QOH for parts B, C, D, and E in the PART table.

Step-by-step explanation:

When creating a new product BCDE, it's essential to update both the product inventory and the parts inventory. In the context provided, updating will require a series of database requests. First, you would need to increment the PROD_QOH value for product BCDE in the PRODUCT table. Concurrently, you have to decrement the PART_QOH for each part (B, C, D, and E) in the PART table.

For an inventory update, a total of five database requests can be identified:

  • Update the quantity on hand (PROD_QOH) for product BCDE in the PRODUCT table, increasing it by one unit.
  • Update the quantity on hand (PART_QOH) for part B in the PART table, decreasing it by one unit.
  • Update the quantity on hand (PART_QOH) for part C in the PART table, decreasing it by one unit.
  • Update the quantity on hand (PART_QOH) for part D in the PART table, decreasing it by one unit.
  • Update the quantity on hand (PART_QOH) for part E in the PART table, decreasing it by one unit.
User Alexander Solonik
by
8.7k points