SELECT p.project_id, MAX(e.experience_years) AS experience_yearsFROM Project p JOIN Employee eON p.employee_id=e.employee_idGROUP BY p.project_id;
SELECT p.project_id, e.employee_idFROM Project p JOIN Employee eON p.employee_id=e.employee_idWHERE (p.project_id, e.experience_years)IN ( SELECT p.project_id, MAX(e.experience_years) AS experience_years FROM Project p JOIN Employee eON p.employee_id=e.employee_id GROUP BY p.project_id);