Guest User

Untitled

a guest
Oct 19th, 2017
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. --query1
  2. select "name",employee_code from instructor where id_desig in
  3. (
  4. select id_desig from designation where desig_name like 'Asst. Professor'
  5. ) and id_dept in
  6. (
  7. select id_dept from department where dept_code like 'CSE'
  8. );
  9.  
  10.  
  11.  
  12.  
  13. --query2
  14.  
  15. select * from teaches;
  16. select * from course;
  17. select * from instructor;
  18. select * from designation;
  19.  
  20. select id_instructor , count(credit) AS total_course_load from course join teaches using(course_id) where id_instructor in
  21. (
  22. select id_instructor from instructor
  23. )
  24. and id_desig in
  25. (
  26. select id_desig from designation where desig_name like 'Asst. Professor'
  27. )and id_dept in
  28. (
  29. select id_dept from department where dept_code like 'CSE'
  30. ) group by id_instructor;
  31.  
  32.  
  33. --query3
  34.  
  35. select * from designation;
  36.  
  37. update designation set
  38. salary = case
  39. when desig_name = 'Lecturer' then 0.5*(select salary from designation where desig_name = 'professor')
  40. when desig_name = 'Asst. Professor' then 0.75*(select salary from designation where desig_name = 'professor')
  41. else salary
  42. end;
Add Comment
Please, Sign In to add comment