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)
-
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started