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 normalization in a database?
How to place comments in pl/sql?
what is an execution plan? When would you use it? How would you view the execution plan? : Sql dba
What is a database event trigger?
What is the best partition size for windows 10?
What is acid property in a database?
what is a trigger in mysql? Define different types of trigger. : Sql dba
is it possible to pass an object or table to a procedure as an argument?
What is pl sql commands?
What are the different sql languages?
Explain the difference between rename and alias?
What are the types of queries in sql?
Mention what is the plv (pl/vision) package offers?
What is sql*loader and what is it used for?
what happens if null values are involved in expressions? : Sql dba