Difference between revisions of "Sales.SalesPerson (table)"
| Line 12: | Line 12: | ||
| + | === Columns === | ||
{| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse" | {| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse" | ||
|- style="background:silver" | |- style="background:silver" | ||
| Line 18: | Line 19: | ||
| '''Nullable | | '''Nullable | ||
| '''Default | | '''Default | ||
| − | | '''Description | + | | '''Description |
|- valign="top" | |- valign="top" | ||
| Line 25: | Line 26: | ||
| not null | | not null | ||
| | | | ||
| − | | Primary key for SalesPerson records. | + | | Primary key for SalesPerson records. |
|- valign="top" | |- valign="top" | ||
| TerritoryID | | TerritoryID | ||
| Line 31: | Line 32: | ||
| null | | null | ||
| | | | ||
| − | | Territory currently assigned to. Foreign key to SalesTerritory.SalesTerritoryID. | + | | Territory currently assigned to. Foreign key to SalesTerritory.SalesTerritoryID. |
|- valign="top" | |- valign="top" | ||
| SalesQuota | | SalesQuota | ||
| Line 37: | Line 38: | ||
| null | | null | ||
| | | | ||
| − | | Projected yearly sales. | + | | Projected yearly sales. |
|- valign="top" | |- valign="top" | ||
| Bonus | | Bonus | ||
| Line 43: | Line 44: | ||
| not null | | not null | ||
| ((0.00)) | | ((0.00)) | ||
| − | | Bonus due if quota is met. | + | | Bonus due if quota is met. |
|- valign="top" | |- valign="top" | ||
| CommissionPct | | CommissionPct | ||
| Line 49: | Line 50: | ||
| not null | | not null | ||
| ((0.00)) | | ((0.00)) | ||
| − | | Commision percent received per sale. | + | | Commision percent received per sale. |
|- valign="top" | |- valign="top" | ||
| SalesYTD | | SalesYTD | ||
| Line 55: | Line 56: | ||
| not null | | not null | ||
| ((0.00)) | | ((0.00)) | ||
| − | | Sales total year to date. | + | | Sales total year to date. |
|- valign="top" | |- valign="top" | ||
| SalesLastYear | | SalesLastYear | ||
| Line 61: | Line 62: | ||
| not null | | not null | ||
| ((0.00)) | | ((0.00)) | ||
| − | | Sales total of previous year. | + | | Sales total of previous year. |
|- valign="top" | |- valign="top" | ||
| rowguid | | rowguid | ||
| Line 67: | Line 68: | ||
| not null | | not null | ||
| (newid()) | | (newid()) | ||
| − | | ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. | + | | ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. |
|- valign="top" | |- valign="top" | ||
| ModifiedDate | | ModifiedDate | ||
| Line 73: | Line 74: | ||
| not null | | not null | ||
| (getdate()) | | (getdate()) | ||
| − | | Date and time the record was last updated. | + | | Date and time the record was last updated. |
|} | |} | ||
| + | === Primary Key === | ||
| + | {| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse" | ||
| + | |- style="background:silver" | ||
| + | | '''Primary Key | ||
| + | | '''Columns | ||
| + | |- | ||
| + | | PK_SalesPerson_SalesPersonID | ||
| + | | SalesPersonID | ||
| + | |} | ||
| + | === Indexes === | ||
| + | {| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse" | ||
| + | |- style="background:silver" | ||
| + | | '''Index | ||
| + | | '''Type | ||
| + | | '''Columns | ||
| + | |||
| + | |- | ||
| + | | AK_SalesPerson_rowguid | ||
| + | | Unique | ||
| + | | rowguid | ||
| + | |} | ||
| + | |||
| + | === Check Constraints === | ||
| + | {| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse" | ||
| + | |- style="background:silver" | ||
| + | | '''Check Constraint | ||
| + | | '''Expression | ||
| + | | '''Description | ||
| + | |||
| + | |- | ||
| + | | CK_SalesPerson_Bonus | ||
| + | | ([Bonus]>=(0.00)) | ||
| + | | Check constraint [Bonus] >= (0.00) | ||
| + | |- | ||
| + | | CK_SalesPerson_CommissionPct | ||
| + | | ([CommissionPct]>=(0.00)) | ||
| + | | Check constraint [CommissionPct] >= (0.00) | ||
| + | |- | ||
| + | | CK_SalesPerson_SalesLastYear | ||
| + | | ([SalesLastYear]>=(0.00)) | ||
| + | | Check constraint [SalesLastYear] >= (0.00) | ||
| + | |- | ||
| + | | CK_SalesPerson_SalesQuota | ||
| + | | ([SalesQuota]>(0.00)) | ||
| + | | Check constraint [SalesQuota] > (0.00) | ||
| + | |- | ||
| + | | CK_SalesPerson_SalesYTD | ||
| + | | ([SalesYTD]>=(0.00)) | ||
| + | | Check constraint [SalesYTD] >= (0.00) | ||
| + | |} | ||
| + | === Foreign Keys === | ||
{| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse" | {| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse" | ||
|- style="background:silver" | |- style="background:silver" | ||
| Line 94: | Line 146: | ||
|} | |} | ||
| − | + | === Detail Tables === | |
{| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse" | {| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse" | ||
|- style="background:silver" | |- style="background:silver" | ||
| Line 119: | Line 171: | ||
|} | |} | ||
| + | === References === | ||
| + | {| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse" | ||
| + | |- style="background:silver" | ||
| + | | '''Dependency Type | ||
| + | | '''Object Type | ||
| + | | '''Referenced Object | ||
| + | |||
| + | |- | ||
| + | | Schema | ||
| + | | Schema | ||
| + | | [[Sales_(schema)|Sales]] | ||
| + | |} | ||
| + | |||
| + | === Dependencies === | ||
{| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse" | {| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse" | ||
|- style="background:silver" | |- style="background:silver" | ||
| Line 151: | Line 217: | ||
| uSalesOrderHeader | | uSalesOrderHeader | ||
|} | |} | ||
| − | |||
Revision as of 23:06, 2 February 2010
Contents
wikibot
| Table | Sales.SalesPerson |
| Description | Sales representative current information. |
Columns
| Column | Data Type | Nullable | Default | Description |
| SalesPersonID | int | not null | Primary key for SalesPerson records. | |
| TerritoryID | int | null | Territory currently assigned to. Foreign key to SalesTerritory.SalesTerritoryID. | |
| SalesQuota | money | null | Projected yearly sales. | |
| Bonus | money | not null | ((0.00)) | Bonus due if quota is met. |
| CommissionPct | smallmoney | not null | ((0.00)) | Commision percent received per sale. |
| SalesYTD | money | not null | ((0.00)) | Sales total year to date. |
| SalesLastYear | money | not null | ((0.00)) | Sales total of previous year. |
| rowguid | uniqueidentifier | not null | (newid()) | ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. |
| ModifiedDate | datetime | not null | (getdate()) | Date and time the record was last updated. |
Primary Key
| Primary Key | Columns |
| PK_SalesPerson_SalesPersonID | SalesPersonID |
Indexes
| Index | Type | Columns |
| AK_SalesPerson_rowguid | Unique | rowguid |
Check Constraints
| Check Constraint | Expression | Description |
| CK_SalesPerson_Bonus | ([Bonus]>=(0.00)) | Check constraint [Bonus] >= (0.00) |
| CK_SalesPerson_CommissionPct | ([CommissionPct]>=(0.00)) | Check constraint [CommissionPct] >= (0.00) |
| CK_SalesPerson_SalesLastYear | ([SalesLastYear]>=(0.00)) | Check constraint [SalesLastYear] >= (0.00) |
| CK_SalesPerson_SalesQuota | ([SalesQuota]>(0.00)) | Check constraint [SalesQuota] > (0.00) |
| CK_SalesPerson_SalesYTD | ([SalesYTD]>=(0.00)) | Check constraint [SalesYTD] >= (0.00) |
Foreign Keys
| Relation | Column | Referenced Column |
| HumanResources.Employee | SalesPersonID | EmployeeID |
| Sales.SalesTerritory | TerritoryID | TerritoryID |
Detail Tables
| Detail Table | Column | Referencing Column |
| Sales.SalesOrderHeader | SalesPersonID | SalesPersonID |
| Sales.SalesPersonQuotaHistory | SalesPersonID | SalesPersonID |
| Sales.SalesTerritoryHistory | SalesPersonID | SalesPersonID |
| Sales.Store | SalesPersonID | SalesPersonID |
References
| Dependency Type | Object Type | Referenced Object |
| Schema | Schema | Sales |
Dependencies
| Reference Type | Object Type | Referencing Object | Child Type | Child Object |
| Select | View | Sales.vSalesPerson | ||
| Select | View | Sales.vSalesPersonSalesByFiscalYears | ||
| Update | Table | Sales.SalesOrderHeader | Trigger | uSalesOrderHeader |
automatically generated
| Table | Sales.SalesPerson |
| Description | Sales representative current information. |
| Column | Data Type | Nullable | Default | Description / PK / Index |
| SalesPersonID | int | not null | Primary key for SalesPerson records. PK_SalesPerson_SalesPersonID | |
| TerritoryID | int | null | Territory currently assigned to. Foreign key to SalesTerritory.SalesTerritoryID. | |
| SalesQuota | money | null | Projected yearly sales. | |
| Bonus | money | not null | (0.00) | Bonus due if quota is met. |
| CommissionPct | smallmoney | not null | (0.00) | Commision percent received per sale. |
| SalesYTD | money | not null | (0.00) | Sales total year to date. |
| SalesLastYear | money | not null | (0.00) | Sales total of previous year. |
| rowguid | uniqueidentifier | not null | (NEWID()) | ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. AK_SalesPerson_rowguid |
| ModifiedDate | datetime | not null | (GETDATE()) | Date and time the record was last updated. |
| Relation | Column | Referenced Column |
| HumanResources.Employee | SalesPersonID | EmployeeID |
| Sales.SalesTerritory | TerritoryID | TerritoryID |
| Detail Table | Column | Referencing Column |
| Sales.SalesOrderHeader | SalesPersonID | SalesPersonID |
| Sales.SalesPersonQuotaHistory | SalesPersonID | SalesPersonID |
| Sales.SalesTerritoryHistory | SalesPersonID | SalesPersonID |
| Sales.Store | SalesPersonID | SalesPersonID |
| Dependency Type | Object Type | Referenced Object |
| Schema | Schema | Sales |
| Reference Type | Object Type | Referencing Object | Child Type | Child Object |
| Select | View | Sales.vSalesPerson | ||
| Select | View | Sales.vSalesPersonSalesByFiscalYears | ||
| Update | Table | Sales.SalesOrderHeader | Trigger | uSalesOrderHeader |