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
How to test for null values?
Can we join same table in sql?
Is foreign key mandatory?
What is db journal file?
What do you understand by pl/sql cursors?
What is sql character function?
Explain 3 basic parts of a trigger.
Is truncate ddl or dml?
Can we join more than 2 tables in sql?
What is implicit cursor in pl sql?
What is write ahead logging in sql server?
What does (*) mean in sql?
what is the difference between group by and order by in sql? : Sql dba
What does seeding a database mean?
What is data types in sql?