1 SalesLT Move the mouse over tables & columns to read the comments. Fk FK_SalesOrderHeader_Address_BillTo_AddressID SalesOrderHeader ref Address ( BillToAddressID -> AddressID ) Fk FK_SalesOrderHeader_Address_ShipTo_AddressID SalesOrderHeader ref Address ( ShipToAddressID -> AddressID ) Fk FK_SalesOrderHeader_Customer_CustomerID SalesOrderHeader ref Customer ( CustomerID ) Fk FK_ProductModelProductDescription_ProductDescription_ProductDescriptionID ProductModelProductDescription ref ProductDescription ( ProductDescriptionID ) Fk FK_ProductModelProductDescription_ProductModel_ProductModelID ProductModelProductDescription ref ProductModel ( ProductModelID ) Fk FK_CustomerAddress_Address_AddressID CustomerAddress ref Address ( AddressID ) Fk FK_CustomerAddress_Customer_CustomerID CustomerAddress ref Customer ( CustomerID ) Fk FK_SalesOrderDetail_Product_ProductID SalesOrderDetail ref Product ( ProductID ) Fk FK_SalesOrderDetail_SalesOrderHeader_SalesOrderID SalesOrderDetail ref SalesOrderHeader ( SalesOrderID ) Cascade Fk FK_Product_ProductCategory_ProductCategoryID Product ref ProductCategory ( ProductCategoryID ) Fk FK_Product_ProductModel_ProductModelID Product ref ProductModel ( ProductModelID ) Fk FK_ProductCategory_ProductCategory_ParentProductCategoryID_ProductCategoryID ProductCategory ref ProductCategory ( ParentProductCategoryID -> ProductCategoryID ) SalesOrderHeaderTable SalesLT.SalesOrderHeader General sales order information. Pk PK_SalesOrderHeader_SalesOrderID ( SalesOrderID ) Clustered index created by a primary key constraint. SalesOrderIDintSalesOrderID * int Primary key. Referred by SalesOrderDetail ( SalesOrderID ) RevisionNumbertinyintRevisionNumber * tinyint default 0 Incremental number to track changes to the sales order over time. # OrderDatedatetimeOrderDate * datetime default getdate() Dates the sales order was created. d DueDatedatetimeDueDate * datetime Date the order is due to the customer. d ShipDatedatetimeShipDate datetime Date the order was shipped to the customer. d StatustinyintStatus * tinyint default 1 Order current status. 1 = In process; 2 = Approved; 3 = Backordered; 4 = Rejected; 5 = Shipped; 6 = Cancelled # OnlineOrderFlagflagOnlineOrderFlag * flag default 1 0 = Order placed by sales person. 1 = Order placed online by customer. b Unq AK_SalesOrderHeader_SalesOrderNumber ( SalesOrderNumber ) SalesOrderNumbernvarchar(25)SalesOrderNumber * nvarchar(25) Unique sales order identification number. t PurchaseOrderNumberordernumberPurchaseOrderNumber ordernumber Customer purchase order number reference. t AccountNumberaccountnumberAccountNumber accountnumber Financial accounting number reference. t IX_SalesOrderHeader_CustomerID ( CustomerID ) Nonclustered index. CustomerIDintCustomerID * int Customer identification number. Foreign key to Customer.CustomerID. References Customer ( CustomerID ) ShipToAddressIDintShipToAddressID int The ID of the location to send goods. Foreign key to the Address table. References Address ( ShipToAddressID -> AddressID ) BillToAddressIDintBillToAddressID int The ID of the location to send invoices. Foreign key to the Address table. References Address ( BillToAddressID -> AddressID ) ShipMethodnvarchar(50)ShipMethod * nvarchar(50) Shipping method. Foreign key to ShipMethod.ShipMethodID. t CreditCardApprovalCodevarchar(15)CreditCardApprovalCode varchar(15) Approval code provided by the credit card company. t SubTotalmoneySubTotal * money default 0.00 Sales subtotal. Computed as SUM(SalesOrderDetail.LineTotal)for the appropriate SalesOrderID. # TaxAmtmoneyTaxAmt * money default 0.00 Tax amount. # FreightmoneyFreight * money default 0.00 Shipping cost. # TotalDuemoneyTotalDue * money Total due from customer. Computed as Subtotal + TaxAmt + Freight. # Commentnvarchar(max)Comment nvarchar(max) Sales representative comments. t Unq AK_SalesOrderHeader_rowguid ( rowguid ) rowguiduniqueidentifierrowguid * uniqueidentifier default newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. c ModifiedDatedatetimeModifiedDate * datetime default getdate() Date and time the record was last updated. d ProductModelProductDescriptionTable SalesLT.ProductModelProductDescription Cross-reference table mapping product descriptions and the language the description is written in. Pk PK_ProductModelProductDescription_ProductModelID_ProductDescriptionID_Culture ( ProductModelID, ProductDescriptionID, Culture ) Clustered index created by a primary key constraint. ProductModelIDintProductModelID * int Primary key. Foreign key to ProductModel.ProductModelID. References ProductModel ( ProductModelID ) Pk PK_ProductModelProductDescription_ProductModelID_ProductDescriptionID_Culture ( ProductModelID, ProductDescriptionID, Culture ) Clustered index created by a primary key constraint. ProductDescriptionIDintProductDescriptionID * int Primary key. Foreign key to ProductDescription.ProductDescriptionID. References ProductDescription ( ProductDescriptionID ) Pk PK_ProductModelProductDescription_ProductModelID_ProductDescriptionID_Culture ( ProductModelID, ProductDescriptionID, Culture ) Clustered index created by a primary key constraint. Culturenchar(6)Culture * nchar(6) The culture for which the description is written c Unq AK_ProductModelProductDescription_rowguid ( rowguid ) rowguiduniqueidentifierrowguid * uniqueidentifier default newid() c ModifiedDatedatetimeModifiedDate * datetime default getdate() Date and time the record was last updated. d ProductDescriptionTable SalesLT.ProductDescription Product descriptions in several languages. Pk PK_ProductDescription_ProductDescriptionID ( ProductDescriptionID ) Clustered index created by a primary key constraint. ProductDescriptionIDintProductDescriptionID * int Primary key for ProductDescription records. Referred by ProductModelProductDescription ( ProductDescriptionID ) Descriptionnvarchar(400)Description * nvarchar(400) Description of the product. t Unq AK_ProductDescription_rowguid ( rowguid ) rowguiduniqueidentifierrowguid * uniqueidentifier default newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. c ModifiedDatedatetimeModifiedDate * datetime default getdate() Date and time the record was last updated. d CustomerTable SalesLT.Customer Customer information. Pk PK_Customer_CustomerID ( CustomerID ) Clustered index created by a primary key constraint. CustomerIDintCustomerID * int Primary key for Customer records. Referred by CustomerAddress ( CustomerID ) Referred by SalesOrderHeader ( CustomerID ) NameStylenamestyleNameStyle * namestyle default 0 0 = The data in FirstName and LastName are stored in western style (first name, last name) order. 1 = Eastern style (last name, first name) order. b Titlenvarchar(8)Title nvarchar(8) A courtesy title. For example, Mr. or Ms. t FirstNamenameFirstName * name First name of the person. t MiddleNamenameMiddleName name Middle name or middle initial of the person. t LastNamenameLastName * name Last name of the person. t Suffixnvarchar(10)Suffix nvarchar(10) Surname suffix. For example, Sr. or Jr. t CompanyNamenvarchar(128)CompanyName nvarchar(128) The customer's organization. t SalesPersonnvarchar(256)SalesPerson nvarchar(256) The customer's sales person, an employee of AdventureWorks Cycles. t IX_Customer_EmailAddress ( EmailAddress ) Nonclustered index. EmailAddressnvarchar(50)EmailAddress nvarchar(50) E-mail address for the person. t PhonephonePhone phone Phone number associated with the person. t PasswordHashvarchar(128)PasswordHash * varchar(128) Password for the e-mail account. t PasswordSaltvarchar(10)PasswordSalt * varchar(10) Random value concatenated with the password string before the password is hashed. t Unq AK_Customer_rowguid ( rowguid ) rowguiduniqueidentifierrowguid * uniqueidentifier default newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. c ModifiedDatedatetimeModifiedDate * datetime default getdate() Date and time the record was last updated. d CustomerAddressTable SalesLT.CustomerAddress Cross-reference table mapping customers to their address(es). Pk PK_CustomerAddress_CustomerID_AddressID ( CustomerID, AddressID ) CustomerIDintCustomerID * int Primary key. Foreign key to Customer.CustomerID. References Customer ( CustomerID ) Pk PK_CustomerAddress_CustomerID_AddressID ( CustomerID, AddressID ) AddressIDintAddressID * int Primary key. Foreign key to Address.AddressID. References Address ( AddressID ) AddressTypenameAddressType * name The kind of Address. One of: Archive, Billing, Home, Main Office, Primary, Shipping t Unq AK_CustomerAddress_rowguid ( rowguid ) rowguiduniqueidentifierrowguid * uniqueidentifier default newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. c ModifiedDatedatetimeModifiedDate * datetime default getdate() Date and time the record was last updated. d AddressTable SalesLT.Address Street address information for customers. Pk PK_Address_AddressID ( AddressID ) Clustered index created by a primary key constraint. AddressIDintAddressID * int Primary key for Address records. Referred by CustomerAddress ( AddressID ) Referred by SalesOrderHeader ( BillToAddressID -> AddressID ) Referred by SalesOrderHeader ( ShipToAddressID -> AddressID ) IX_Address_AddressLine1_AddressLine2_City_StateProvince_PostalCode_CountryRegion ( AddressLine1, AddressLine2, City, StateProvince, PostalCode, CountryRegion ) Nonclustered index. AddressLine1nvarchar(60)AddressLine1 * nvarchar(60) First street address line. t IX_Address_AddressLine1_AddressLine2_City_StateProvince_PostalCode_CountryRegion ( AddressLine1, AddressLine2, City, StateProvince, PostalCode, CountryRegion ) Nonclustered index. AddressLine2nvarchar(60)AddressLine2 nvarchar(60) Second street address line. t IX_Address_AddressLine1_AddressLine2_City_StateProvince_PostalCode_CountryRegion ( AddressLine1, AddressLine2, City, StateProvince, PostalCode, CountryRegion ) Nonclustered index. Citynvarchar(30)City * nvarchar(30) Name of the city. t IX_Address_AddressLine1_AddressLine2_City_StateProvince_PostalCode_CountryRegion ( AddressLine1, AddressLine2, City, StateProvince, PostalCode, CountryRegion ) Nonclustered index.IX_Address_StateProvince ( StateProvince ) Nonclustered index. StateProvincenameStateProvince * name Name of state or province. t IX_Address_AddressLine1_AddressLine2_City_StateProvince_PostalCode_CountryRegion ( AddressLine1, AddressLine2, City, StateProvince, PostalCode, CountryRegion ) Nonclustered index. CountryRegionnameCountryRegion * name t IX_Address_AddressLine1_AddressLine2_City_StateProvince_PostalCode_CountryRegion ( AddressLine1, AddressLine2, City, StateProvince, PostalCode, CountryRegion ) Nonclustered index. PostalCodenvarchar(15)PostalCode * nvarchar(15) Postal code for the street address. t Unq AK_Address_rowguid ( rowguid ) rowguiduniqueidentifierrowguid * uniqueidentifier default newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. c ModifiedDatedatetimeModifiedDate * datetime default getdate() Date and time the record was last updated. d SalesOrderDetailTable SalesLT.SalesOrderDetail Individual products associated with a specific sales order. See SalesOrderHeader. Pk PK_SalesOrderDetail_SalesOrderID_SalesOrderDetailID ( SalesOrderID, SalesOrderDetailID ) Clustered index created by a primary key constraint. SalesOrderIDintSalesOrderID * int Primary key. Foreign key to SalesOrderHeader.SalesOrderID. References SalesOrderHeader ( SalesOrderID ) Pk PK_SalesOrderDetail_SalesOrderID_SalesOrderDetailID ( SalesOrderID, SalesOrderDetailID ) Clustered index created by a primary key constraint. SalesOrderDetailIDintSalesOrderDetailID * int Primary key. One incremental unique number per product sold. # OrderQtysmallintOrderQty * smallint Quantity ordered per product. # IX_SalesOrderDetail_ProductID ( ProductID ) Nonclustered index. ProductIDintProductID * int Product sold to customer. Foreign key to Product.ProductID. References Product ( ProductID ) UnitPricemoneyUnitPrice * money Selling price of a single product. # UnitPriceDiscountmoneyUnitPriceDiscount * money default 0.0 Discount amount. # LineTotalnumeric(38,6)LineTotal * numeric(38,6) Per product subtotal. Computed as UnitPrice * (1 - UnitPriceDiscount) * OrderQty. # Unq AK_SalesOrderDetail_rowguid ( rowguid ) rowguiduniqueidentifierrowguid * uniqueidentifier default newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. c ModifiedDatedatetimeModifiedDate * datetime default getdate() Date and time the record was last updated. d ProductTable SalesLT.Product Products sold or used in the manfacturing of sold products. Pk PK_Product_ProductID ( ProductID ) Clustered index created by a primary key constraint. ProductIDintProductID * int Primary key for Product records. Referred by SalesOrderDetail ( ProductID ) Unq AK_Product_Name ( Name ) NamenameName * name Name of the product. t Unq AK_Product_ProductNumber ( ProductNumber ) ProductNumbernvarchar(25)ProductNumber * nvarchar(25) Unique product identification number. t Colornvarchar(15)Color nvarchar(15) Product color. t StandardCostmoneyStandardCost * money Standard cost of the product. # ListPricemoneyListPrice * money Selling price. # Sizenvarchar(5)Size nvarchar(5) Product size. t Weightdecimal(8,2)Weight decimal(8,2) Product weight. # ProductCategoryIDintProductCategoryID int Product is a member of this product category. Foreign key to ProductCategory.ProductCategoryID. References ProductCategory ( ProductCategoryID ) ProductModelIDintProductModelID int Product is a member of this product model. Foreign key to ProductModel.ProductModelID. References ProductModel ( ProductModelID ) SellStartDatedatetimeSellStartDate * datetime Date the product was available for sale. d SellEndDatedatetimeSellEndDate datetime Date the product was no longer available for sale. d DiscontinuedDatedatetimeDiscontinuedDate datetime Date the product was discontinued. d ThumbNailPhotovarbinary(max)ThumbNailPhoto varbinary(max) Small image of the product. ~ ThumbnailPhotoFileNamenvarchar(50)ThumbnailPhotoFileName nvarchar(50) Small image file name. t Unq AK_Product_rowguid ( rowguid ) rowguiduniqueidentifierrowguid * uniqueidentifier default newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. c ModifiedDatedatetimeModifiedDate * datetime default getdate() Date and time the record was last updated. d ProductCategoryTable SalesLT.ProductCategory High-level product categorization. Pk PK_ProductCategory_ProductCategoryID ( ProductCategoryID ) Clustered index created by a primary key constraint. ProductCategoryIDintProductCategoryID * int Primary key for ProductCategory records. Referred by ProductCategory ( ParentProductCategoryID -> ProductCategoryID ) Referred by Product ( ProductCategoryID ) ParentProductCategoryIDintParentProductCategoryID int Product category identification number of immediate ancestor category. Foreign key to ProductCategory.ProductCategoryID. References ProductCategory ( ParentProductCategoryID -> ProductCategoryID ) Unq AK_ProductCategory_Name ( Name ) NamenameName * name Category description. t Unq AK_ProductCategory_rowguid ( rowguid ) rowguiduniqueidentifierrowguid * uniqueidentifier default newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. c ModifiedDatedatetimeModifiedDate * datetime default getdate() Date and time the record was last updated. d ProductModelTable SalesLT.ProductModel Pk PK_ProductModel_ProductModelID ( ProductModelID ) Clustered index created by a primary key constraint. ProductModelIDintProductModelID * int Referred by ProductModelProductDescription ( ProductModelID ) Referred by Product ( ProductModelID ) Unq AK_ProductModel_Name ( Name ) NamenameName * name t CatalogDescriptionxmlCatalogDescription xml t Unq AK_ProductModel_rowguid ( rowguid ) rowguiduniqueidentifierrowguid * uniqueidentifier default newid() c ModifiedDatedatetimeModifiedDate * datetime default getdate() d


Table Address

Street address information for customers.

IndexesField NameData TypeDescription
* AddressID int AUTOINCREMENT Primary key for Address records.
* AddressLine1 nvarchar( 60 ) First street address line.
AddressLine2 nvarchar( 60 ) Second street address line.
* City nvarchar( 30 ) Name of the city.
* StateProvince name Name of state or province.
* CountryRegion name
* PostalCode nvarchar( 15 ) Postal code for the street address.
* rowguid uniqueidentifier DEFAULT newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
* ModifiedDate datetime DEFAULT getdate() Date and time the record was last updated.
Indexes
PK_Address_AddressID ON AddressID Clustered index created by a primary key constraint.
AK_Address_rowguid ON rowguid
IX_Address_AddressLine1_AddressLine2_City_StateProvince_PostalCode_CountryRegion ON AddressLine1, AddressLine2, City, StateProvince, PostalCode, CountryRegion Nonclustered index.
IX_Address_StateProvince ON StateProvince Nonclustered index.


Table Customer

Customer information.

IndexesField NameData TypeDescription
* CustomerID int AUTOINCREMENT Primary key for Customer records.
* NameStyle namestyle DEFAULT 0 0 = The data in FirstName and LastName are stored in western style (first name, last name) order. 1 = Eastern style (last name, first name) order.
  Title nvarchar( 8 ) A courtesy title. For example, Mr. or Ms.
