答案 0 :(得分:0)
要查找分配给运行此查询所需的所有任务的开发人员的平均年龄 -
select AVG(e.Age) as age from `Employee` e join `Task_Assignment` ta on ta.Developer_ID = e.Employee_ID;
要查找运行此查询所需的每个优先级的任务数 -
select COUNT(t.TASK_ID) from `Task` t join `Task_Priority` tp on t.Task_ID = tp.Task_ID GROUP_BY tp.Priority_ID;
希望这会有所帮助:)
答案 1 :(得分:0)
select sum(age)/count(*) as avg_age from (
select distinct developer, age from (
select * from Employee emp inner join Task_Assignment task_assign
on emp.emp_id = task_assign.developer
) as a ) as b