Skip to main content

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

NameTypeDefaultNullableChildrenParentsComment
InvoiceIdINTEGERfalseInvoiceLine
CustomerIdINTEGERfalseCustomer
InvoiceDateDATETIMEfalse
BillingAddressNVARCHAR(70)true
BillingCityNVARCHAR(40)true
BillingStateNVARCHAR(40)true
BillingCountryNVARCHAR(40)true
BillingPostalCodeNVARCHAR(10)true
TotalNUMERIC(10,2)false

Constraints

NameTypeDefinition
InvoiceIdPRIMARY KEYPRIMARY KEY (InvoiceId)
- (Foreign key ID: 0)FOREIGN KEYFOREIGN KEY (CustomerId) REFERENCES Customer (CustomerId) ON UPDATE NO ACTION ON DELETE NO ACTION MATCH NONE

Indexes

NameDefinition
IFK_InvoiceCustomerIdCREATE INDEX [IFK_InvoiceCustomerId] ON [Invoice] ([CustomerId])

Relations

er