* FirstName name First name of the person.
  MiddleName name Middle name or middle initial of the person.
* LastName name Last name of the person.
  Suffix nvarchar( 10 ) Surname suffix. For example, Sr. or Jr.
  CompanyName nvarchar( 128 ) The customer's organization.
  SalesPerson nvarchar( 256 ) The customer's sales person, an employee of AdventureWorks Cycles.
EmailAddress nvarchar( 50 ) E-mail address for the person.
  Phone phone Phone number associated with the person.
* PasswordHash varchar( 128 ) Password for the e-mail account.
* PasswordSalt varchar( 10 ) Random value concatenated with the password string before the password is hashed.
* rowguid uniqueidentifier DEFAULT newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
* ModifiedDate datetime DEFAULT getdate() Date and time the record was last updated.
Indexes
PK_Customer_CustomerID ON CustomerID Clustered index created by a primary key constraint.
AK_Customer_rowguid ON rowguid
IX_Customer_EmailAddress ON EmailAddress Nonclustered index.


Table CustomerAddress

Cross-reference table mapping customers to their address(es).

IndexesField NameData TypeDescription
* CustomerID int Primary key. Foreign key to Customer.CustomerID.
* AddressID int Primary key. Foreign key to Address.AddressID.
* AddressType name The kind of Address. One of: Archive, Billing, Home, Main Office, Primary, Shipping
* rowguid uniqueidentifier DEFAULT newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
* ModifiedDate datetime DEFAULT getdate() Date and time the record was last updated.
Indexes
PK_CustomerAddress_CustomerID_AddressID ON CustomerID, AddressID
AK_CustomerAddress_rowguid ON rowguid
Foreign Keys
FK_CustomerAddress_Address_AddressID ( AddressID ) ref Address (AddressID) Foreign key constraint referencing Address.AddressID.
FK_CustomerAddress_Customer_CustomerID ( CustomerID ) ref Customer (CustomerID) Foreign key constraint referencing Customer.CustomerID.


Table Product

Products sold or used in the manfacturing of sold products.

IndexesField NameData TypeDescription
* ProductID int AUTOINCREMENT Primary key for Product records.
* Name name Name of the product.
* ProductNumber nvarchar( 25 ) Unique product identification number.
  Color nvarchar( 15 ) Product color.
* StandardCost money Standard cost of the product.
* ListPrice money Selling price.
  Size nvarchar( 5 ) Product size.
  Weight decimal( 8, 2 ) Product weight.
ProductCategoryID int Product is a member of this product category. Foreign key to ProductCategory.ProductCategoryID.
ProductModelID int Product is a member of this product model. Foreign key to ProductModel.ProductModelID.
* SellStartDate datetime Date the product was available for sale.
  SellEndDate datetime Date the product was no longer available for sale.
  DiscontinuedDate datetime Date the product was discontinued.
  ThumbNailPhoto varbinary(max) Small image of the product.
  ThumbnailPhotoFileName nvarchar( 50 ) Small image file name.
* rowguid uniqueidentifier DEFAULT newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
* ModifiedDate datetime DEFAULT getdate() Date and time the record was last updated.
Indexes
PK_Product_ProductID ON ProductID Clustered index created by a primary key constraint.
AK_Product_Name ON Name
AK_Product_ProductNumber ON ProductNumber
AK_Product_rowguid ON rowguid
Foreign Keys
FK_Product_ProductCategory_ProductCategoryID ( ProductCategoryID ) ref ProductCategory (ProductCategoryID) Foreign key constraint referencing ProductCategory.ProductCategoryID.
FK_Product_ProductModel_ProductModelID ( ProductModelID ) ref ProductModel (ProductModelID) Foreign key constraint referencing ProductModel.ProductModelID.
Constraints
  CK_Product_StandardCost [StandardCost]>=(0.00)
  CK_Product_ListPrice [ListPrice]>=(0.00)
  CK_Product_Weight [Weight]>(0.00)
  CK_Product_SellEndDate [SellEndDate]>=[SellStartDate] OR [SellEndDate] IS NULL
  CK_Product_SellEndDate [SellEndDate]>=[SellStartDate] OR [SellEndDate] IS NULL


