Difference between revisions of "Sales.SalesPerson (table)"

From dbscript Online Help
Jump to: navigation, search
 
(One intermediate revision by the same user not shown)
Line 2: Line 2:
  
 
{| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse"
 
{| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse"
|-
+
|- valign="top"
 
| '''Table
 
| '''Table
 
| Sales.SalesPerson
 
| Sales.SalesPerson
Line 8: Line 8:
 
| '''Description
 
| '''Description
 
| Sales representative current information.
 
| Sales representative current information.
|-
 
 
|}
 
|}
  
 
+
=== 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 17:
 
| '''Nullable
 
| '''Nullable
 
| '''Default
 
| '''Default
| '''Description / PK / Index
+
| '''Description
+
 
 
|- valign="top"
 
|- valign="top"
 
| SalesPersonID
 
| SalesPersonID
Line 25: Line 24:
 
| not null
 
| not null
 
|  
 
|  
| Primary key for SalesPerson records.<br />PK_SalesPerson_SalesPersonID
+
| Primary key for SalesPerson records.
 
|- valign="top"
 
|- valign="top"
 
| TerritoryID
 
| TerritoryID
Line 31: Line 30:
 
| null
 
| null
 
|  
 
|  
| Territory currently assigned to. Foreign key to SalesTerritory.SalesTerritoryID.<br />
+
| Territory currently assigned to. Foreign key to SalesTerritory.SalesTerritoryID.
 
|- valign="top"
 
|- valign="top"
 
| SalesQuota
 
| SalesQuota
Line 37: Line 36:
 
| null
 
| null
 
|  
 
|  
| Projected yearly sales.<br />
+
| Projected yearly sales.
 
|- valign="top"
 
|- valign="top"
 
| Bonus
 
| Bonus
Line 43: Line 42:
 
| not null
 
| not null
 
| ((0.00))
 
| ((0.00))
| Bonus due if quota is met.<br />
+
| Bonus due if quota is met.
 
|- valign="top"
 
|- valign="top"
 
| CommissionPct
 
| CommissionPct
Line 49: Line 48:
 
| not null
 
| not null
 
| ((0.00))
 
| ((0.00))
| Commision percent received per sale.<br />
+
| Commision percent received per sale.
 
|- valign="top"
 
|- valign="top"
 
| SalesYTD
 
| SalesYTD
Line 55: Line 54:
 
| not null
 
| not null
 
| ((0.00))
 
| ((0.00))
| Sales total year to date.<br />
+
| Sales total year to date.
 
|- valign="top"
 
|- valign="top"
 
| SalesLastYear
 
| SalesLastYear
Line 61: Line 60:
 
| not null
 
| not null
 
| ((0.00))
 
| ((0.00))
| Sales total of previous year.<br />
+
| Sales total of previous year.
 
|- valign="top"
 
|- valign="top"
 
| rowguid
 
| rowguid
Line 67: Line 66:
 
| not null
 
| not null
 
| (newid())
 
| (newid())
| ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.<br />AK_SalesPerson_rowguid
+
| ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
 
|- valign="top"
 
|- valign="top"
 
| ModifiedDate
 
| ModifiedDate
Line 73: Line 72:
 
| not null
 
| not null
 
| (getdate())
 
| (getdate())
| Date and time the record was last updated.<br />
+
| 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
 +
|- valign="top"
 +
| PK_SalesPerson_SalesPersonID
 +
| SalesPersonID
 
|}
 
|}
  
 +
