Skip to main content

Employee

Description

Table Definition
CREATE TABLE [Employee]
(
[EmployeeId] INTEGER NOT NULL,
[LastName] NVARCHAR(20) NOT NULL,
[FirstName] NVARCHAR(20) NOT NULL,
[Title] NVARCHAR(30),
[ReportsTo] INTEGER,
[BirthDate] DATETIME,
[HireDate] DATETIME,
[Address] NVARCHAR(70),
[City] NVARCHAR(40),
[State] NVARCHAR(40),
[Country] NVARCHAR(40),
[PostalCode] NVARCHAR(10),
[Phone] NVARCHAR(24),
[Fax] NVARCHAR(24),
[Email] NVARCHAR(60),
CONSTRAINT [PK_Employee] PRIMARY KEY ([EmployeeId]),
FOREIGN KEY ([ReportsTo]) REFERENCES [Employee] ([EmployeeId])
ON DELETE NO ACTION ON UPDATE NO ACTION
)

Columns

NameTypeDefaultNullableChildrenParentsComment
EmployeeIdINTEGERfalseCustomer Employee
LastNameNVARCHAR(20)false
FirstNameNVARCHAR(20)false
TitleNVARCHAR(30)true
ReportsToINTEGERtrueEmployee
BirthDateDATETIMEtrue
HireDateDATETIMEtrue
AddressNVARCHAR(70)true
CityNVARCHAR(40)true
StateNVARCHAR(40)true
CountryNVARCHAR(40)true
PostalCodeNVARCHAR(10)true
PhoneNVARCHAR(24)true
FaxNVARCHAR(24)true
EmailNVARCHAR(60)true

Constraints

NameTypeDefinition
EmployeeIdPRIMARY KEYPRIMARY KEY (EmployeeId)
- (Foreign key ID: 0)FOREIGN KEYFOREIGN KEY (ReportsTo) REFERENCES Employee (EmployeeId) ON UPDATE NO ACTION ON DELETE NO ACTION MATCH NONE

Indexes

NameDefinition
IFK_EmployeeReportsToCREATE INDEX [IFK_EmployeeReportsTo] ON [Employee] ([ReportsTo])

Relations

er