Table ProductCategory

High-level product categorization.

IndexesField NameData TypeDescription
* ProductCategoryID int AUTOINCREMENT Primary key for ProductCategory records.
ParentProductCategoryID int Product category identification number of immediate ancestor category. Foreign key to ProductCategory.ProductCategoryID.
* Name name Category description.
* rowguid uniqueidentifier DEFAULT newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
* ModifiedDate datetime DEFAULT getdate() Date and time the record was last updated.
Indexes
PK_ProductCategory_ProductCategoryID ON ProductCategoryID Clustered index created by a primary key constraint.
AK_ProductCategory_Name ON Name
AK_ProductCategory_rowguid ON rowguid
Foreign Keys
FK_ProductCategory_ProductCategory_ParentProductCategoryID_ProductCategoryID ( ParentProductCategoryID ) ref ProductCategory (ProductCategoryID) Foreign key constraint referencing ProductCategory.ProductCategoryID.


Table ProductDescription

Product descriptions in several languages.

IndexesField NameData TypeDescription
* ProductDescriptionID int AUTOINCREMENT Primary key for ProductDescription records.
* Description nvarchar( 400 ) Description of the product.
* rowguid uniqueidentifier DEFAULT newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
* ModifiedDate datetime DEFAULT getdate() Date and time the record was last updated.
Indexes
PK_ProductDescription_ProductDescriptionID ON ProductDescriptionID Clustered index created by a primary key constraint.
AK_ProductDescription_rowguid ON rowguid