=== Indexes ===
 +
{| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse"
 +
|- style="background:silver"
 +
| '''Index
 +
| '''Type
 +
| '''Columns
  
 +
|- valign="top"
 +
| AK_SalesPerson_rowguid
 +
| Unique
 +
| rowguid
 +
|}
 +
 +
=== Check Constraints ===
 +
{| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse"
 +
|- style="background:silver"
 +
| '''Check Constraint
 +
| '''Expression
 +
| '''Description
 +
 +
|- valign="top"
 +
| CK_SalesPerson_Bonus
 +
| ([Bonus]>=(0.00))
 +
| Check constraint [Bonus] >= (0.00)
 +
|- valign="top"
 +
| CK_SalesPerson_CommissionPct
 +
| ([CommissionPct]>=(0.00))
 +
| Check constraint [CommissionPct] >= (0.00)
 +
|- valign="top"
 +
| CK_SalesPerson_SalesLastYear
 +
| ([SalesLastYear]>=(0.00))
 +
| Check constraint [SalesLastYear] >= (0.00)
 +
|- valign="top"
 +
| CK_SalesPerson_SalesQuota
 +
| ([SalesQuota]>(0.00))
 +
| Check constraint [SalesQuota] > (0.00)
 +
|- valign="top"
 +
| 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 83: Line 133:
 
| '''Column
 
| '''Column
 
| '''Referenced Column
 
| '''Referenced Column
+
 
|-
+
|- valign="top"
 
| [[HumanResources.Employee_(table)|HumanResources.Employee]]
 
| [[HumanResources.Employee_(table)|HumanResources.Employee]]
 
| SalesPersonID
 
| SalesPersonID
 
| EmployeeID
 
| EmployeeID
|-
+
|- valign="top"
 
| [[Sales.SalesTerritory_(table)|Sales.SalesTerritory]]
 
| [[Sales.SalesTerritory_(table)|Sales.SalesTerritory]]
 
| TerritoryID
 
| TerritoryID
Line 94: Line 144:
 
|}
 
|}
  
 
+
=== 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 100: Line 150:
 
| '''Column
 
| '''Column
 
| '''Referencing Column
 
| '''Referencing Column
+
 
|-
+
|- valign="top"
 
| [[Sales.SalesOrderHeader_(table)|Sales.SalesOrderHeader]]
 
| [[Sales.SalesOrderHeader_(table)|Sales.SalesOrderHeader]]
 
| SalesPersonID
 
| SalesPersonID
 
| SalesPersonID
 
| SalesPersonID
|-
+
|- valign="top"
 
| [[Sales.SalesPersonQuotaHistory_(table)|Sales.SalesPersonQuotaHistory]]
 
| [[Sales.SalesPersonQuotaHistory_(table)|Sales.SalesPersonQuotaHistory]]
 
| SalesPersonID
 
| SalesPersonID
 
| SalesPersonID
 
| SalesPersonID
|-
+
|- valign="top"
 
| [[Sales.SalesTerritoryHistory_(table)|Sales.SalesTerritoryHistory]]
 
| [[Sales.SalesTerritoryHistory_(table)|Sales.SalesTerritoryHistory]]
 
| SalesPersonID
 
| SalesPersonID
 
| SalesPersonID
 
| SalesPersonID
|-
+
|- valign="top"
 
| [[Sales.Store_(table)|Sales.Store]]
 
| [[Sales.Store_(table)|Sales.Store]]
 
| SalesPersonID
 
| SalesPersonID
Line 119: Line 169:
 
|}
 
|}
  
 +
=== References ===
 +
{| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse"
 +
|- style="background:silver"
 +
| '''Dependency Type
 +
| '''Object Type
 +
| '''Referenced Object
 +
 +
|- valign="top"
 +
| 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 129: Line 193:
 
| '''Child Object
 
| '''Child Object
  
|-
+
|- valign="top"
 
| Select
 
| Select
 
| View
 
| View
Line 136: Line 200:
 
|  
 
|  
 
|  
 
|  
|-
+
|- valign="top"
 
| Select
 
| Select
 
| View
 
| View
Line 143: Line 207:
 
|  
 
|  
 
|  
 
|  
|-
+
|- valign="top"
 
| Update
 
| Update
 
| Table
 
| Table
Line 151: Line 215:
 
| uSalesOrderHeader
 
| uSalesOrderHeader
 
|}
 
|}
 
  
  

Latest revision as of 00:17, 24 June 2010

wikibot[edit]

Table Sales.SalesPerson
Description Sales representative current information.

Columns[edit]

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[edit]

Primary Key Columns
PK_SalesPerson_SalesPersonID SalesPersonID

Indexes[edit]

Index Type Columns
AK_SalesPerson_rowguid Unique rowguid

Check Constraints[edit]

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[edit]

Relation Column Referenced Column
HumanResources.Employee SalesPersonID EmployeeID
Sales.SalesTerritory TerritoryID TerritoryID

Detail Tables[edit]

Detail Table Column Referencing Column
Sales.SalesOrderHeader SalesPersonID SalesPersonID
Sales.SalesPersonQuotaHistory SalesPersonID SalesPersonID
Sales.SalesTerritoryHistory SalesPersonID SalesPersonID
Sales.Store SalesPersonID SalesPersonID

References[edit]

Dependency Type Object Type Referenced Object
Schema Schema Sales

Dependencies[edit]

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[edit]

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