Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

For each department, list the professors who have the number of PHD students he/

ID: 3818734 • Letter: F

Question

For each department, list the professors who have the number of PHD students he/she advises more than the average number of PHD students these professors advise in their department.

NEED HELP ON HOW TO GET THE AVERAGE NUMBER OF PHD STUDENTS THESE PROFESSOR ADVISE in ORACLE

select d.deptid, e.empName, count(s.stdNumber)

from department d

left join employee_department ed on d.deptid = ed.deptid

left join employee e on ed.empSSN = e.empSSN

left join student s on s.stdadvisorSSN = e.empSSN

where e.empTypeId in (1,2,3,4)

and e.empCategoryID = 1

and s.stddegreeid = 7

and s.majordeptid = d.deptid

group by d.deptid, e.empName;

Explanation / Answer

select deptid,empName,Avg(std_count) as Avg_Students from
(select d.deptid, e.empName, count(s.stdNumber) as std_count
from department d
left join employee_department ed on d.deptid = ed.deptid
left join employee e on ed.empSSN = e.empSSN
left join student s on s.stdadvisorSSN = e.empSSN
where e.empTypeId in (1,2,3,4)
and e.empCategoryID = 1
and s.stddegreeid = 7
and s.majordeptid = d.deptid
group by d.deptid, e.empName) std;

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote