Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- use hr;
- #question1
- delimiter $$;
- create procedure ABC (out no_employees int, in question int)
- begin
- case
- when(question = 2) then
- select count(job_id) into no_employees from jobs where min_salary > 10000;
- when(question = 3) then
- select count(job_id) into no_employees from jobs where min_salary < 10000;
- when(question = 4) then
- select count(job_id) into no_employees from jobs where min_salary = 10000;
- end case;
- end;
- $$
- #question2
- call ABC(@no_employees,2);
- select @no_employees;
- #question3
- call ABC(@no_employees,3);
- select @no_employees;
- #question4
- call ABC(@no_employees,4);
- select @no_employees;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement