HumanResources |
04/26/2006 |
PRIMARY |
56 |
120 |
290 |
Employee information such as salary, department, and title. |
|
|
EmployeeID |
int |
4 |
|
|
|
|
Primary key for Employee records. |
|
|
NationalIDNumber |
nvarchar |
15 |
|
|
|
|
Unique national identification number such as a social security number. |
|
|
ContactID |
int |
4 |
|
|
|
|
Identifies the employee in the Contact table. Foreign key to Contact.ContactID. |
|
|
LoginID |
nvarchar |
256 |
|
|
|
|
Network login. |
|
|
ManagerID |
int |
4 |
|
|
|
|
Manager to whom the employee is assigned. Foreign Key to Employee.M |
|
|
Title |
nvarchar |
50 |
|
|
|
|
Work title such as Buyer or Sales Representative. |
|
|
BirthDate |
datetime |
8 |
|
|
|
|
Date of birth. |
|
|
MaritalStatus |
nchar |
1 |
|
|
|
|
M = Married, S = Single |
|
|
Gender |
nchar |
1 |
|
|
|
|
M = Male, F = Female |
|
|
HireDate |
datetime |
8 |
|
|
|
|
Employee hired on this date. |
|
|
SalariedFlag |
Flag |
1 |
|
((1)) |
|
|
Job classification. 0 = Hourly, not exempt from collective bargaining. 1 = Salaried, exempt from collective bargaining. |
|
|
VacationHours |
smallint |
2 |
|
((0)) |
|
|
Number of available vacation hours. |
|
|
SickLeaveHours |
smallint |
2 |
|
((0)) |
|
|
Number of available sick leave hours. |
|
|
CurrentFlag |
Flag |
1 |
|
((1)) |
|
|
0 = Inactive, 1 = Active |
|
|
rowguid |
uniqueidentifier |
16 |
|
(newid()) |
|
|
ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. |
|
|
ModifiedDate |
datetime |
8 |
|
(getdate()) |
|
|
Date and time the record was last updated. |
Total: 16 column(s)
|
EmployeeID |
1 |
1 |
|
Total: 5 index(es)
Total: 1 trigger(s)
|
CK_Employee_BirthDate |
([BirthDate]>='1930-01-01' AND [BirthDate]<=dateadd(year,(-18),getdate())) |
|
CK_Employee_Gender |
(upper([Gender])='F' OR upper([Gender])='M') |
|
CK_Employee_HireDate |
([HireDate]>='1996-07-01' AND [HireDate]<=dateadd(day,(1),getdate())) |
|
CK_Employee_MaritalStatus |
(upper([MaritalStatus])='S' OR upper([MaritalStatus])='M') |
|
CK_Employee_SickLeaveHours |
([SickLeaveHours]>=(0) AND [SickLeaveHours]<=(120)) |
|
CK_Employee_VacationHours |
([VacationHours]>=(-40) AND [VacationHours]<=(240)) |
Total: 6 constraint(s)
Total: 7 table(s)
Total: 2 table(s)
Total: 5 object(s)
Total: 37 object(s)
CREATE TABLE [Employee] (
[EmployeeID] [int] IDENTITY (1, 1) NOT NULL ,
[NationalIDNumber] [nvarchar] (15) COLLATE Latin1_General_CS_AS NOT NULL ,
[ContactID] [int] NOT NULL ,
[LoginID] [nvarchar] (256) COLLATE Latin1_General_CS_AS NOT NULL ,
[ManagerID] [int] NULL ,
[Title] [nvarchar] (50) COLLATE Latin1_General_CS_AS NOT NULL ,
[BirthDate] [datetime] NOT NULL ,
[MaritalStatus] [nchar] (1) COLLATE Latin1_General_CS_AS NOT NULL ,
[Gender] [nchar] (1) COLLATE Latin1_General_CS_AS NOT NULL ,
[HireDate] [datetime] NOT NULL ,
[SalariedFlag] [Flag] NOT NULL CONSTRAINT [DF_Employee_SalariedFlag] DEFAULT ((1)),
[VacationHours] [smallint] NOT NULL CONSTRAINT [DF_Employee_VacationHours] DEFAULT ((0)),
[SickLeaveHours] [smallint] NOT NULL CONSTRAINT [DF_Employee_SickLeaveHours] DEFAULT ((0)),
[CurrentFlag] [Flag] NOT NULL CONSTRAINT [DF_Employee_CurrentFlag] DEFAULT ((1)),
[rowguid] uniqueidentifier ROWGUIDCOL NOT NULL CONSTRAINT [DF_Employee_rowguid] DEFAULT (newid()),
[ModifiedDate] [datetime] NOT NULL CONSTRAINT [DF_Employee_ModifiedDate] DEFAULT (getdate()),
CONSTRAINT [PK_Employee_EmployeeID] PRIMARY KEY CLUSTERED
(
[EmployeeID]
) ON [PRIMARY] ,
CONSTRAINT [FK_Employee_Contact_ContactID] FOREIGN KEY
(
[ContactID]
) REFERENCES [Contact] (
[ContactID]
),
CONSTRAINT [FK_Employee_Employee_ManagerID] FOREIGN KEY
(
[ManagerID]
) REFERENCES [Employee] (
[EmployeeID]
),
CONSTRAINT [CK_Employee_BirthDate] CHECK ([BirthDate]>='1930-01-01' AND [BirthDate]<=dateadd(year,(-18),getdate())),
CONSTRAINT [CK_Employee_Gender] CHECK (upper([Gender])='F' OR upper([Gender])='M'),
CONSTRAINT [CK_Employee_HireDate] CHECK ([HireDate]>='1996-07-01' AND [HireDate]<=dateadd(day,(1),getdate())),
CONSTRAINT [CK_Employee_MaritalStatus] CHECK (upper([MaritalStatus])='S' OR upper([MaritalStatus])='M'),
CONSTRAINT [CK_Employee_SickLeaveHours] CHECK ([SickLeaveHours]>=(0) AND [SickLeaveHours]<=(120)),
CONSTRAINT [CK_Employee_VacationHours] CHECK ([VacationHours]>=(-40) AND [VacationHours]<=(240))
) ON [PRIMARY]
GO
List of tables