Advertisement
Maks140888

Untitled

May 27th, 2022
699
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. create or replace function percent_passed_works(tutor number)
  2. return number
  3. is all_works number;
  4.    passed_works number;
  5. begin
  6.     select count(grade)
  7.     into all_works
  8.     from grades
  9.     where tutor_id = tutor;
  10.    
  11.     select count(grade)
  12.     into passed_works
  13.     from grades
  14.     where grade > 60;
  15.  
  16.     return (passed_works / all_works ) * 100;
  17. end;
Advertisement
RAW Paste Data Copied
Advertisement