How to update salary of employees department wise?
Answers were Sorted based on User's Feedback
Answer / k v koteswara rao
UPDATE employees SET salary=DECODE(department_id,10,salary+1000,20,salary+2000,30, salary+3000,salary);
| Is This Answer Correct ? | 18 Yes | 0 No |
update emp
set sal = case Deptno when 10 then 1000
when 20 then 2000
when 30 then 3000
else 0
end;
| Is This Answer Correct ? | 7 Yes | 0 No |
Answer / manoranjan sethy
UPDATE EMP
SET SAL=DECODE (
DEPTNO,
10, SAL+SAL*0.1,
20, SAL+SAL*0.2,
30, SAL+SAL*0.3,
40, SAL+SAL*0.4,
'NA'
)
/
| Is This Answer Correct ? | 6 Yes | 0 No |
Answer / prativa mishra
update employees
set salary=salary+1000
where department_id=&department_id
| Is This Answer Correct ? | 4 Yes | 3 No |
Answer / 8008064637
begin
updata emp set sal=sal+1000 where deptno in(10,20,30,40);
end;
| Is This Answer Correct ? | 4 Yes | 4 No |
Answer / meher.shareen
begin
update emp set sal=sal+1000
where deptno=10;
update emp set sal=sal+2000
where deptno=20;
update emp set sal=sal+3000
where deptno=30;
update emp set sal=sal+4000
where deptno=40;
end;
| Is This Answer Correct ? | 1 Yes | 5 No |
What has stored procedures in sql?
What is the difference between between and in condition operators?
How can a function retun more than one value in oracle with proper example?
What is graph sql?
What is a constraint? Tell me about its various levels.
What are the methods of filing?
What sql does db2 use?
what the meaning of sql
What is sqlca in powerbuilder?
What are the differences between Database Trigger and Integrity constraints ?
what is meant by forward declaration in functions?
If a cursor is open, how can we find in a pl/sql block?
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)