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
Which constraints we can use while creating database in sql?
Is natural join same as inner join?
What is difference between procedure and trigger?
What is oracle and pl sql?
Write a sql query to convert all character to uppercase after hypen.
What is sap sql?
What does desc stand for?
Does view store data in sql?
Can we insert data into materialized view?
What is the difference between instead of trigger and after trigger?
What is the difference between clustered and non-clustered indexes?
What is relationship? How many types of relationship are there?
Can we create table inside stored procedure?
Does mysql support pl sql?
Why do we need sharding?