Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

what are string data types? : Sql dba

1045


How do I find duplicates in two columns?

1169


What is composite data type in pl sql?

1113


What is mutating sql table?

1112


What is the use of function "module procedure" in pl/sql?

1198


What is java sql connection?

1060


Is left join inner or outer?

1015


what is the difference between inner and outer join? Explain with example. : Sql dba

1025


what are the advantages of mysql in comparison to oracle? : Sql dba

1004


What is trigger price?

989


What are packages in pl sql and also explain its advantages?

1040


Can a view be mutating? If yes, then how?

1028


What are views in sql?

989


What is pl sql block structure?

1037


Can sql function call stored procedure?

1025