-- test_order_amount.sql

INSERT INTO order_header
  (invoice_number, store_number, customer_id, order_date)
  (SELECT MAX(invoice_number) + 1, 7, 9994, SYSDATE
     FROM order_header)
/
INSERT INTO order_item
  (invoice_number, product_id, quantity, discount)
  (SELECT MAX(invoice_number), 'CHYE0000003', 2, .1
     FROM order_header)
/
UPDATE order_item
   SET quantity = 3
 WHERE invoice_number = (SELECT MAX(invoice_number) 
                           FROM order_header)
   AND product_id = 'CHYE0000003'
/
SELECT amount_due
  FROM order_header
 WHERE invoice_number = (SELECT MAX(invoice_number)
                           FROM order_header)
/
