Question: Consider the Schema of the university database. Select SQL query to find the average salary of instructors in those departments where the average salary is
Consider the Schema of the university database. Select SQL query to find the average salary of instructors in those departments where the average salary is more than $42,000 classroom(building, room_number, capacity) department(dept_name, building, budget) course(course id, title, dept name, credits) instructor(ID, name, dept_name, salary) section(course_id, sec_id, semester, year, building, room_number, time_slot id) teaches(ID, course id, sec id, semester, year) student(ID, name, dept_name, tot cred) takes(ID, course id, sec id, semester, year, grade) advisor(s ID, i_ID) time_slot(time_slot_id, day, start_time, end_time) prereq(course_id,_prereq_id) select dept_name, from department having avg (salary) > 42000; select instructor_ID, avg (salary) from instructor group by instructor having avg (salary) >42000; select dept_name, avg (salary) from instructor group by dept_name having avg (salary) >42000; select dept_name, avg (salary) from department group by salary having avg (salary) >42000
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
