Skip to main content

Customer

Description

Table Definition
CREATE TABLE [Customer]
(
[CustomerId] INTEGER NOT NULL,
[FirstName] NVARCHAR(40) NOT NULL,
[LastName] NVARCHAR(20) NOT NULL,
[Company] NVARCHAR(80),
[Address] NVARCHAR(70),
[City] NVARCHAR(40),
[State] NVARCHAR(40),
[Country] NVARCHAR(40),
[PostalCode] NVARCHAR(10),
[Phone] NVARCHAR(24),
[Fax] NVARCHAR(24),
[Email] NVARCHAR(60) NOT NULL,
[SupportRepId] INTEGER,
CONSTRAINT [PK_Customer] PRIMARY KEY ([CustomerId]),
FOREIGN KEY ([SupportRepId]) REFERENCES [Employee] ([EmployeeId])
ON DELETE NO ACTION ON UPDATE NO ACTION
)

Columns

NameTypeDefaultNullableChildrenParentsComment
CustomerIdINTEGERfalseInvoice
FirstNameNVARCHAR(40)false
LastNameNVARCHAR(20)false
CompanyNVARCHAR(80)true
AddressNVARCHAR(70)true
CityNVARCHAR(40)true
StateNVARCHAR(40)true
CountryNVARCHAR(40)true
PostalCodeNVARCHAR(10)true
PhoneNVARCHAR(24)true
FaxNVARCHAR(24)true
EmailNVARCHAR(60)false
SupportRepIdINTEGERtrueEmployee

Constraints

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

Indexes

NameDefinition
IFK_CustomerSupportRepIdCREATE INDEX [IFK_CustomerSupportRepId] ON [Customer] ([SupportRepId])

Relations

er