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

Which constraints we can use while creating database in sql?

1018


Is natural join same as inner join?

872


What is difference between procedure and trigger?

922


What is oracle and pl sql?

1082


Write a sql query to convert all character to uppercase after hypen.

1381


What is sap sql?

931


What does desc stand for?

1026


Does view store data in sql?

905


Can we insert data into materialized view?

899


What is the difference between instead of trigger and after trigger?

951


What is the difference between clustered and non-clustered indexes?

1032


What is relationship? How many types of relationship are there?

1075


Can we create table inside stored procedure?

907


Does mysql support pl sql?

1101


Why do we need sharding?

940