Question: Code a function named Get_balance_due that accepts order_id and returns balance due. Include the following test statement in your script file. SELECT First_name, Last_name, get_balance_due(orders.order_id)

  1. Code a function named Get_balance_due that accepts order_id and returns balance due. Include the following test statement in your script file.

SELECT First_name, Last_name, get_balance_due(orders.order_id) FROM customers, Orders, order_lines WHERE customers.customer_id= orders.customer_id and orders.order_id=order_lines.order_id and To_Char (order_date, 'mm/dd/yyyy') = 09/30/2002' Group By First_name, Last_name, get_balance_due(orders.order_id);

  1. Create a trigger named Check_Availability. The trigger raises an application error when a product is out of stock or not enough to fulfil an order. It should display a message on the estimated date when the product will be available (use expected delivery date). Include the following test statement in your script file:

Insert Into order_lines values (388,1023,100,20,2,160);

its in sql

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!