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);

Order_Lines Table (Order_ID, Product_ID, Actual_Price, Discount, Quantity, Total_Amount);

Order (Order_ID, Order_Date, Customer_ID, Employee_ID, Ship_Date, Shipment_Method_ID, Paid, Order-Status, Notes);

Customers (Sales_Rep_ID, Customer_ID, Customer_SSN, First_Name, Last_Name, Addr_Line, City, State, Zip_Code, Phone, Email, CC_Number, Credit_Limit, Gender, Status, Comments);

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!