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
List and explain the different types of join clauses supported in ansi-standard sql?
What is the difference between count 1 and count (*) in a sql query?
What is sql keyword?
If a cursor is open, how can we find in a pl/sql block?
Which function is used to return remainder in a division operator in sql?
How can we make an if statement within a select statement?
What are pl/sql cursors?
Can pl sql procedure have a return statement?
what is bcp? When is it used?
What are the conditions an underlying table must satisfy before a cursor can be used by a positioned update or delete statement? : Transact sql
What is nvarchar in sql?
How to load data with sql*loader?
What are the types of records?
Where is pl sql used?
what is a relationship and what are they? : Sql dba