Click here to Skip to main content
15,921,226 members

Comments by jenkins123 (Top 3 by date)

jenkins123 24-Jan-23 2:58am View    
Thanks for the help <3
jenkins123 23-Jan-23 13:04pm View    
something like this (sorry to bother but I am not experienced with procedures)

CREATE PROCEDURE RAISE_SALARY(
@P_DEPARTMENT_ID NUMERIC
)
AS
DECLARE @AVG_SALARY INT
BEGIN
SELECT AVG(SALARY) FROM EMP_DETAILS WHERE DEPARTMENT_ID = @P_DEPARTMENT_ID INTO @AVG_SALARY ;
UPDATE TST_EMP
SET SALARY = SALARY + SALARY * 0.25
WHERE SALARY < @AVG_SALARY
END
GO
jenkins123 23-Jan-23 13:01pm View    
Deleted
something like this (sorry to bother but I am not experienced )

CREATE PROCEDURE RAISE_SALARY(
@P_DEPARTMENT_ID NUMERIC
)
AS
DECLARE @AVG_SALARY INT
BEGIN
SELECT AVG(SALARY) FROM EMP_DETAILS WHERE DEPARTMENT_ID = @P_DEPARTMENT_ID INTO @AVG_SALARY ;
UPDATE TST_EMP
SET SALARY = SALARY + SALARY * 0.25
WHERE SALARY < @AVG_SALARY
END