# Table: ProductReview

## Properties

Property | Value
--- | ---
Name | ProductReview
ID | 354100302
Owner | dbo
Schema | Production
Filegroup | PRIMARY
Data Size (KB) | 16 KB
Index Size (KB) | 120 KB
Rows | 4
Unused (KB) | 0 KB
ANSI Null On |
Quoted Identifier |
Lock Escalation | TABLE
Lock On Bulk Load |
Lob Data Space |
Filestream Data Space ID |
Has Unchecked Assembly Data |
Text In Row Limit (bytes) | Option not set
Large Value Types Out Of Row |
FullText Change Tracking On |
Tracked By Cdc |
Published |
Schema Published |
Replicated |
Replication Filter |
Merge Published |
Sync Tran Subscribed |
MS Shipped |
Modify Date | 8/8/2010 5:23:40 PM
Create Date | 8/8/2010 5:21:51 PM

## Extended Properties

Name | Value
--- | ---
MS_Description | Customer reviews of products they have purchased.

## Columns

Column ID | Column Name | Datatype | Nullable | Is Sparse | Is Column Set
--- | --- | --- | --- | --- | ---
1 | ProductReviewID | int |  |  |
2 | ProductID | int |  |  |
3 | ReviewerName | Name |  |  |
4 | ReviewDate | datetime |  |  |
5 | EmailAddress | nvarchar(50) |  |  |
6 | Rating | int |  |  |
7 | Comments | nvarchar(3850) |  |  |
8 | ModifiedDate | datetime |  |  |

## Identity Columns

Column | Seed Value | Increment Value | Last Value | Is Not For Replication | Is Computed | Is Sparse | Is Column Set
--- | --- | --- | --- | --- | --- | --- | ---
ProductReviewID | 1 | 1 | 4 |  |  |  |

## Primary Key Constraints

Name | Is System Named | Extended Property Name | Extended Property Value
--- | --- | --- | ---
PK_ProductReview_ProductReviewID |  | MS_Description | Primary key (clustered) constraint

## Primary Key Columns

Name
ProductReviewID

## Foreign Keys

Name | Referenced Object | Update Action | Delete Action
--- | --- | --- | ---
FK_ProductReview_Product_ProductID | Production.Product | No action | No action

## Column Level Check Constraints

Name | Column ID | Column | Definition | Is Disabled | Is Not For Replication | Is Not Trusted | Uses Database Collation | Is System Named
--- | --- | --- | --- | --- | --- | --- | --- | ---
CK_ProductReview_Rating | 6 | Rating | ([Rating]>=(1) AND [Rating]<=(5)) |  |  |  |  |

## Table Level Check Constraints

No table constraints defined.

## Default Constraints

Name | Column | Definition | Is System Named | Extended Property Name | Extended Property Value
--- | --- | --- | --- | --- | ---
DF_ProductReview_ReviewDate | ReviewDate | (getdate()) |  | MS_Description | Default constraint value of GETDATE()
DF_ProductReview_ModifiedDate | ModifiedDate | (getdate()) |  | MS_Description | Default constraint value of GETDATE()

## Indexes

Name | Index Type | Primary Key | Unique | Unique Constraint | Ignore Duplicate Key | Disabled
--- | --- | --- | --- | --- | --- | ---
PK_ProductReview_ProductReviewID | CLUSTERED |  |  |  |  |
IX_ProductReview_ProductID_Name | NONCLUSTERED |  |  |  |  |

## FullText Indexes

Name | Corresponding Unique Index Name | Is Enabled | Change Tracking State Description
--- | --- | --- | ---
FullText Index | PK_ProductReview_ProductReviewID |  | Auto

## Referencing Tables

No referencing tables defined.

## Object Level Permissions

No object level permissions defined.

## Column Level Permissions

No explicit column permissions granted to this object

## Statistics

### Detailed Statistics General

Name | Updated | Rows | Rows Sampled | Steps | Density | Average Key Length | String Index | Filter Expression | Unfiltered Rows
--- | --- | --- | --- | --- | --- | --- | --- | --- | ---
PK_ProductReview_ProductReviewID | Aug 8 2010 5:22PM | 4 | 4 | 3 | 1 | 4 |  |  | 4

### Detailed Statistics Density

All Density | Average Length | Columns
--- | --- | ---
0.25 | 4 | ProductReviewID

### Detailed Statistics Histogram

Range High Key | Range Rows | Estimated Rows | Distinct Range Rows | Avg Range Rows
--- | --- | --- | --- | ---
1 | 0 | 1 | 0 | 1
3 | 1 | 1 | 1 | 1
4 | 0 | 1 | 0 | 1

### Detailed Statistics General

Name | Updated | Rows | Rows Sampled | Steps | Density | Average Key Length | String Index | Filter Expression | Unfiltered Rows
--- | --- | --- | --- | --- | --- | --- | --- | --- | ---
IX_ProductReview_ProductID_Name | Aug 8 2010 5:23PM | 4 | 4 | 3 | 0 | 23.5 |  |  | 4

### Detailed Statistics Density

All Density | Average Length | Columns
--- | --- | ---
0.3333333 | 4 | ProductID
0.25 | 19.5 | ProductID, ReviewerName
0.25 | 23.5 | ProductID, ReviewerName, ProductReviewID

### Detailed Statistics Histogram

Range High Key | Range Rows | Estimated Rows | Distinct Range Rows | Avg Range Rows
--- | --- | --- | --- | ---
709 | 0 | 1 | 0 | 1
798 | 0 | 1 | 0 | 1
937 | 0 | 2 | 0 | 1

## Objects that depend on [ProductReview]

- Production.ProductReview

## Objects on which [ProductReview] depends

- Production.ProductReview
  - Production.Product
    - Production.ProductSubcategory
      - Production.ProductCategory
        - dbo.Name
    - Production.UnitMeasure
    - Production.ProductModel
      - Production.ProductDescriptionSchemaCollection
      - Production.ManuInstructionsSchemaCollection
    - dbo.Flag

## SQL

Script
SET ANSI_NULLS ON SET QUOTED_IDENTIFIER ON CREATE TABLE [Production].[ProductReview]( [ProductReviewID] [int] IDENTITY(1,1) NOT NULL, [ProductID] [int] NOT NULL, [ReviewerName] [dbo].[Name] NOT NULL, [ReviewDate] [datetime] NOT NULL, [EmailAddress] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, [Rating] [int] NOT NULL, [Comments] [nvarchar](3850) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, [ModifiedDate] [datetime] NOT NULL ) ON [PRIMARY] EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Primary key for ProductReview records.' , @level0type=N'SCHEMA',@level0name=N'Production', @level1type=N'TABLE',@level1name=N'ProductReview', @level2type=N'COLUMN',@level2name=N'ProductReviewID' EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Product identification number. Foreign key to Product.ProductID.' , @level0type=N'SCHEMA',@level0name=N'Production', @level1type=N'TABLE',@level1name=N'ProductReview', @level2type=N'COLUMN',@level2name=N'ProductID' EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Name of the reviewer.' , @level0type=N'SCHEMA',@level0name=N'Production', @level1type=N'TABLE',@level1name=N'ProductReview', @level2type=N'COLUMN',@level2name=N'ReviewerName' EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Date review was submitted.' , @level0type=N'SCHEMA',@level0name=N'Production', @level1type=N'TABLE',@level1name=N'ProductReview', @level2type=N'COLUMN',@level2name=N'ReviewDate' EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Reviewer''s e-mail address.' , @level0type=N'SCHEMA',@level0name=N'Production', @level1type=N'TABLE',@level1name=N'ProductReview', @level2type=N'COLUMN',@level2name=N'EmailAddress' EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Product rating given by the reviewer. Scale is 1 to 5 with 5 as the highest rating.' , @level0type=N'SCHEMA',@level0name=N'Production', @level1type=N'TABLE',@level1name=N'ProductReview', @level2type=N'COLUMN',@level2name=N'Rating' EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Reviewer''s comments' , @level0type=N'SCHEMA',@level0name=N'Production', @level1type=N'TABLE',@level1name=N'ProductReview', @level2type=N'COLUMN',@level2name=N'Comments' EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Date and time the record was last updated.' , @level0type=N'SCHEMA',@level0name=N'Production', @level1type=N'TABLE',@level1name=N'ProductReview', @level2type=N'COLUMN',@level2name=N'ModifiedDate' EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Customer reviews of products they have purchased.' , @level0type=N'SCHEMA',@level0name=N'Production', @level1type=N'TABLE',@level1name=N'ProductReview'

#### See also

List of Tables