Advertisement
Guest User

Untitled

a guest
Sep 20th, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
T-SQL 0.59 KB | None | 0 0
  1. USE AdventureWorks2012;
  2. GO
  3.  
  4. SELECT BusinessEntityID, JobTitle, Gender, HireDate
  5.     FROM HumanResources.Employee
  6.     WHERE JobTitle IN (
  7.         'Accounts Manager', 'Benefits Specialist', 'Engineering Manager', 'Finance Manager', 'Maintenance Supervisor', 'Master Scheduler', 'Network Manager'
  8.     );
  9. GO
  10.  
  11. SELECT COUNT(*) 'EmpCount'
  12.     FROM HumanResources.Employee
  13.     WHERE YEAR(HireDate) >= '2004';
  14. GO
  15.  
  16. SELECT TOP 5 BusinessEntityID, JobTitle, MaritalStatus, Gender, BirthDate, HireDate
  17.     FROM HumanResources.Employee
  18.     WHERE MaritalStatus = 'M'
  19.         AND YEAR(HireDate) = '2004'
  20.     ORDER BY BirthDate DESC;
  21. GO
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement