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
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 |
Answer / ajit nayak
select ename,sal,(sal*12)
from emp
where (sal*12) > 30000;
| Is This Answer Correct ? | 4 Yes | 2 No |
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 |
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 |
Which is faster union or join?
which will default fire first statement level trigger or row level trigger
2 Answers Cap Gemini, Data Vision,
what is self-join? : Sql dba
Delete duplicate records in the emp table.
what is the difference between implicit and explicit trigger
Differentiate between % rowtype and type record.
how is exception handling handled in mysql? : Sql dba
how can stop the sequence with mention the max value and with out mention the max value
What is trigger types of trigger?
what are enums used for in mysql? : Sql dba
Is sql a microsoft product?
What is an alias command?
Oracle (3259)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)