using cursors salesman get bonus as 10% of their salary ,
managers get 20% , analalist get 30%. generae a report
showing the employee name, salary , bonus.
Answer Posted / neelaveni
declare
/*cursor c_bonus
is
select * from empsal; */
begin
for i in (select * from empsal)
loop
if i.job='salesman' then
i.bonus:=i.sal*10/100;
elsif i.job='mgr' then
i.bonus:=i.sal*20/100;
elsif i.job='analyst' then
i.bonus:=i.sal*30/100;
end if;
dbms_output.put_line('The ename is : '||i.ename);
dbms_output.put_line('The sal is : '||i.sal);
dbms_output.put_line('The job is : '||i.job);
dbms_output.put_line('The bonus is : '||i.bonus);
end loop;
end;
| Is This Answer Correct ? | 7 Yes | 0 No |
Post New Answer View All Answers
what is myisam? : Sql dba
What is forward declaration in pl sql?
What is java sql connection?
Why cross join is used?
What is pls_integer in pl sql?
What is the use of prepared statement?
How do I make my sql query run faster?
How to run sql functions in pl/sql?
What is normalization sql?
How many types of cursors supported in pl/sql?
How insert into statements in sql?
What are its different types of dbms?
what is query cache in mysql? : Sql dba
What is sql prepared statement?
What is the sql*loader? : aql loader