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.
Answer Posted / 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 |
Post New Answer View All Answers
What is a recursive stored procedure?
what are the different index configurations a table can have? : Sql dba
Write the command to remove all players named sachin from the players table.
Why use truncate instead of delete?
What is procedure and function?
What is duration in sql profiler trace?
How does index help in query performance?
how many ways to get the current time? : Sql dba
How do I find sql profiler?
what is a table called, if it has neither cluster nor non-cluster index? What is it used for? : Sql dba
What is field delimiter?
How do I send sql query results to excel?
how to decrement dates by 1 in mysql? : Sql dba
What are the rules to be applied to nulls whilst doing comparisons?
What is the purpose of the primary key?