Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Please write query 7. List all orders with values greater than a specific value

ID: 3573877 • Letter: P

Question

Please write query

7. List all orders with values greater than a specific value (tsales). Write SQL code to create a
stored procedure and show the result when tsales=$99 (the codes for execute the procedure query
is: SET @p0=’99’; CALL procedure_name (@p0))

hwquery New customer Columns New CITY CUST ID a CUST NAME STATE I STREET LI ZIPCODE Indexes T- orderline Columns New order id product id quantity Indexes ordertable -Il Columns New cust id order date order id Indexes product Column New product id product name product price Indexes

Explanation / Answer

#7

create procedure DisplayOrders(@p0 varchar)

AS

BEGIN

select oprder_id

from orderline as A join product as B

on A.product_id = B.product_id

where A.quatity*B.product_price > @p0

END

# to execute

set @p0 = '99';

exec DisplayOrders(@p0);