Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a SQL function that takes department name as input and increase the salary 15% only for the instructors whose salary is less than the
Write a SQL function that takes department name as input and increase the salary 15% only for the instructors whose salary is less than the average salary of the instructors of the department. Make it a similar format to the below example of a function:
DELIMITER // CREATE FUNCTION avgSalaries (deptName varchar (20)) RETURNS decimal (10,2) BEGIN DECLARE dept_avg_salary decimal(10,2); SELECT AVG (salary) INTO dept_avg_salary FROM instructor WHERE dept_name=deptName; RETURN dept_avg_salary; END // DELIMITERStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started