Table ProductModel

IndexesField NameData TypeDescription
* ProductModelID int AUTOINCREMENT
* Name name
  CatalogDescription xml
* rowguid uniqueidentifier DEFAULT newid()
* ModifiedDate datetime DEFAULT getdate()
Indexes
PK_ProductModel_ProductModelID ON ProductModelID Clustered index created by a primary key constraint.
AK_ProductModel_Name ON Name
AK_ProductModel_rowguid ON rowguid


Table ProductModelProductDescription

Cross-reference table mapping product descriptions and the language the description is written in.

IndexesField NameData TypeDescription
* ProductModelID int Primary key. Foreign key to ProductModel.ProductModelID.
* ProductDescriptionID int Primary key. Foreign key to ProductDescription.ProductDescriptionID.
* Culture nchar( 6 ) The culture for which the description is written
* rowguid uniqueidentifier DEFAULT newid()
* ModifiedDate datetime DEFAULT getdate() Date and time the record was last updated.
Indexes
PK_ProductModelProductDescription_ProductModelID_ProductDescriptionID_Culture ON ProductModelID, ProductDescriptionID, Culture Clustered index created by a primary key constraint.
AK_ProductModelProductDescription_rowguid ON rowguid
Foreign Keys
FK_ProductModelProductDescription_ProductDescription_ProductDescriptionID ( ProductDescriptionID ) ref ProductDescription (ProductDescriptionID) Foreign key constraint referencing ProductDescription.ProductDescriptionID.
FK_ProductModelProductDescription_ProductModel_ProductModelID ( ProductModelID ) ref ProductModel (ProductModelID) Foreign key constraint referencing ProductModel.ProductModelID.


