1. If there are items in the shopping cart for Newton, a new row is inserted in the ORDERS table. Increment the order ID of the new row accordingly.
2. For each item in the SHOPPING_CART_ITEMS that is in Newton’s buying list (not in the wish list) do the following:
a. A corresponding item is created in the ORDER_ITEMS table. All these newly added order items refer to the order created in step 1.
b. The quantity in INVENTORY_ITEMS table is updated accordingly
3. All the items in the SHOPPING_CART_ITEMS table that were just ordered are removed
Add a few output lines using DBMS_OUTPUT.PUT_LINE function to indicate how your program progresses through the list of actions.
This material may consist of step-by-step explanations on how to solve a problem or examples of proper writing, including the use of citations, references, bibliographies, and formatting. This material is made available for the sole purpose of studying and learning - misuse is strictly forbidden.set serveroutput on
-- we will iterate over rows which are got from below query
cursor item_cur is
select si.PRODID, si.QUANTITY
from SHOPPING_CART_ITEMS si inner join CUSTOMERS c
on si.CUSTID = c.ID where c.NAME like '%Newton';