You are on page 1of 3

--SOAL 3 A

SELECT

Person.Person.FirstName,

Person.Person.LastName,

HumanResources.Employee.JobTitle,

HumanResources.Employee.Gender,

HumanResources.Employee.SickLeaveHours

FROM

HumanResources.Employee,

Person.Person

WHERE

HumanResources.Employee.BusinessEntityID = Person.Person.BusinessEntityID;

--SOAL 3 B

SELECT

Person.Person.FirstName,

Person.Person.LastName,

HumanResources.Employee.JobTitle,

HumanResources.Employee.Gender,

HumanResources.Department.Name,

HumanResources.Shift.StartTime,

HumanResources.Shift.EndTime

FROM

HumanResources.Employee,

HumanResources.Department,

HumanResources.Shift,

Person.Person,

HumanResources.EmployeeDepartmentHistory

WHERE
HumanResources.Employee.BusinessEntityID = Person.Person.BusinessEntityID

AND HumanResources.Employee.BusinessEntityID =
HumanResources.EmployeeDepartmentHistory.BusinessEntityID

AND HumanResources.Department.DepartmentID =
HumanResources.EmployeeDepartmentHistory.DepartmentID

AND HumanResources.EmployeeDepartmentHistory.ShiftID = HumanResources.Shift.ShiftID;

--SOAL 3 C

SELECT

Person.Person.FirstName,

Person.Person.LastName,

HumanResources.Employee.JobTitle,

HumanResources.EmployeePayHistory.ModifiedDate,

HumanResources.EmployeePayHistory.PayFrequency AS Paid_Every,

HumanResources.EmployeePayHistory.Rate*8*5 AS Amount_Paid

FROM

Person.Person,

HumanResources.Employee,

HumanResources.EmployeePayHistory

WHERE

HumanResources.Employee.BusinessEntityID = Person.Person.BusinessEntityID AND

HumanResources.Employee.BusinessEntityID = HumanResources.EmployeePayHistory.BusinessEntityID

--SOAL 3D
SELECT

HumanResources.Employee.HireDate AS HIRE_MOMENT,

HumanResources.Department.Name AS DEPT_NAME,

COUNT (HumanResources.Employee.HireDate) AS NUMBER_OF_EMPLOYEE

FROM

HumanResources.EmployeePayHistory,

HumanResources.Department,

HumanResources.Employee,

HumanResources.EmployeeDepartmentHistory

WHERE

HumanResources.Employee.BusinessEntityID =
HumanResources.EmployeePayHistory.BusinessEntityID

AND HumanResources.EmployeeDepartmentHistory.BusinessEntityID =
HumanResources.Employee.BusinessEntityID

AND HumanResources.Department.DepartmentID =
HumanResources.EmployeeDepartmentHistory.DepartmentID

GROUP BY

HumanResources.Employee.HireDate,

HumanResources.Department.Name

ORDER BY

HumanResources.Employee.HireDate

You might also like