SHARE
TWEET

Untitled

a guest Oct 21st, 2019 67 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top