Sales |
04/26/2006 |
PRIMARY |
8 |
24 |
17 |
Sales representative current information. |
|
|
SalesPersonID |
int |
4 |
|
|
|
|
Primary key for SalesPerson records. |
|
|
TerritoryID |
int |
4 |
|
|
|
|
Territory currently assigned to. Foreign key to SalesTerritory.SalesTerritoryID. |
|
|
SalesQuota |
money |
8 |
|
|
|
|
Projected yearly sales. |
|
|
Bonus |
money |
8 |
|
((0.00)) |
|
|
Bonus due if quota is met. |
|
|
CommissionPct |
smallmoney |
4 |
|
((0.00)) |
|
|
Commision percent received per sale. |
|
|
SalesYTD |
money |
8 |
|
((0.00)) |
|
|
Sales total year to date. |
|
|
SalesLastYear |
money |
8 |
|
((0.00)) |
|
|
Sales total of previous year. |
|
|
rowguid |
uniqueidentifier |
16 |
|
(newid()) |
|
|
ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample. |
|
|
ModifiedDate |
datetime |
8 |
|
(getdate()) |
|
|
Date and time the record was last updated. |
Total: 9 column(s)
Total: 2 index(es)
|
CK_SalesPerson_Bonus |
([Bonus]>=(0.00)) |
|
CK_SalesPerson_CommissionPct |
([CommissionPct]>=(0.00)) |
|
CK_SalesPerson_SalesLastYear |
([SalesLastYear]>=(0.00)) |
|
CK_SalesPerson_SalesQuota |
([SalesQuota]>(0.00)) |
|
CK_SalesPerson_SalesYTD |
([SalesYTD]>=(0.00)) |
Total: 5 constraint(s)
Total: 4 table(s)
Total: 2 table(s)
Total: 7 object(s)
Total: 15 object(s)
CREATE TABLE [SalesPerson] (
[SalesPersonID] [int] NOT NULL ,
[TerritoryID] [int] NULL ,
[SalesQuota] [money] NULL ,
[Bonus] [money] NOT NULL CONSTRAINT [DF_SalesPerson_Bonus] DEFAULT ((0.00)),
[CommissionPct] [smallmoney] NOT NULL CONSTRAINT [DF_SalesPerson_CommissionPct] DEFAULT ((0.00)),
[SalesYTD] [money] NOT NULL CONSTRAINT [DF_SalesPerson_SalesYTD] DEFAULT ((0.00)),
[SalesLastYear] [money] NOT NULL CONSTRAINT [DF_SalesPerson_SalesLastYear] DEFAULT ((0.00)),
[rowguid] uniqueidentifier ROWGUIDCOL NOT NULL CONSTRAINT [DF_SalesPerson_rowguid] DEFAULT (newid()),
[ModifiedDate] [datetime] NOT NULL CONSTRAINT [DF_SalesPerson_ModifiedDate] DEFAULT (getdate()),
CONSTRAINT [PK_SalesPerson_SalesPersonID] PRIMARY KEY CLUSTERED
(
[SalesPersonID]
) ON [PRIMARY] ,
CONSTRAINT [FK_SalesPerson_Employee_SalesPersonID] FOREIGN KEY
(
[SalesPersonID]
) REFERENCES [Employee] (
[EmployeeID]
),
CONSTRAINT [FK_SalesPerson_SalesTerritory_TerritoryID] FOREIGN KEY
(
[TerritoryID]
) REFERENCES [SalesTerritory] (
[TerritoryID]
),
CONSTRAINT [CK_SalesPerson_Bonus] CHECK ([Bonus]>=(0.00)),
CONSTRAINT [CK_SalesPerson_CommissionPct] CHECK ([CommissionPct]>=(0.00)),
CONSTRAINT [CK_SalesPerson_SalesLastYear] CHECK ([SalesLastYear]>=(0.00)),
CONSTRAINT [CK_SalesPerson_SalesQuota] CHECK ([SalesQuota]>(0.00)),
CONSTRAINT [CK_SalesPerson_SalesYTD] CHECK ([SalesYTD]>=(0.00))
) ON [PRIMARY]
GO
List of tables