Table SalesOrderDetail

Individual products associated with a specific sales order. See SalesOrderHeader.

IndexesField NameData TypeDescription
* SalesOrderID int Primary key. Foreign key to SalesOrderHeader.SalesOrderID.
* SalesOrderDetailID int AUTOINCREMENT Primary key. One incremental unique number per product sold.
* OrderQty smallint Quantity ordered per product.
* ProductID int Product sold to customer. Foreign key to Product.ProductID.
* UnitPrice money Selling price of a single product.
* UnitPriceDiscount money DEFAULT 0.0 Discount amount.
* LineTotal numeric( 38, 6 ) Per product subtotal. Computed as UnitPrice * (1 - UnitPriceDiscount) * OrderQty.
* rowguid uniqueidentifier DEFAULT newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
* ModifiedDate datetime DEFAULT getdate() Date and time the record was last updated.
Indexes
PK_SalesOrderDetail_SalesOrderID_SalesOrderDetailID ON SalesOrderID, SalesOrderDetailID Clustered index created by a primary key constraint.
AK_SalesOrderDetail_rowguid ON rowguid
IX_SalesOrderDetail_ProductID ON ProductID Nonclustered index.
Foreign Keys
FK_SalesOrderDetail_Product_ProductID ( ProductID ) ref Product (ProductID)
FK_SalesOrderDetail_SalesOrderHeader_SalesOrderID ( SalesOrderID ) ref SalesOrderHeader (SalesOrderID) Foreign key constraint referencing SalesOrderHeader.SalesOrderID.
Constraints
  CK_SalesOrderDetail_OrderQty [OrderQty]>(0)
  CK_SalesOrderDetail_UnitPrice [UnitPrice]>=(0.00)
  CK_SalesOrderDetail_UnitPriceDiscount [UnitPriceDiscount]>=(0.00)
