Description
Sales performance tracking.
Table properties
| name | value |
|---|
| name | [Sales].[SalesPersonQuotaHistory] |
| created | Mar 19 2009 9:09PM |
| modified | Mar 19 2009 9:10PM
|
| ansi nulls | on
|
| quoted identifier | on
|
| row count | 163 |
| Size of data | 16 kb |
| Size of indexes | 32 kb |
| Maximum size of a single row | 44 bytes |
Columns
| column | datatype | length | bytes | default | nulls | PK | FK | UQ | computed | comment |
|---|
| BusinessEntityID | int | 10 | 4 | | no
| composite PK
| SalesPerson.BusinessEntityID
|
| no
| Sales person identification number. Foreign key to SalesPerson.BusinessEntityID.
|
| QuotaDate | datetime | 23 | 8 | | no
| composite PK
| |
| no
| Sales quota date.
|
| SalesQuota | money | 19 | 8 | | no
|
| |
| no
| Sales quota amount.
|
| rowguid | uniqueidentifier | 36 | 16 | (newid()) | no
|
| |
| no
| ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
|
| ModifiedDate | datetime | 23 | 8 | (getdate()) | no
|
| |
| no
| Date and time the record was last updated.
|
Indexes
References
Foreign key graph
Foreign keys
| name | columns | foreign columns | type | comment |
|---|
| FK_SalesPersonQuotaHistory_SalesPerson_BusinessEntityID | BusinessEntityID | SalesPerson.BusinessEntityID |
| Foreign key constraint referencing SalesPerson.SalesPersonID.
|
Check constraints
Defaults
Dependency graph
Sample rows
| BusinessEntityID | QuotaDate | SalesQuota | rowguid | ModifiedDate |
|---|
| 274
| 7/1/2001 12:00:00 AM
| 28000.0000
| 99109bbf-8693-4587-bc23-6036ec89e1be
| 5/17/2001 12:00:00 AM
|
| 274
| 10/1/2001 12:00:00 AM
| 7000.0000
| dfd01444-8900-461c-8d6f-04598dae01d4
| 8/17/2001 12:00:00 AM
|
| 274
| 1/1/2002 12:00:00 AM
| 91000.0000
| 0a69f453-9689-4ccf-a08c-c644670f5668
| 11/17/2001 12:00:00 AM
|
| 274
| 4/1/2002 12:00:00 AM
| 140000.0000
| da8d1458-5fb9-4c3e-9ead-8f5ce1393047
| 2/15/2002 12:00:00 AM
|
| 274
| 7/1/2002 12:00:00 AM
| 70000.0000
| 760cef84-b980-417b-a667-7358c38857f0
| 5/17/2002 12:00:00 AM
|
| 274
| 10/1/2002 12:00:00 AM
| 154000.0000
| fb29e024-f26a-49aa-a7cc-c99ae7ba4853
| 8/17/2002 12:00:00 AM
|
| 274
| 1/1/2003 12:00:00 AM
| 107000.0000
| 13947d2c-a254-47c9-8817-cbd186ffa526
| 11/17/2002 12:00:00 AM
|
| 274
| 4/1/2003 12:00:00 AM
| 58000.0000
| bc1a222f-47a0-48d1-9c56-ac873269dc98
| 2/15/2003 12:00:00 AM
|
| 274
| 7/1/2003 12:00:00 AM
| 263000.0000
| 8b4e3cbf-f0ef-49c5-9a8c-87679055057e
| 5/17/2003 12:00:00 AM
|
| 274
| 10/1/2003 12:00:00 AM
| 116000.0000
| e9de95e3-b119-4441-bd1d-b27fc4516022
| 8/17/2003 12:00:00 AM
|
Code
CREATE TABLE [Sales].[SalesPersonQuotaHistory](
[BusinessEntityID] [int] NOT NULL,
[QuotaDate] [datetime] NOT NULL,
[SalesQuota] [money] NOT NULL,
[rowguid] [uniqueidentifier] ROWGUIDCOL NOT NULL,
[BusinessEntityID] [int] NOT NULL,
[QuotaDate] [datetime] NOT NULL,
[SalesQuota] [money] NOT NULL,
[ModifiedDate] [datetime] NOT NULL,
CONSTRAINT [PK_SalesPersonQuotaHistory_BusinessEntityID_QuotaDate] PRIMARY KEY CLUSTERED
(
[BusinessEntityID] ASC,
[QuotaDate] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
ALTER TABLE [Sales].[SalesPersonQuotaHistory] WITH CHECK ADD CONSTRAINT [FK_SalesPersonQuotaHistory_SalesPerson_BusinessEntityID] FOREIGN KEY([BusinessEntityID])
REFERENCES [Sales].[SalesPerson] ([BusinessEntityID])
ALTER TABLE [Sales].[SalesPersonQuotaHistory] CHECK CONSTRAINT [FK_SalesPersonQuotaHistory_SalesPerson_BusinessEntityID]
ALTER TABLE [Sales].[SalesPersonQuotaHistory] WITH CHECK ADD CONSTRAINT [CK_SalesPersonQuotaHistory_SalesQuota] CHECK (([SalesQuota]>(0.00)))
ALTER TABLE [Sales].[SalesPersonQuotaHistory] CHECK CONSTRAINT [CK_SalesPersonQuotaHistory_SalesQuota]
ALTER TABLE [Sales].[SalesPersonQuotaHistory] ADD CONSTRAINT [DF_SalesPersonQuotaHistory_rowguid] DEFAULT (newid()) FOR [rowguid]
ALTER TABLE [Sales].[SalesPersonQuotaHistory] ADD CONSTRAINT [DF_SalesPersonQuotaHistory_ModifiedDate] DEFAULT (getdate()) FOR [ModifiedDate]