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 / narenkumar reddy
declare
cursor c1 is select * from emp;
begin
for i in c1
loop
if i.job='salesman' then
bonus:=sal+sal*10/100;
elsif i.job='manager' then
bonus:=sal+sal*20/100;
elsif i.job='analyst' then
bonus:=sal+sal*30/100;
end if;
dbms_output_output.put_line(i.ename||i.sal||i.sal||bonus);
end;
| Is This Answer Correct ? | 0 Yes | 3 No |
Post New Answer View All Answers
what are string data types? : Sql dba
How do I find duplicates in two columns?
What is composite data type in pl sql?
What is mutating sql table?
What is the use of function "module procedure" in pl/sql?
What is java sql connection?
Is left join inner or outer?
what is the difference between inner and outer join? Explain with example. : Sql dba
what are the advantages of mysql in comparison to oracle? : Sql dba
What is trigger price?
What are packages in pl sql and also explain its advantages?
Can a view be mutating? If yes, then how?
What are views in sql?
What is pl sql block structure?
Can sql function call stored procedure?