Invoice
Description
Table Definition
CREATE TABLE [Invoice]
(
[InvoiceId] INTEGER NOT NULL,
[CustomerId] INTEGER NOT NULL,
[InvoiceDate] DATETIME NOT NULL,
[BillingAddress] NVARCHAR(70),
[BillingCity] NVARCHAR(40),
[BillingState] NVARCHAR(40),
[BillingCountry] NVARCHAR(40),
[BillingPostalCode] NVARCHAR(10),
[Total] NUMERIC(10,2) NOT NULL,
CONSTRAINT [PK_Invoice] PRIMARY KEY ([InvoiceId]),
FOREIGN KEY ([CustomerId]) REFERENCES [Customer] ([CustomerId])
ON DELETE NO ACTION ON UPDATE NO ACTION
)
Columns
Name | Type | Default | Nullable | Children | Parents | Comment |
---|---|---|---|---|---|---|
InvoiceId | INTEGER | false | InvoiceLine | |||
CustomerId | INTEGER | false | Customer | |||
InvoiceDate | DATETIME | false | ||||
BillingAddress | NVARCHAR(70) | true | ||||
BillingCity | NVARCHAR(40) | true | ||||
BillingState | NVARCHAR(40) | true | ||||
BillingCountry | NVARCHAR(40) | true | ||||
BillingPostalCode | NVARCHAR(10) | true | ||||
Total | NUMERIC(10,2) | false |
Constraints
Name | Type | Definition |
---|---|---|
InvoiceId | PRIMARY KEY | PRIMARY KEY (InvoiceId) |
- (Foreign key ID: 0) | FOREIGN KEY | FOREIGN KEY (CustomerId) REFERENCES Customer (CustomerId) ON UPDATE NO ACTION ON DELETE NO ACTION MATCH NONE |
Indexes
Name | Definition |
---|---|
IFK_InvoiceCustomerId | CREATE INDEX [IFK_InvoiceCustomerId] ON [Invoice] ([CustomerId]) |