Description
Employee information such as salary, department, and title.
Table properties
| name | value |
|---|
| name | [HumanResources].[Employee] |
| created | Mar 19 2009 9:09PM |
| modified | Mar 19 2009 9:10PM
|
| ansi nulls | on
|
| quoted identifier | on
|
| row count | 290 |
| Size of data | 56 kb |
| Size of indexes | 136 kb |
| Maximum size of a single row | NaN bytes |
Columns
| column | datatype | length | bytes | default | nulls | PK | FK | UQ | computed | comment |
|---|
| BusinessEntityID | int | 10 | 4 | | no
| yes
| Person.BusinessEntityID
|
| no
| Primary key for Employee records. Foreign key to BusinessEntity.BusinessEntityID.
|
| NationalIDNumber | nvarchar(15) | 15 | 60 | | no
|
| |
| no
| Unique national identification number such as a social security number.
|
| LoginID | nvarchar(256) | 256 | 1024 | | no
|
| |
| no
| Network login.
|
| OrganizationNode | hierarchyid | 892 | variable | | yes
|
| |
| no
| Where the employee is located in corporate hierarchy.
|
| OrganizationLevel | smallint | 5 | 2 | | yes
|
| |
| yes
| The depth of the employee in the corporate hierarchy.
|
| JobTitle | nvarchar(50) | 50 | 200 | | no
|
| |
| no
| Work title such as Buyer or Sales Representative.
|
| BirthDate | date | 10 | 3 | | no
|
| |
| no
| Date of birth.
|
| MaritalStatus | nchar(1) | 1 | 4 | | no
|
| |
| no
| M = Married, S = Single
|
| Gender | nchar(1) | 1 | 4 | | no
|
| |
| no
| M = Male, F = Female
|
| HireDate | date | 10 | 3 | | no
|
| |
| no
| Employee hired on this date.
|
| SalariedFlag | Flag | 1 | 0 | ((1)) | no
|
| |
| no
| Job classification. 0 = Hourly, not exempt from collective bargaining. 1 = Salaried, exempt from collective bargaining.
|
| VacationHours | smallint | 5 | 2 | ((0)) | no
|
| |
| no
| Number of available vacation hours.
|
| SickLeaveHours | smallint | 5 | 2 | ((0)) | no
|
| |
| no
| Number of available sick leave hours.
|
| CurrentFlag | Flag | 1 | 0 | ((1)) | no
|
| |
| no
| 0 = Inactive, 1 = Active
|
| rowguid | uniqueidentifier | 36 | 16 | (newid()) | no
|
| |
| no
| ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
|
| ModifiedDate | datetime | 23 | 8 | (getdate()) | no
|
| |
| no
| Date and time the record was last updated.
|
Indexes
References
Referenced by
Foreign key graph
Foreign keys
| name | columns | foreign columns | type | comment |
|---|
| FK_Employee_Person_BusinessEntityID | BusinessEntityID | Person.BusinessEntityID |
| Foreign key constraint referencing Person.BusinessEntityID.
|
Check constraints
| name | column | comment |
|---|
CK_Employee_BirthDate([BirthDate]>='1930-01-01' AND [BirthDate]<=dateadd(year,(-18),getdate())) | BirthDate
| Check constraint [BirthDate] >= '1930-01-01' AND [BirthDate] <= dateadd(year,(-18),GETDATE())
|
CK_Employee_MaritalStatus(upper([MaritalStatus])='S' OR upper([MaritalStatus])='M') | MaritalStatus
| Check constraint [MaritalStatus]='s' OR [MaritalStatus]='m' OR [MaritalStatus]='S' OR [MaritalStatus]='M'
|
CK_Employee_HireDate([HireDate]>='1996-07-01' AND [HireDate]<=dateadd(day,(1),getdate())) | HireDate
| Check constraint [HireDate] >= '1996-07-01' AND [HireDate] <= dateadd(day,(1),GETDATE())
|
CK_Employee_Gender(upper([Gender])='F' OR upper([Gender])='M') | Gender
| Check constraint [Gender]='f' OR [Gender]='m' OR [Gender]='F' OR [Gender]='M'
|
CK_Employee_VacationHours([VacationHours]>=(-40) AND [VacationHours]<=(240)) | VacationHours
| Check constraint [VacationHours] >= (-40) AND [VacationHours] <= (240)
|
CK_Employee_SickLeaveHours([SickLeaveHours]>=(0) AND [SickLeaveHours]<=(120)) | SickLeaveHours
| Check constraint [SickLeaveHours] >= (0) AND [SickLeaveHours] <= (120)
|
Triggers
| name | comment |
|---|
| dEmployee | INSTEAD OF DELETE trigger which keeps Employees from being deleted.
|
Defaults
Dependency graph
Objects that [HumanResources].[Employee] depends on
| name | object type | database | server | level |
|---|
| Flag | type | AdventureWorks2008 | SPRING\KATMAI | 1 |
Objects that depend on [HumanResources].[Employee]
Sample rows
| BusinessEntityID | NationalIDNumber | LoginID | OrganizationNode | OrganizationLevel | JobTitle | BirthDate | MaritalStatus | Gender | HireDate | SalariedFlag | VacationHours | SickLeaveHours | CurrentFlag | rowguid | ModifiedDate |
|---|
| 1
| 295847284
| adventure-works\ken0
| /
| 0
| Chief Executive Officer
| 3/2/1959 12:00:00 AM
| S
| M
| 2/15/1999 12:00:00 AM
| True
| 99
| 69
| True
| f01251e5-96a3-448d-981e-0f99d789110d
| 7/31/2004 12:00:00 AM
|
| 2
| 245797967
| adventure-works\terri0
| /1/
| 1
| Vice President of Engineering
| 9/1/1961 12:00:00 AM
| S
| F
| 3/3/1998 12:00:00 AM
| True
| 1
| 20
| True
| 45e8f437-670d-4409-93cb-f9424a40d6ee
| 7/31/2004 12:00:00 AM
|
| 3
| 509647174
| adventure-works\roberto0
| /1/1/
| 2
| Engineering Manager
| 12/13/1964 12:00:00 AM
| M
| M
| 12/12/1997 12:00:00 AM
| True
| 2
| 21
| True
| 9bbbfb2c-efbb-4217-9ab7-f97689328841
| 7/31/2004 12:00:00 AM
|
| 4
| 112457891
| adventure-works\rob0
| /1/1/1/
| 3
| Senior Tool Designer
| 1/23/1965 12:00:00 AM
| S
| M
| 1/5/1998 12:00:00 AM
| False
| 48
| 80
| True
| 59747955-87b8-443f-8ed4-f8ad3afdf3a9
| 7/31/2004 12:00:00 AM
|
| 5
| 695256908
| adventure-works\gail0
| /1/1/2/
| 3
| Design Engineer
| 10/29/1942 12:00:00 AM
| M
| F
| 2/6/1998 12:00:00 AM
| True
| 5
| 22
| True
| ec84ae09-f9b8-4a15-b4a9-6ccbab919b08
| 7/31/2004 12:00:00 AM
|
| 6
| 998320692
| adventure-works\jossef0
| /1/1/3/
| 3
| Design Engineer
| 4/11/1949 12:00:00 AM
| M
| M
| 2/24/1998 12:00:00 AM
| True
| 6
| 23
| True
| e39056f1-9cd5-478d-8945-14aca7fbdcdd
| 7/31/2004 12:00:00 AM
|
| 7
| 134969118
| adventure-works\dylan0
| /1/1/4/
| 3
| Research and Development Manager
| 3/27/1977 12:00:00 AM
| M
| M
| 3/12/1999 12:00:00 AM
| True
| 61
| 50
| True
| 4f46deca-ef01-41fd-9829-0adab368e431
| 7/31/2004 12:00:00 AM
|
| 8
| 811994146
| adventure-works\diane1
| /1/1/4/1/
| 4
| Research and Development Engineer
| 7/6/1976 12:00:00 AM
| S
| F
| 1/30/1999 12:00:00 AM
| True
| 62
| 51
| True
| 31112635-663b-4018-b4a2-a685c0bf48a4
| 7/31/2004 12:00:00 AM
|
| 9
| 658797903
| adventure-works\gigi0
| /1/1/4/2/
| 4
| Research and Development Engineer
| 2/21/1969 12:00:00 AM
| M
| F
| 2/17/1999 12:00:00 AM
| True
| 63
| 51
| True
| 50b6cdc6-7570-47ef-9570-48a64b5f2ecf
| 7/31/2004 12:00:00 AM
|
| 10
| 879342154
| adventure-works\michael6
| /1/1/4/3/
| 4
| Research and Development Manager
| 1/1/1975 12:00:00 AM
| M
| M
| 6/4/1999 12:00:00 AM
| True
| 16
| 64
| True
| eaa43680-5571-40cb-ab1a-3bf68f04459e
| 7/31/2004 12:00:00 AM
|
Code
SET ARITHABORT ON
CREATE TABLE [HumanResources].[Employee](
[BusinessEntityID] [int] NOT NULL,
[NationalIDNumber] [nvarchar](15) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[LoginID] [nvarchar](256) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[BusinessEntityID] [int] NOT NULL,
[NationalIDNumber] [nvarchar](15) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[OrganizationNode] [hierarchyid] NULL,
[OrganizationLevel] AS ([OrganizationNode].[GetLevel]()),
[JobTitle] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[BirthDate] [date] NOT NULL,
[MaritalStatus] [nchar](1) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[Gender] [nchar](1) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[HireDate] [date] NOT NULL,
[SalariedFlag] [dbo].[Flag] NOT NULL,
[VacationHours] [smallint] NOT NULL,
[SickLeaveHours] [smallint] NOT NULL,
[CurrentFlag] [dbo].[Flag] NOT NULL,
[rowguid] [uniqueidentifier] ROWGUIDCOL NOT NULL,
[ModifiedDate] [datetime] NOT NULL,
CONSTRAINT [PK_Employee_BusinessEntityID] PRIMARY KEY CLUSTERED
(
[BusinessEntityID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
ALTER TABLE [HumanResources].[Employee] WITH CHECK ADD CONSTRAINT [FK_Employee_Person_BusinessEntityID] FOREIGN KEY([BusinessEntityID])
REFERENCES [Person].[Person] ([BusinessEntityID])
ALTER TABLE [HumanResources].[Employee] CHECK CONSTRAINT [FK_Employee_Person_BusinessEntityID]
ALTER TABLE [HumanResources].[Employee] WITH CHECK ADD CONSTRAINT [CK_Employee_BirthDate] CHECK (([BirthDate]>='1930-01-01' AND [BirthDate]<=dateadd(year,(-18),getdate())))
ALTER TABLE [HumanResources].[Employee] CHECK CONSTRAINT [CK_Employee_BirthDate]
ALTER TABLE [HumanResources].[Employee] WITH CHECK ADD CONSTRAINT [CK_Employee_Gender] CHECK ((upper([Gender])='F' OR upper([Gender])='M'))
ALTER TABLE [HumanResources].[Employee] CHECK CONSTRAINT [CK_Employee_Gender]
ALTER TABLE [HumanResources].[Employee] WITH CHECK ADD CONSTRAINT [CK_Employee_HireDate] CHECK (([HireDate]>='1996-07-01' AND [HireDate]<=dateadd(day,(1),getdate())))
ALTER TABLE [HumanResources].[Employee] CHECK CONSTRAINT [CK_Employee_HireDate]
ALTER TABLE [HumanResources].[Employee] WITH CHECK ADD CONSTRAINT [CK_Employee_MaritalStatus] CHECK ((upper([MaritalStatus])='S' OR upper([MaritalStatus])='M'))
ALTER TABLE [HumanResources].[Employee] CHECK CONSTRAINT [CK_Employee_MaritalStatus]
ALTER TABLE [HumanResources].[Employee] WITH CHECK ADD CONSTRAINT [CK_Employee_SickLeaveHours] CHECK (([SickLeaveHours]>=(0) AND [SickLeaveHours]<=(120)))
ALTER TABLE [HumanResources].[Employee] CHECK CONSTRAINT [CK_Employee_SickLeaveHours]
ALTER TABLE [HumanResources].[Employee] WITH CHECK ADD CONSTRAINT [CK_Employee_VacationHours] CHECK (([VacationHours]>=(-40) AND [VacationHours]<=(240)))
ALTER TABLE [HumanResources].[Employee] CHECK CONSTRAINT [CK_Employee_VacationHours]
ALTER TABLE [HumanResources].[Employee] ADD CONSTRAINT [DF_Employee_SalariedFlag] DEFAULT ((1)) FOR [SalariedFlag]
ALTER TABLE [HumanResources].[Employee] ADD CONSTRAINT [DF_Employee_VacationHours] DEFAULT ((0)) FOR [VacationHours]
ALTER TABLE [HumanResources].[Employee] ADD CONSTRAINT [DF_Employee_SickLeaveHours] DEFAULT ((0)) FOR [SickLeaveHours]
ALTER TABLE [HumanResources].[Employee] ADD CONSTRAINT [DF_Employee_CurrentFlag] DEFAULT ((1)) FOR [CurrentFlag]
ALTER TABLE [HumanResources].[Employee] ADD CONSTRAINT [DF_Employee_rowguid] DEFAULT (newid()) FOR [rowguid]
ALTER TABLE [HumanResources].[Employee] ADD CONSTRAINT [DF_Employee_ModifiedDate] DEFAULT (getdate()) FOR [ModifiedDate]