← All tables and views

AdventureWorks OLTP view

HumanResources.vEmployeeDepartmentHistory

Native view in the AdventureWorks OLTP sample database.

296rows

11 columns

Schema from the provider contract
ColumnTypeNullableKeyReferences
BusinessEntityIDyes——
Titleyes——
FirstNameyes——
MiddleNameyes——
LastNameyes——
Suffixyes——
Shiftyes——
Departmentyes——
GroupNameyes——
StartDateyes——
EndDateyes——

View definition

CREATE VIEW "HumanResources.vEmployeeDepartmentHistory" AS
SELECT
    e."BusinessEntityID"
    ,p."Title"
    ,p."FirstName"
    ,p."MiddleName"
    ,p."LastName"
    ,p."Suffix"
    ,s."Name" AS "Shift"
    ,d."Name" AS "Department"
    ,d."GroupName"
    ,edh."StartDate"
    ,edh."EndDate"
FROM "HumanResources.Employee" e
	INNER JOIN "Person.Person" p
	ON p."BusinessEntityID" = e."BusinessEntityID"
    INNER JOIN "HumanResources.EmployeeDepartmentHistory" edh
    ON e."BusinessEntityID" = edh."BusinessEntityID"
    INNER JOIN "HumanResources.Department" d
    ON edh."DepartmentID" = d."DepartmentID"
    INNER JOIN "HumanResources.Shift" s
    ON s."ShiftID" = edh."ShiftID"

Data preview

Sample records

296 rows available
BusinessEntityIDTitleFirstNameMiddleNameLastNameSuffixShift
1NULLKenJSánchezNULLDay
2NULLTerriLeeDuffyNULLDay
3NULLRobertoNULLTamburelloNULLDay
4NULLRobNULLWaltersNULLDay
4NULLRobNULLWaltersNULLDay
5Ms.GailAEricksonNULLDay
6Mr.JossefHGoldbergNULLDay
7NULLDylanAMillerNULLDay