Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

How Do I Use A Database Research Tools You Can Use

Authors: Laura La Bella

1st Edition

1622753763, 978-1622753765

More Books

Students also viewed these Databases questions