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

From dbscript Online Help
Jump to: navigation, search
 
(6 intermediate revisions 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
|-
+
|- valign="top"
 +
| '''Description
 +
| 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 15: Line 17:
 
| '''Nullable
 
| '''Nullable
 
| '''Default
 
| '''Default
| '''PK
+
| '''Description
| '''Index
+
 
+
|- valign="top"
|-
 
 
| SalesPersonID
 
| SalesPersonID
 
| int
 
| int
 
| not null
 
| not null
 
|  
 
|  
| PK_SalesPerson_SalesPersonID
+
| Primary key for SalesPerson records.
|
+
|- valign="top"
|-
 
 
| TerritoryID
 
| TerritoryID
 
| int
 
| int
 
| null
 
| null
 
|  
 
|  
|  
+
| Territory currently assigned to. Foreign key to SalesTerritory.SalesTerritoryID.
|
+
|- valign="top"
|-
 
 
| SalesQuota
 
| SalesQuota
 
| money
 
| money
 
| null
 
| null
 
|  
 
|  
|  
+
| Projected yearly sales.
|
+
|- valign="top"
|-
 
 
| Bonus
 
| Bonus
 
| money
 
| money
 
| not null
 
| not null
 
| ((0.00))
 
| ((0.00))
|  
+
| Bonus due if quota is met.
|
+
|- valign="top"
|-
 
 
| CommissionPct
 
| CommissionPct
 
| smallmoney
 
| smallmoney
 
| not null
 
| not null
 
| ((0.00))
 
| ((0.00))
|  
+
| Commision percent received per sale.
|
+
|- valign="top"
|-
 
 
| SalesYTD
 
| SalesYTD
 
| money
 
| money
 
| not null
 
| not null
 
| ((0.00))
 
| ((0.00))
|  
+
| Sales total year to date.
|
+
|- valign="top"
|-
 
 
| SalesLastYear
 
| SalesLastYear
 
| money
 
| money
 
| not null
 
| not null
 
| ((0.00))
 
| ((0.00))
|  
+
| Sales total of previous year.
|
+
|- valign="top"
|-
 
 
| rowguid
 
| rowguid
 
| uniqueidentifier
 
| uniqueidentifier
 
| not null
 
| not null
 
| (newid())
 
| (newid())
|  
+
| ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
| AK_SalesPerson_rowguid
+
|- valign="top"
|-
 
 
| ModifiedDate
 
| ModifiedDate
 
| datetime
 
| datetime
 
| not null
 
| not null
 
| (getdate())
 
| (getdate())
|  
+
| 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 90: 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 101: 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 107: 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
 
| SalesPersonID
 
| SalesPersonID
 
|}
 
|}
 +
 +
=== 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"
 +
|- style="background:silver"
 +
| '''Reference Type
 +
| '''Object Type
 +
| '''Referencing Object
 +
 +
| '''Child Type
 +
| '''Child Object
 +
 +
|- valign="top"
 +
| Select
 +
| View
 +
| [[Sales.vSalesPerson_(view)|Sales.vSalesPerson]]
 +
 +
|
 +
|
 +
|- valign="top"
 +
| Select
 +
| View
 +
| [[Sales.vSalesPersonSalesByFiscalYears_(view)|Sales.vSalesPersonSalesByFiscalYears]]
 +
 +
|
 +
|
 +
|- valign="top"
 +
| Update
 +
| Table
 +
| [[Sales.SalesOrderHeader_(table)|Sales.SalesOrderHeader]]
 +
 +
| Trigger
 +
| uSalesOrderHeader
 +
|}
 +
 +
 
== automatically generated ==
 
== automatically generated ==
  
Line 131: Line 223:
 
| '''Table
 
| '''Table
 
| Sales.SalesPerson
 
| Sales.SalesPerson
|-
+
|- valign="top"
 
 
 
| '''Description
 
| '''Description
 
| Sales representative current information.
 
| Sales representative current information.
 
|-
 
|-
 
 
|}
 
|}
  
Line 250: Line 340:
 
{| 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"
| '''Referencing Object
+
| '''Dependency Type
 
| '''Object Type
 
| '''Object Type
 +
| '''Referenced Object
 +
 +
|-
 +
| Schema
 +
| Schema
 +
| [[Sales_(schema)|Sales]]
 +
 +
|}
 +
 +
 +
{| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse"
 +
|- style="background:silver"
 
| '''Reference Type
 
| '''Reference Type
+
| '''Object Type
 +
| '''Referencing Object
 +
 
 +
| '''Child Type
 +
| '''Child Object
 +
 
 
|-
 
|-
 +
| Select
 +
| View
 
| [[Sales.vSalesPerson_(view)|Sales.vSalesPerson]]
 
| [[Sales.vSalesPerson_(view)|Sales.vSalesPerson]]
 +
 +
|
 +
|
 +
|-
 +
| Select
 
| View
 
| View
| Select
 
|-
 
 
| [[Sales.vSalesPersonSalesByFiscalYears_(view)|Sales.vSalesPersonSalesByFiscalYears]]
 
| [[Sales.vSalesPersonSalesByFiscalYears_(view)|Sales.vSalesPersonSalesByFiscalYears]]
| View
+
 
| Select
+
|  
 +
|  
 
|-
 
|-
 +
| Update
 +
| Table
 
| [[Sales.SalesOrderHeader_(table)|Sales.SalesOrderHeader]]
 
| [[Sales.SalesOrderHeader_(table)|Sales.SalesOrderHeader]]
| Table
+
 
| Update
+
| Trigger
 +
| 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