AdventureWorks

Basic Index   Expanded Index

Table Name:HumanResources.EmployeePayHistory
Description:Employee pay history.
Primary Keys:EmployeeID
RateChangeDate
FieldTypeDefaultsNulls?Comments
EmployeeIDintNoneNoEmployee identification number. Foreign key to Employee.EmployeeID.
RateChangeDatedatetimeNoneNoDate the change in pay is effective
RatemoneyNoneNoSalary hourly rate.
PayFrequencytinyintNoneNo1 = Salary received monthly, 2 = Salary received biweekly
ModifiedDatedatetime(getdate())NoDate and time the record was last updated.

IndexClustered?Unique?Fields
PK_EmployeePayHistory_EmployeeID_RateChangeDateYesYesEmployeeID
RateChangeDate

Check ConstraintText
CK_EmployeePayHistory_PayFrequency([PayFrequency]=(2) OR [PayFrequency]=(1))
CK_EmployeePayHistory_Rate([Rate]>=(6.50) AND [Rate]<=(200.00))

Internal Foreign Key ConstraintAffected FieldSource Table
FK_EmployeePayHistory_Employee_EmployeeIDEmployeeIDHumanResources.Employee

No primary keys as foreign key constraints
No triggers