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 |
Where not exists in sql?
What is pls_integer in pl sql?
Can we use distinct and group by together?
what is meant by urlencode and urldocode? : Sql dba
What are basic techniques of indexing?
SELECT flavor, SUM (ice_cream_sales) FROM sales_detail GROUP BY flavor ORDER BY 2 DESC If the "sales_detail" table contains ten records with different values in the flavor column (two "vanilla," three "chocolate," four "strawberry," and one NULL), how many rows are returned by the sample code above? 1. 0 rows 2. 1 row 3. 3 rows 4. 4 rows 5. 10 rows
What are synonyms in sql?
Is sql free?
What is a pl/sql block?
Query for second maximum salary in each in each department
15 Answers DST Global Solutions, TCS,
How does postgresql compare to "nosql"?
what is the difference between mysql_fetch_array and mysql_fetch_object? : Sql dba