Hey guys I have been working on this but i couldn't solve it, is any one can help me with that please? Im just confused, can some one help me how to fix the code?Sorry for the content because i couldnt upload image
SELECT Employee.EmpName, Employee.Age
FROM Employee
WHERE Employee.Age < (SELECT COUNT(Employee.EmployeeID)
FROM Employee, Department
WHERE Department.ManagerID = Employee.EmployeeID
GROUP BY Employee.EmployeeID
HAVING COUNT(Employee.EmployeeID) >= 2)
//(Question) Find the youngest manager who manages more than one department. the query return the name and age of the manager.
SCHEMA
Employee(EmployeeID:Integer, EmpName: String, Age: Integer, Salary: Real)
Department(DeptID: Integer, DeptName:String, Budget: Real, ManagerID: Integer)
Works(EmployeeID:Integer, DeptID: Integer, Percent_Time: Integer)
Aucun commentaire:
Enregistrer un commentaire