AdventureWorks Database > Sales Schema : Sales.SalesPerson Table |
Creation Date | 08/01/2010 08:40 |
File Group | PRIMARY |
Text File Group | |
System Object | ![]() |
Published for Replication | ![]() |
Rows | 17 |
Data Space Used | 8.00 KB |
Index Space Used | 24.00 KB |
Column Name | Description | Datatype | Length | Allow Nulls | Default | Formula | |
---|---|---|---|---|---|---|---|
![]() | SalesPersonID | Primary key for SalesPerson records. | int | 4 | |||
TerritoryID | Territory currently assigned to. Foreign key to SalesTerritory.SalesTerritoryID. | int | 4 | ![]() | |||
SalesQuota | Projected yearly sales. | money | 8 | ![]() | |||
Bonus | Bonus due if quota is met. | money | 8 | ((0.00)) | |||
CommissionPct | Commision percent received per sale. | smallmoney | 8 | ((0.00)) | |||
SalesYTD | Sales total year to date. | money | 8 | ((0.00)) | |||
SalesLastYear | Sales total of previous year. | money | 8 | ((0.00)) | |||
rowguid | ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. | uniqueidentifier | 16 | (newid()) | |||
ModifiedDate | Date and time the record was last updated. | datetime | 4 | (getdate()) |
Index | Description | Primary | Unique |
---|---|---|---|
AK_SalesPerson_rowguid | Unique nonclustered index. Used to support replication samples. | ![]() | |
PK_SalesPerson_SalesPersonID | Primary key (clustered) constraint | ![]() | ![]() |
Name | Description | Expression |
---|---|---|
CK_SalesPerson_Bonus | Check constraint [Bonus] >= (0.00) | ([Bonus]>=(0.00)) |
CK_SalesPerson_CommissionPct | Check constraint [CommissionPct] >= (0.00) | ([CommissionPct]>=(0.00)) |
CK_SalesPerson_SalesLastYear | Check constraint [SalesLastYear] >= (0.00) | ([SalesLastYear]>=(0.00)) |
CK_SalesPerson_SalesQuota | Check constraint [SalesQuota] > (0.00) | ([SalesQuota]>(0.00)) |
CK_SalesPerson_SalesYTD | Check constraint [SalesYTD] >= (0.00) | ([SalesYTD]>=(0.00)) |
Relationship | Description |
---|---|
FK_SalesOrderHeader_SalesPerson_SalesPersonID | Foreign key constraint referencing SalesPerson.SalesPersonID. |
FK_SalesPerson_Employee_SalesPersonID | Foreign key constraint referencing Employee.EmployeeID. |
FK_SalesPerson_SalesTerritory_TerritoryID | Foreign key constraint referencing SalesTerritory.TerritoryID. |
FK_SalesPersonQuotaHistory_SalesPerson_SalesPersonID | Foreign key constraint referencing SalesPerson.SalesPersonID. |
FK_SalesTerritoryHistory_SalesPerson_SalesPersonID | Foreign key constraint referencing SalesPerson.SalesPersonID. |
FK_Store_SalesPerson_SalesPersonID | Foreign key constraint referencing SalesPerson.SalesPersonID |
Database Object | Object Type | Description | Dep Level | |
---|---|---|---|---|
![]() | iduSalesOrderDetail | Trigger | AFTER INSERT, DELETE, UPDATE trigger that inserts a row in the TransactionHistory table, updates ModifiedDate in SalesOrderDetail and updates the SalesOrderHeader.SubTotal column. | 3 |
![]() | Sales.Individual | Table | Demographic data about customers that purchase Adventure Works products online. | 2 |
![]() | iStore | Trigger | AFTER INSERT trigger inserting Store only if the Customer does not exist in the Individual table. | 2 |
![]() | iuIndividual | Trigger | AFTER INSERT, UPDATE trigger inserting Individual only if the Customer does not exist in the Store table and setting the ModifiedDate column in the Individual table to the current date. | 3 |
![]() | Sales.SalesOrderDetail | Table | Individual products associated with a specific sales order. See SalesOrderHeader. | 2 |
![]() | Sales.SalesOrderHeader | Table | General sales order information. | 1 |
![]() | Sales.SalesOrderHeaderSalesReason | Table | Cross-reference table mapping sales orders to sales reason codes. | 2 |
![]() | Sales.SalesPersonQuotaHistory | Table | Sales performance tracking. | 1 |
![]() | Sales.SalesTerritoryHistory | Table | Sales representative transfers to other sales territories. | 1 |
![]() | Sales.Store | Table | Customers (resellers) of Adventure Works products. | 1 |
![]() | Sales.StoreContact | Table | Cross-reference table mapping stores and their employees. | 2 |
![]() | dbo.ufnGetContactInformation | User Defined Function | Table value function returning the first name, last name, job title and contact type for a given contact. | 3 |
![]() | uSalesOrderHeader | Trigger | AFTER UPDATE trigger that updates the RevisionNumber and ModifiedDate columns in the SalesOrderHeader table.Updates the SalesYTD column in the SalesPerson and SalesTerritory tables. | 2 |
![]() | Sales.vIndividualCustomer | View | Individual customers (names and addresses) that purchase Adventure Works Cycles products online. | 3 |
![]() | Sales.vIndividualDemographics | View | Displays the content from each element in the xml column Demographics for each customer in the Sales.Individual table. | 3 |
![]() | Sales.vSalesPerson | View | Sales representiatives (names and addresses) and their sales-related information. | 1 |
![]() | Sales.vSalesPersonSalesByFiscalYears | View | Uses PIVOT to return aggregated sales information for each sales representative. | 1 |
![]() | Sales.vStoreWithDemographics | View | Stores (names and addresses) that sell Adventure Works Cycles products to consumers. | 2 |
Database Object | Object Type | Description | Dep Level | |
---|---|---|---|---|
![]() | Person.Contact | Table | Names of each employee, customer contact, and vendor contact. | 2 |
![]() | HumanResources.Employee | Table | Employee information such as salary, department, and title. | 1 |
![]() | dbo.Flag | User Defined Data Type | 2 | |
![]() | dbo.NameStyle | User Defined Data Type | 3 | |
![]() | dbo.Phone | User Defined Data Type | 3 | |
![]() | Sales.SalesTerritory | Table | Sales territory lookup table. | 1 |
|