a. Please help me to make a stored procedure, sp_SalesInfo , using the Sales.SalesOrderHeader and SalesOrderDetail tables.
Question:
a. Please help me to make a stored procedure, sp_SalesInfo, using the Sales.SalesOrderHeader and SalesOrderDetail tables. The SalesOrderDetailID column in the table SalesOrderDetail shows each item in one sales order. The sp_SalesInfo shows the sales order ID, subtotal, order date, and average LineTotal for each sales order, only if the subtotal is at least the amount to be entered by the users when executing the procedure.
Show the output in the ascending order of the sales order ID.
When you make a parameter for the subtotal amount, use the data type numeric(20,4).
Use the nested query for this procedure. Make sure you create stored procedures in your own database. If you want to alter the procedure, you can use 'alter procedure'
b. Execute it using the subtotal amount of 150,000.
With explanations please, I'm really trying to understand what's happening and clearly am missing something. And with outputs so I can compare them.
Intermediate Accounting
ISBN: 978-0470161012
9th Canadian Edition, Volume 2
Authors: Donald E. Kieso, Jerry J. Weygandt, Terry D. Warfield.