Sales.Customers
| Documentation | WideWorldImporters |
| Schema | Sales |
| Name | Customers |
| Module | Sales |
Columns
| Key | Name | Data type | Null | Attributes | References | Description | ||
|---|---|---|---|---|---|---|---|---|
| 1 | CustomerID | int | Default: NEXT VALUE FOR [Sequences].[CustomerID] | Numeric ID used for reference to a customer within the database | ||||
| Numeric ID used for reference to a customer within the database Default: NEXT VALUE FOR [Sequences].[CustomerID] |
||||||||
| 2 | CustomerName | nvarchar(100) | Customer's full name (usually a trading name) | |||||
| Customer's full name (usually a trading name) |
||||||||
| 3 | BillToCustomerID | int | Sales.Customers | Customer that this is billed to (usually the same customer but can be another parent company) | ||||
| Customer that this is billed to (usually the same customer but can be another parent company) References: Sales.Customers |
||||||||
| 4 | CustomerCategoryID | int | Sales.CustomerCategories | Customer's category | ||||
| Customer's category References: Sales.CustomerCategories |
||||||||
| 5 | BuyingGroupID | int | Sales.BuyingGroups | Customer's buying group (optional) | ||||
| Customer's buying group (optional) References: Sales.BuyingGroups |
||||||||
| 6 | PrimaryContactPersonID | int | Application.People | Primary contact | ||||
| Primary contact References: Application.People |
||||||||
| 7 | AlternateContactPersonID | int | Application.People | Alternate contact | ||||
| Alternate contact References: Application.People |
||||||||
| 8 | DeliveryMethodID | int | Application.DeliveryMethods | Standard delivery method for stock items sent to this customer | ||||
| Standard delivery method for stock items sent to this customer References: Application.DeliveryMethods |
||||||||
| 9 | DeliveryCityID | int | Application.Cities | ID of the delivery city for this address | ||||
| ID of the delivery city for this address References: Application.Cities |
||||||||
| 10 | PostalCityID | int | Application.Cities | ID of the postal city for this address | ||||
| ID of the postal city for this address References: Application.Cities |
||||||||
| 11 | CreditLimit | decimal(18, 2) | Credit limit for this customer (NULL if unlimited) | |||||
| Credit limit for this customer (NULL if unlimited) |
||||||||
| 12 | AccountOpenedDate | date | Date this customer account was opened | |||||
| Date this customer account was opened |
||||||||
| 13 | StandardDiscountPercentage | decimal(18, 3) | Standard discount offered to this customer | |||||
| Standard discount offered to this customer |
||||||||
| 14 | IsStatementSent | bit | Is a statement sent to this customer? (Or do they just pay on each invoice?) | |||||
| Is a statement sent to this customer? (Or do they just pay on each invoice?) |
||||||||
| 15 | IsOnCreditHold | bit | Is this customer on credit hold? (Prevents further deliveries to this customer) | |||||
| Is this customer on credit hold? (Prevents further deliveries to this customer) |
||||||||
| 16 | PaymentDays | int | Number of days for payment of an invoice (ie payment terms) | |||||
| Number of days for payment of an invoice (ie payment terms) |
||||||||
| 17 | PhoneNumber | nvarchar(20) | Phone number | |||||
| Phone number |
||||||||
| 18 | FaxNumber | nvarchar(20) | Fax number | |||||
| Fax number |
||||||||
| 19 | DeliveryRun | nvarchar(5) | Normal delivery run for this customer | |||||
| Normal delivery run for this customer |
||||||||
| 20 | RunPosition | nvarchar(5) | Normal position in the delivery run for this customer | |||||
| Normal position in the delivery run for this customer |
||||||||
| 21 | WebsiteURL | nvarchar(256) | URL for the website for this customer | |||||
| URL for the website for this customer |
||||||||
| 22 | DeliveryAddressLine1 | nvarchar(60) | First delivery address line for the customer | |||||
| First delivery address line for the customer |
||||||||
| 23 | DeliveryAddressLine2 | nvarchar(60) | Second delivery address line for the customer | |||||
| Second delivery address line for the customer |
||||||||
| 24 | DeliveryPostalCode | nvarchar(10) | Delivery postal code for the customer | |||||
| Delivery postal code for the customer |
||||||||
| 25 | DeliveryLocation | geography | Geographic location for the customer's office/warehouse | |||||
| Geographic location for the customer's office/warehouse |
||||||||
| 26 | PostalAddressLine1 | nvarchar(60) | First postal address line for the customer | |||||
| First postal address line for the customer |
||||||||
| 27 | PostalAddressLine2 | nvarchar(60) | Second postal address line for the customer | |||||
| Second postal address line for the customer |
||||||||
| 28 | PostalPostalCode | nvarchar(10) | Postal code for the customer when sending by mail | |||||
| Postal code for the customer when sending by mail |
||||||||
| 29 | LastEditedBy | int | Application.People | |||||
| References: Application.People | ||||||||
| 30 | ValidFrom | datetime2(7) | Valid from this date and time | |||||
| Valid from this date and time |
||||||||
| 31 | ValidTo | datetime2(7) | Valid until this date and time | |||||
| Valid until this date and time |
||||||||
Relations
| Foreign table | Primary table | Join | Title / Name / Description | |
|---|---|---|---|---|
| Sales.Customers | Sales.BuyingGroups | Sales.Customers.BuyingGroupID = Sales.BuyingGroups.BuyingGroupID | FK_Sales_Customers_BuyingGroupID_Sales_BuyingGroups Foreign key constraint referencing BuyingGroups.BuyingGroupID |
|
|
Sales.Customers.BuyingGroupID = Sales.BuyingGroups.BuyingGroupID Name: FK_Sales_Customers_BuyingGroupID_Sales_BuyingGroupsForeign key constraint referencing BuyingGroups.BuyingGroupID |
||||
| Sales.Customers | Application.Cities | Sales.Customers.DeliveryCityID = Application.Cities.CityID | FK_Sales_Customers_DeliveryCityID_Application_Cities Foreign key constraint referencing Cities.CityID |
|
|
Sales.Customers.DeliveryCityID = Application.Cities.CityID Name: FK_Sales_Customers_DeliveryCityID_Application_CitiesForeign key constraint referencing Cities.CityID |
||||
| Sales.Customers | Application.Cities | Sales.Customers.PostalCityID = Application.Cities.CityID | FK_Sales_Customers_PostalCityID_Application_Cities Foreign key constraint referencing Cities.CityID |
|
|
Sales.Customers.PostalCityID = Application.Cities.CityID Name: FK_Sales_Customers_PostalCityID_Application_CitiesForeign key constraint referencing Cities.CityID |
||||
| Sales.Customers | Sales.CustomerCategories | Sales.Customers.CustomerCategoryID = Sales.CustomerCategories.CustomerCategoryID | FK_Sales_Customers_CustomerCategoryID_Sales_CustomerCategories Foreign key constraint referencing CustomerCategories.CustomerCategoryID |
|
|
Sales.Customers.CustomerCategoryID = Sales.CustomerCategories.CustomerCategoryID Name: FK_Sales_Customers_CustomerCategoryID_Sales_CustomerCategoriesForeign key constraint referencing CustomerCategories.CustomerCategoryID |
||||
| Sales.Customers | Sales.Customers | Sales.Customers.BillToCustomerID = Sales.Customers.CustomerID | FK_Sales_Customers_BillToCustomerID_Sales_Customers Foreign key constraint referencing Customers.CustomerID |
|
|
Sales.Customers.BillToCustomerID = Sales.Customers.CustomerID Name: FK_Sales_Customers_BillToCustomerID_Sales_CustomersForeign key constraint referencing Customers.CustomerID |
||||
| Sales.Customers | Application.DeliveryMethods | Sales.Customers.DeliveryMethodID = Application.DeliveryMethods.DeliveryMethodID | FK_Sales_Customers_DeliveryMethodID_Application_DeliveryMethods Foreign key constraint referencing DeliveryMethods.DeliveryMethodID |
|
|
Sales.Customers.DeliveryMethodID = Application.DeliveryMethods.DeliveryMethodID Name: FK_Sales_Customers_DeliveryMethodID_Application_DeliveryMethodsForeign key constraint referencing DeliveryMethods.DeliveryMethodID |
||||
| Sales.Customers | Application.People | Sales.Customers.AlternateContactPersonID = Application.People.PersonID | FK_Sales_Customers_AlternateContactPersonID_Application_People Foreign key constraint referencing People.PersonID |
|
|
Sales.Customers.AlternateContactPersonID = Application.People.PersonID Name: FK_Sales_Customers_AlternateContactPersonID_Application_PeopleForeign key constraint referencing People.PersonID |
||||
| Sales.Customers | Application.People | Sales.Customers.LastEditedBy = Application.People.PersonID | FK_Sales_Customers_Application_People Foreign key constraint referencing People.PersonID |
|
|
Sales.Customers.LastEditedBy = Application.People.PersonID Name: FK_Sales_Customers_Application_PeopleForeign key constraint referencing People.PersonID |
||||
| Sales.Customers | Application.People | Sales.Customers.PrimaryContactPersonID = Application.People.PersonID | FK_Sales_Customers_PrimaryContactPersonID_Application_People Foreign key constraint referencing People.PersonID |
|
|
Sales.Customers.PrimaryContactPersonID = Application.People.PersonID Name: FK_Sales_Customers_PrimaryContactPersonID_Application_PeopleForeign key constraint referencing People.PersonID |
||||
| Sales.Customers | Sales.Customers | Sales.Customers.BillToCustomerID = Sales.Customers.CustomerID | FK_Sales_Customers_BillToCustomerID_Sales_Customers Foreign key constraint referencing Customers.CustomerID |
|
|
Sales.Customers.BillToCustomerID = Sales.Customers.CustomerID Name: FK_Sales_Customers_BillToCustomerID_Sales_CustomersForeign key constraint referencing Customers.CustomerID |
||||
| Sales.CustomerTransactions | Sales.Customers | Sales.CustomerTransactions.CustomerID = Sales.Customers.CustomerID | FK_Sales_CustomerTransactions_CustomerID_Sales_Customers Foreign key constraint referencing Customers.CustomerID |
|
|
Sales.CustomerTransactions.CustomerID = Sales.Customers.CustomerID Name: FK_Sales_CustomerTransactions_CustomerID_Sales_CustomersForeign key constraint referencing Customers.CustomerID |
||||
| Sales.Invoices | Sales.Customers | Sales.Invoices.BillToCustomerID = Sales.Customers.CustomerID | FK_Sales_Invoices_BillToCustomerID_Sales_Customers Foreign key constraint referencing Customers.CustomerID |
|
|
Sales.Invoices.BillToCustomerID = Sales.Customers.CustomerID Name: FK_Sales_Invoices_BillToCustomerID_Sales_CustomersForeign key constraint referencing Customers.CustomerID |
||||
| Sales.Invoices | Sales.Customers | Sales.Invoices.CustomerID = Sales.Customers.CustomerID | FK_Sales_Invoices_CustomerID_Sales_Customers Foreign key constraint referencing Customers.CustomerID |
|
|
Sales.Invoices.CustomerID = Sales.Customers.CustomerID Name: FK_Sales_Invoices_CustomerID_Sales_CustomersForeign key constraint referencing Customers.CustomerID |
||||
| Sales.Orders | Sales.Customers | Sales.Orders.CustomerID = Sales.Customers.CustomerID | FK_Sales_Orders_CustomerID_Sales_Customers Foreign key constraint referencing Customers.CustomerID |
|
|
Sales.Orders.CustomerID = Sales.Customers.CustomerID Name: FK_Sales_Orders_CustomerID_Sales_CustomersForeign key constraint referencing Customers.CustomerID |
||||
| Sales.SpecialDeals | Sales.Customers | Sales.SpecialDeals.CustomerID = Sales.Customers.CustomerID | FK_Sales_SpecialDeals_CustomerID_Sales_Customers Foreign key constraint referencing Customers.CustomerID |
|
|
Sales.SpecialDeals.CustomerID = Sales.Customers.CustomerID Name: FK_Sales_SpecialDeals_CustomerID_Sales_CustomersForeign key constraint referencing Customers.CustomerID |
||||
| Warehouse.StockItemTransactions | Sales.Customers | Warehouse.StockItemTransactions.CustomerID = Sales.Customers.CustomerID | FK_Warehouse_StockItemTransactions_CustomerID_Sales_Customers Foreign key constraint referencing Customers.CustomerID |
|
|
Warehouse.StockItemTransactions.CustomerID = Sales.Customers.CustomerID Name: FK_Warehouse_StockItemTransactions_CustomerID_Sales_CustomersForeign key constraint referencing Customers.CustomerID |
||||
Unique keys
| Key name | Columns | Description | |
|---|---|---|---|
| PK_Sales_Customers | CustomerID | Primary key (clustered) constraint. | |
| Primary key (clustered) constraint. | |||
| UQ_Sales_Customers_CustomerName | CustomerName | Unique nonclustered index. | |
| Unique nonclustered index. | |||
Uses
| Name |
|---|
|
Sales.Customers
|
|
Sales.Customers
|
Used by
| Name |
|---|
|
Sales.Customers
|
|
Sales.Customers
|
Exported: 2019-02-04 23:04, Last imported: 2018-08-10 09:51