Triggers
  iduSalesOrderDetail


Table SalesOrderHeader

General sales order information.

IndexesField NameData TypeDescription
* SalesOrderID int AUTOINCREMENT Primary key.
* RevisionNumber tinyint DEFAULT 0 Incremental number to track changes to the sales order over time.
* OrderDate datetime DEFAULT getdate() Dates the sales order was created.
* DueDate datetime Date the order is due to the customer.
  ShipDate datetime Date the order was shipped to the customer.
* Status tinyint DEFAULT 1 Order current status. 1 = In process; 2 = Approved; 3 = Backordered; 4 = Rejected; 5 = Shipped; 6 = Cancelled
* OnlineOrderFlag flag DEFAULT 1 0 = Order placed by sales person. 1 = Order placed online by customer.
* SalesOrderNumber nvarchar( 25 ) Unique sales order identification number.
  PurchaseOrderNumber ordernumber Customer purchase order number reference.
  AccountNumber accountnumber Financial accounting number reference.
* CustomerID int Customer identification number. Foreign key to Customer.CustomerID.
ShipToAddressID int The ID of the location to send goods. Foreign key to the Address table.
BillToAddressID int The ID of the location to send invoices. Foreign key to the Address table.
* ShipMethod nvarchar( 50 ) Shipping method. Foreign key to ShipMethod.ShipMethodID.
  CreditCardApprovalCode varchar( 15 ) Approval code provided by the credit card company.
* SubTotal money DEFAULT 0.00 Sales subtotal. Computed as SUM(SalesOrderDetail.LineTotal)for the appropriate SalesOrderID.
* TaxAmt money DEFAULT 0.00 Tax amount.
* Freight money DEFAULT 0.00 Shipping cost.
* TotalDue money Total due from customer. Computed as Subtotal + TaxAmt + Freight.
  Comment nvarchar(max) Sales representative comments.
* rowguid uniqueidentifier DEFAULT newid() ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
* ModifiedDate datetime DEFAULT getdate() Date and time the record was last updated.
Indexes
PK_SalesOrderHeader_SalesOrderID ON SalesOrderID Clustered index created by a primary key constraint.
AK_SalesOrderHeader_rowguid ON rowguid
AK_SalesOrderHeader_SalesOrderNumber ON SalesOrderNumber
IX_SalesOrderHeader_CustomerID ON CustomerID Nonclustered index.
Foreign Keys
FK_SalesOrderHeader_Address_BillTo_AddressID ( BillToAddressID ) ref Address (AddressID) Foreign key constraint referencing Address.AddressID for BillTo.
FK_SalesOrderHeader_Address_ShipTo_AddressID ( ShipToAddressID ) ref Address (AddressID) Foreign key constraint referencing Address.AddressID for ShipTo.
FK_SalesOrderHeader_Customer_CustomerID ( CustomerID ) ref Customer (CustomerID) Foreign key constraint referencing Customer.CustomerID.
Constraints
  CK_SalesOrderHeader_DueDate [DueDate]>=[OrderDate]
  CK_SalesOrderHeader_ShipDate [ShipDate]>=[OrderDate] OR [ShipDate] IS NULL
  CK_SalesOrderHeader_DueDate [DueDate]>=[OrderDate]
  CK_SalesOrderHeader_ShipDate [ShipDate]>=[OrderDate] OR [ShipDate] IS NULL
  CK_SalesOrderHeader_Status [Status]>=(0) AND [Status]<=(8)
  CK_SalesOrderHeader_SubTotal [SubTotal]>=(0.00)
  CK_SalesOrderHeader_TaxAmt [TaxAmt]>=(0.00)
  CK_SalesOrderHeader_Freight [Freight]>=(0.00)
Triggers
  uSalesOrderHeader

Powered by DbSchema