Objective
An examination has been conducted to a class of 5 students
and four scores of each student have been provided in the data along with register number and name. Write a PL/SQL
block to do the following
Assign a letter grade
to each student based on the average score;
Average Score
Grade
90-100
a
75-89
b
60-74
c
50-59
d
0-49
e
Program
SQL> create table studres(regno number(4) primary key,
name varchar(20), paper1 number(2), paper2 number(2), paper3 number(2), paper4
number(2));
Table created
SQL> insert into studres values(1001,’mini’, 23, 49, 44,
46);
1 row created
SQL> insert into studres values(1002,’safeer’, 40, 30,
20, 10);
1 row created
SQL> insert into studres values(1003,’baby’, 49, 39, 46,
45);
1 row created
SQL> insert into
studres values(1004,’danish’, 40, 10, 20, 22);
1 row created










