| AdventureWorks Database > HumanResources Schema : HumanResources.EmployeeDepartmentHistory Table |
| Creation Date | 08/01/2010 08:40 |
| File Group | PRIMARY |
| Text File Group | |
| System Object | ![]() |
| Published for Replication | ![]() |
| Rows | 296 |
| Data Space Used | 16.00 KB |
| Index Space Used | 48.00 KB |
| Column Name | Description | Datatype | Length | Allow Nulls | Default | Formula | |
|---|---|---|---|---|---|---|---|
| EmployeeID | Employee identification number. Foreign key to Employee.EmployeeID. | int | 4 | |||
| DepartmentID | Department in which the employee worked including currently. Foreign key to Department.DepartmentID. | smallint | 2 | |||
| ShiftID | Identifies which 8-hour shift the employee works. Foreign key to Shift.Shift.ID. | tinyint | 1 | |||
| StartDate | Date the employee started work in the department. | datetime | 4 | |||
| EndDate | Date the employee left the department. NULL = Current department. | datetime | 4 | ![]() | |||
| ModifiedDate | Date and time the record was last updated. | datetime | 4 | (getdate()) |
| Index | Description | Primary | Unique |
|---|---|---|---|
| IX_EmployeeDepartmentHistory_DepartmentID | Nonclustered index. | ||
| IX_EmployeeDepartmentHistory_ShiftID | Nonclustered index. | ||
| PK_EmployeeDepartmentHistory_EmployeeID_StartDate_DepartmentID | Primary key (clustered) constraint | ![]() | ![]() |
| Name | Description | Expression |
|---|---|---|
| CK_EmployeeDepartmentHistory_EndDate | Check constraint [EndDate] >= [StartDate] OR [EndDate] IS NUL | ([EndDate]>=[StartDate] OR [EndDate] IS NULL) |
| Relationship | Description |
|---|---|
| FK_EmployeeDepartmentHistory_Department_DepartmentID | Foreign key constraint referencing Department.DepartmentID. |
| FK_EmployeeDepartmentHistory_Employee_EmployeeID | Foreign key constraint referencing Employee.EmployeeID. |
| FK_EmployeeDepartmentHistory_Shift_ShiftID | Foreign key constraint referencing Shift.ShiftID |
| Database Object | Object Type | Description | Dep Level | |
|---|---|---|---|---|
![]() | HumanResources.vEmployeeDepartment | View | Returns employee name, title, and current department. | 1 |
![]() | HumanResources.vEmployeeDepartmentHistory | View | Returns employee name and current and previous departments. | 1 |
| Database Object | Object Type | Description | Dep Level | |
|---|---|---|---|---|
![]() | Person.Contact | Table | Names of each employee, customer contact, and vendor contact. | 2 |
![]() | HumanResources.Department | Table | Lookup table containing the departments within the Adventure Works Cycles company. | 1 |
![]() | HumanResources.Employee | Table | Employee information such as salary, department, and title. | 1 |
![]() | dbo.Flag | User Defined Data Type | 2 | |
![]() | dbo.NameStyle | User Defined Data Type | 3 | |
![]() | dbo.Phone | User Defined Data Type | 3 | |
![]() | HumanResources.Shift | Table | Work shift lookup table. | 1 |
|