Advertisement
Guest User

Untitled

a guest
Oct 21st, 2019
182
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. use hr;
  2.  
  3. #question1
  4. delimiter $$;
  5. create procedure ABC (out no_employees int, in question int)
  6. begin
  7. case
  8. when(question = 2) then
  9. select count(job_id) into no_employees from jobs where min_salary > 10000;
  10. when(question = 3) then
  11. select count(job_id) into no_employees from jobs where min_salary < 10000;
  12. when(question = 4) then
  13. select count(job_id) into no_employees from jobs where min_salary = 10000;
  14. end case;
  15. end;
  16. $$
  17.  
  18. #question2
  19. call ABC(@no_employees,2);
  20. select @no_employees;
  21.  
  22. #question3
  23. call ABC(@no_employees,3);
  24. select @no_employees;
  25.  
  26. #question4
  27. call ABC(@no_employees,4);
  28. select @no_employees;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement