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


Please Help Members By Posting Answers For Below Questions

What is sql*loader and what is it used for?

739


Explain the difference in execution of triggers and stored procedures?

743


explain the difference between myisam static and myisam dynamic. : Sql dba

700


how can we destroy the cookie? : Sql dba

735


Is postgresql a nosql database?

788






What are the types of dbms?

711


How to change a value of the field ‘salary’ as 7500 for an employee_name ‘john’ in a table employee_details?

1151


How much does sql certification cost?

739


Why do we use view in sql?

722


What is union?

815


Can a table contain multiple foreign key’s?

739


What is pragma in pl sql?

764


What is the least restrictive isolation level? : Transact sql

759


What are the two types of periodical indexes?

656


What is clustered index in sql?

775