Write a stored procedure that accepts one input argument which defines the status of event manager to either ‘Senior’ or ‘Junior’. The input argument states the minimum number of engagements handled by the event manager in order to be a senior. For instance, if 3 is given as the input argument, event managers who have handled at least 2 engagements are promoted to ‘Senior’. Otherwise, the stored procedure should set the status to ‘Junior’.
Above is the question.
.. anyone can help me .Following is my solution
create procedure PRC_Min(IN Min INT)
Begin
IF
((Select COUNT(Staff_id) from Engagement
where Event_manager.Staff_id=Engagement.Staff_id) >= Min)
THEN
Update Event_manager
set Status= 'Senior';
ELSE
Update Event_manager
set Status= 'Junior';
END IF;
END@
Event_manager table just consist of staff info..
Engagement table having all date.. location.. etc
SQL0206N "EVENT_MANAGER.STAFF_ID " is not valid in the context where it is used.