Reputation: 11
I have three tables Employee: EmployeeID, NationalIDNumber,LoginID, FirstName, LastName,Birthday,MartialStatus,Genger,HireDate,
Department: DepartmentID, Name, ManagerID
Manager: ManagerID, EmployeeID,StartDate,Status
How to write the following:
What is the employee id of all active department managers? The output table should contain the department id, department name and the manager’s employee id.
How many employees became were hired as mangers? How many active managers were promoted? The output table for each should have the employees name, employee id, hired date and start date. They should be named Hired Managers and Promoted Managers respectively
Upvotes: 0
Views: 591
Reputation: 155628
SELECT
*
FROM
employees
WHERE
HireDate >= '1985-01-01' -- SQL Server will convert this string to a `date` value internally
AND
Gender = 'F'
Upvotes: 1