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

List and explain the different types of join clauses supported in ansi-standard sql?

1360


What is the difference between count 1 and count (*) in a sql query?

1003


What is sql keyword?

1011


If a cursor is open, how can we find in a pl/sql block?

1174


Which function is used to return remainder in a division operator in sql?

1152


How can we make an if statement within a select statement?

1023


What are pl/sql cursors?

1062


Can pl sql procedure have a return statement?

1037


what is bcp? When is it used?

1124


What are the conditions an underlying table must satisfy before a cursor can be used by a positioned update or delete statement? : Transact sql

1012


What is nvarchar in sql?

930


How to load data with sql*loader?

1060


What are the types of records?

1003


Where is pl sql used?

963


what is a relationship and what are they? : Sql dba

1112