Ravi Lalloo
Ravi Lalloo

Reputation: 11

How to write an SQL statement for listing all employees hired after 1985 that are female?

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:

  1. 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.

  2. 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

Answers (1)

Dai
Dai

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

Related Questions