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
Name | Type | Default | Nullable | Children | Parents | Comment |
---|---|---|---|---|---|---|
CustomerId | INTEGER | false | Invoice | |||
FirstName | NVARCHAR(40) | false | ||||
LastName | NVARCHAR(20) | false | ||||
Company | NVARCHAR(80) | true | ||||
Address | NVARCHAR(70) | true | ||||
City | NVARCHAR(40) | true | ||||
State | NVARCHAR(40) | true | ||||
Country | NVARCHAR(40) | true | ||||
PostalCode | NVARCHAR(10) | true | ||||
Phone | NVARCHAR(24) | true | ||||
Fax | NVARCHAR(24) | true | ||||
NVARCHAR(60) | false | |||||
SupportRepId | INTEGER | true | Employee |
Constraints
Name | Type | Definition |
---|---|---|
CustomerId | PRIMARY KEY | PRIMARY KEY (CustomerId) |
- (Foreign key ID: 0) | FOREIGN KEY | FOREIGN KEY (SupportRepId) REFERENCES Employee (EmployeeId) ON UPDATE NO ACTION ON DELETE NO ACTION MATCH NONE |
Indexes
Name | Definition |
---|---|
IFK_CustomerSupportRepId | CREATE INDEX [IFK_CustomerSupportRepId] ON [Customer] ([SupportRepId]) |