Question: SQL Code Troubleshooting Given the following code, troubleshoot the errors by answering the questions below. CREATE PROCEDURE RepSales ( IN repid int, in startdate varchar

SQL Code Troubleshooting
Given the following code, troubleshoot the errors by answering the questions below.
CREATE PROCEDURE RepSales (IN repid int, in startdate varchar(20),out enddate varchar(20))
BEGIN
#Get all sales by Month and user with bonus function
Select monthname(purchase_date) MonthName, Rep,
sum(revenue) as Revenue,
salesbonus(sum(revenue)) as bonus from vwRepSales
where purchase_date between startdate and enddate
and idrep=ifnull(repid,idrep);
END$$
DELIMITER ;
Question 45(2 points)
Which statement allows the stored procedure to return the entire result set if nothing is provided for the repid parameter.
Question 45 options:
idrep=ifnull(repid,idrep)
idrep=''
idrep=ifnull(repid,'')
idrep is not null;

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!