Description
Employee pay history.
Table properties
| name | value |
|---|
| name | [HumanResources].[EmployeePayHistory] |
| created | Mar 19 2009 9:08PM |
| modified | Mar 19 2009 9:08PM
|
| ansi nulls | on
|
| quoted identifier | on
|
| row count | 316 |
| Size of data | 16 kb |
| Size of indexes | 16 kb |
| Maximum size of a single row | 29 bytes |
Columns
| column | datatype | length | bytes | default | nulls | PK | FK | UQ | computed | comment |
|---|
| EmployeeID | int | 10 | 4 | | no
| composite PK
| Employee.EmployeeID
|
| no
| Employee identification number. Foreign key to Employee.EmployeeID.
|
| RateChangeDate | datetime | 23 | 8 | | no
| composite PK
| |
| no
| Date the change in pay is effective
|
| Rate | money | 19 | 8 | | no
|
| |
| no
| Salary hourly rate.
|
| PayFrequency | tinyint | 3 | 1 | | no
|
| |
| no
| 1 = Salary received monthly, 2 = Salary received biweekly
|
| ModifiedDate | datetime | 23 | 8 | (getdate()) | no
|
| |
| no
| Date and time the record was last updated.
|
Indexes
References
Foreign key graph
Foreign keys
| name | columns | foreign columns | type | comment |
|---|
| FK_EmployeePayHistory_Employee_EmployeeID | EmployeeID | Employee.EmployeeID |
| Foreign key constraint referencing Employee.EmployeeID.
|
Check constraints
| name | column | comment |
|---|
CK_EmployeePayHistory_PayFrequency([PayFrequency]=(2) OR [PayFrequency]=(1)) | PayFrequency
| Check constraint [PayFrequency]=(3) OR [PayFrequency]=(2) OR [PayFrequency]=(1)
|
CK_EmployeePayHistory_Rate([Rate]>=(6.50) AND [Rate]<=(200.00)) | Rate
| Check constraint [Rate] >= (6.50) AND [Rate] <= (200.00)
|
Defaults
Dependency graph
Objects that depend on [HumanResources].[EmployeePayHistory]
Sample rows
| EmployeeID | RateChangeDate | Rate | PayFrequency | ModifiedDate |
|---|
| 1
| 7/31/1996 12:00:00 AM
| 12.4500
| 1
| 7/31/2004 12:00:00 AM
|
| 2
| 2/26/1997 12:00:00 AM
| 13.4615
| 2
| 7/31/2004 12:00:00 AM
|
| 3
| 12/12/1997 12:00:00 AM
| 43.2692
| 2
| 7/31/2004 12:00:00 AM
|
| 4
| 1/5/1998 12:00:00 AM
| 8.6200
| 2
| 12/22/1997 12:00:00 AM
|
| 4
| 7/1/2000 12:00:00 AM
| 23.7200
| 2
| 6/16/2000 12:00:00 AM
|
| 4
| 1/15/2002 12:00:00 AM
| 29.8462
| 2
| 1/1/2002 12:00:00 AM
|
| 5
| 1/11/1998 12:00:00 AM
| 25.0000
| 2
| 7/31/2004 12:00:00 AM
|
| 6
| 1/20/1998 12:00:00 AM
| 24.0000
| 2
| 1/6/1998 12:00:00 AM
|
| 6
| 8/16/1999 12:00:00 AM
| 28.7500
| 2
| 8/2/1999 12:00:00 AM
|
| 6
| 6/1/2002 12:00:00 AM
| 37.5000
| 2
| 5/18/2002 12:00:00 AM
|
Code
CREATE TABLE [HumanResources].[EmployeePayHistory](
[EmployeeID] [int] NOT NULL,
[RateChangeDate] [datetime] NOT NULL,
[Rate] [money] NOT NULL,
[PayFrequency] [tinyint] NOT NULL,
[ModifiedDate] [datetime] NOT NULL,
CONSTRAINT [PK_EmployeePayHistory_EmployeeID_RateChangeDate] PRIMARY KEY CLUSTERED
(
[EmployeeID] ASC,
[RateChangeDate] 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].[EmployeePayHistory] WITH CHECK ADD CONSTRAINT [FK_EmployeePayHistory_Employee_EmployeeID] FOREIGN KEY([EmployeeID])
REFERENCES [HumanResources].[Employee] ([EmployeeID])
ALTER TABLE [HumanResources].[EmployeePayHistory] CHECK CONSTRAINT [FK_EmployeePayHistory_Employee_EmployeeID]
ALTER TABLE [HumanResources].[EmployeePayHistory] WITH CHECK ADD CONSTRAINT [CK_EmployeePayHistory_PayFrequency] CHECK (([PayFrequency]=(2) OR [PayFrequency]=(1)))
ALTER TABLE [HumanResources].[EmployeePayHistory] CHECK CONSTRAINT [CK_EmployeePayHistory_PayFrequency]
ALTER TABLE [HumanResources].[EmployeePayHistory] WITH CHECK ADD CONSTRAINT [CK_EmployeePayHistory_Rate] CHECK (([Rate]>=(6.50) AND [Rate]<=(200.00)))
ALTER TABLE [HumanResources].[EmployeePayHistory] CHECK CONSTRAINT [CK_EmployeePayHistory_Rate]
ALTER TABLE [HumanResources].[EmployeePayHistory] ADD CONSTRAINT [DF_EmployeePayHistory_ModifiedDate] DEFAULT (getdate()) FOR [ModifiedDate]