You are on page 1of 1

SELECT Name

FROM Production.Product
WHERE ProductSubcategoryID =
(SELECT ProductCategoryID
From Production.ProductionSubcategory
WHERE Name = 'Jerseys' )

SELECT FROM HumanResources.Departement


WHERE DepartementI =
(SELECT DepartementID
FROM HumanResources.EmployeeDepartementhistory
WHERE (EmployeeID = 46 AND EndDate

SELECT EmployeeID
FROM HumanResources.EmployeeAddress
WHERE AddressID IN
(SELECT AddressID
FROM Person.Address
WHERE City ='Bothell')

SELECT c.FirstName, c.LastName, 'Departement :'= d.Name


FROM Person.Contact c, HumanResources.EmployeeDepartmentHistory edh,
HumanResources.Department d, HumanResources.Employee e
WHERE (c.ContactID = e.ContactID) AND (edh.DepartmentID = d.DepartmentID)
AND (e.EmployeeID = edh.EmployeeID) AND d.DepartmentID = ANY
(SELECT DepartmentID
FROM HumanResources.Department
WHERE (DepartmentID = 2) OR (DepartmentID = 3) OR (DepartmentID = 4))

SELECT c.FirstName, c.LastName, 'Departement :'= dep.Name, ep.Title,


addr.AddressLine1, addr.City
FROM Person.Contact c, HumanResources.Employee ep, Person.Address addr,
HumanResources.Department dep,HumanResources.EmployeeDepartmentHistory edh
WHERE (c.ContactID = ep.ContactID) AND (edh.DepartmentID = dep.DepartmentID) and
(ep.EmployeeID =edh.EmployeeID) and addr.AddressID = ANY
(SELECT DepartmentID
FROM HumanResources.Department
WHERE (DepartmentID = 1) OR (DepartmentID = 2) OR (DepartmentID = 3))

You might also like