define a variable representing the expression used to
calculate on emps total annual remuneration.use the
variable in a statement which finds all emps who can earn
30000 a year or more.

Answers were Sorted based on User's Feedback



define a variable representing the expression used to calculate on emps total annual remuneration...

Answer / prasuna

Alternate 1

Define a cursor which holds the empname,salary and annual
renumeration
Use this cursor in a PL/SQL Block to find the emps who earn
30000 or more.

example :
Declare
cursor cl is select empname,salary,(salary*12)annual
renumeration
Begin
for i in cl
Loop
if i.annual renumeration > 30000 then
dbmsoutput.putline(empname);
end if
end

Approarch2
Write a stored function the take emp salary as i/p and
returns annual salary

Using this function in select statement can find the list
of emps who earn more than 30000

Is This Answer Correct ?    4 Yes 0 No

define a variable representing the expression used to calculate on emps total annual remuneration...

Answer / ajit nayak

select ename,sal,(sal*12)
from emp
where (sal*12) > 30000;

Is This Answer Correct ?    4 Yes 2 No

define a variable representing the expression used to calculate on emps total annual remuneration...

Answer / padmalatha

select Empno,Annual_Salary=sum(Month_Salary) from
Employee_Salary
group by Empno having sum(Month_Salary)>30000

Is This Answer Correct ?    2 Yes 2 No

define a variable representing the expression used to calculate on emps total annual remuneration...

Answer / venkat

Declare
cursor cl is select ename,sal,(sal*12) AS annualSAL FROM EMP;
i emp%rowtype;
Begin
for i in cl
loop
if i.annualSAL > 30000 then

dbms_output.put_line(i.ename);

end if;
end loop;
end;

Is This Answer Correct ?    0 Yes 1 No

define a variable representing the expression used to calculate on emps total annual remuneration...

Answer / kingston

i don't know

Is This Answer Correct ?    0 Yes 2 No

Post New Answer

More SQL PLSQL Interview Questions

Is record in pl sql?

0 Answers  


How do you exit in sql?

0 Answers  


What is sql query limit?

0 Answers  


what is meant by nl2br()? : Sql dba

0 Answers  


If we have n no of columns in a table, can we add new column in that table with not null constraint?

2 Answers  






Why is a primary key important?

0 Answers  


Explain foreign key in sql?

0 Answers  


What is the difference between UNIQUE CONSTRAINT and PRIMARY KEY? 1. There is no difference. 2. A PRIMARY KEY cannot be declared on multiple columns. 3. A UNIQUE CONSTRAINT cannot be declared on multiple columns. 4. A table can have multiple PRIMARY KEYS but only one UNIQUE CONSTRAINT. 5. A table can have multiple UNIQUE CONSTRAINTs but only one PRIMARY KEY.

7 Answers   Satyam,


What is normalization? dec 2009

3 Answers   Cognizant,


Is sql sequential or random?

0 Answers  


after tell procedure whole code he asked can i write the same way in a function

3 Answers  


Which sorts rows in sql?

0 Answers  


Categories