create table students ( student_id number not null, student_name varchar2(50), student_surname varchar2(50) not null, section_id number, final_grade number, letter_grade char(1), constraint students_pk primary key(student_id) ); insert into students values ( 1, 'Nurhak', 'Kaya', 89, 85, 'D' ); declare v_student_id number:=1; v_section_id number:=89; v_final_grade number; v_letter_grade char(1); begin select final_grade into v_final_grade from students where student_id=v_student_id and section_id=v_section_id; case when v_final_grade>=90 then v_letter_grade:='A'; when v_final_grade>=80 then v_letter_grade:='B'; when v_final_grade>=70 then v_letter_grade:='C'; when v_final_grade>=60 then v_letter_grade:='D'; else v_letter_grade:='F'; end case; --check result dbms_output.put_line(
Solution Architect | Umbraco Certified Master | Umbraco MVPx3 | Certified ScrumMaster
"Anyone can cook, but only the fearless can be great." Ratatouille