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
How to get unique records from a table?
What is inner join in sql?
What is java sql driver?
What is data profiling in sql?
What is the difference between a database and a relational database?
Can ddl statements be used in pl/sql?
What are the different operators available in sql?
Explain correlated query work?
What is trigger and how to use it in sql?
What is sqlservr exe?
what are the authentication modes in sql server? : Sql dba
how can we find the number of rows in a table using mysql? : Sql dba
Can a varchar be a primary key?
What are the basic sql commands?
What is informix sql?