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
List the ways to get the count of records in a table?
How much does a sql dba make? : SQL DBA
How do you write a subquery?
Can we perform dml on view?
Why is a trigger used?
what is the syntax for using sql_variant_property? : Transact sql
What is forward declaration in pl sql?
Can we edit a view in sql?
Can a procedure in a package be overloaded?
Is inner join faster than left join?
what is the difference between truncate and drop statements? : Sql dba
List out the acid properties and explain?
What is sql clause?
What is microsoft t sql?
What is sap sql?