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