Properties

Owner: Production 
Creation Date: 04/26/2006 
Located On: PRIMARY 
Data Size KB: 16 
Index Size KB: 56 
Rows:
Description: Customer reviews of products they have purchased. 

Columns

Name Data Type Length NULL Default IsIdentity IsGUID Description
    ProductReviewID  int          Primary key for ProductReview records. 
    ProductID  int          Product identification number. Foreign key to Product.ProductID. 
    ReviewerName  Name  100          Name of the reviewer. 
    ReviewDate  datetime    (getdate())      Date review was submitted. 
    EmailAddress  nvarchar  50          Reviewer's e-mail address. 
    Rating  int          Product rating given by the reviewer. Scale is 1 to 5 with 5 as the highest rating. 
    Comments  nvarchar  3850          Reviewer's comments 
    ModifiedDate  datetime    (getdate())      Date and time the record was last updated. 
Total: 8 column(s)

Identity column

Name Seed Increment Not for replication
  ProductReviewID   

Indexes

Index Primary Unique Description
  PK_ProductReview_ProductReviewID      Primary key (clustered) constraint 
  IX_ProductReview_ProductID_Name      Nonclustered index. 
Total: 2 index(es)

Check Constraints

Name Expression
  CK_ProductReview_Rating  ([Rating]>=(1) AND [Rating]<=(5)) 
Total: 1 constraint(s)

Referenced Tables

Table Foreign Key Primary Key or Unique Constraint
  Production.Product  FK_ProductReview_Product_ProductID  PK_Product_ProductID 
Total: 1 table(s)

Objects that [Production].[ProductReview] depends on

Object Name Owner Object Type Dep Level
  Flag  dbo  User Defined type 
  Name  dbo  User Defined type 
  ProductCategory  Production  Table 
  ProductModel  Production  Table 
  UnitMeasure  Production  Table 
  ProductSubcategory  Production  Table 
  Product  Production  Table 
Total: 7 object(s)

SQL

CREATE TABLE [ProductReview] (
    [ProductReviewID] [int] IDENTITY (1, 1) NOT NULL ,
    [ProductID] [int] NOT NULL ,
    [ReviewerName] [Name] NOT NULL ,
    [ReviewDate] [datetime] NOT NULL CONSTRAINT [DF_ProductReview_ReviewDate] DEFAULT (getdate()),
    [EmailAddress] [nvarchar] (50) COLLATE Latin1_General_CS_AS NOT NULL ,
    [Rating] [int] NOT NULL ,
    [Comments] [nvarchar] (3850) COLLATE Latin1_General_CS_AS NULL ,
    [ModifiedDate] [datetime] NOT NULL CONSTRAINT [DF_ProductReview_ModifiedDate] DEFAULT (getdate()),
    CONSTRAINT [PK_ProductReview_ProductReviewID] PRIMARY KEY  CLUSTERED
    (
        [ProductReviewID]
    )  ON [PRIMARY] ,
    CONSTRAINT [FK_ProductReview_Product_ProductID] FOREIGN KEY
    (
        [ProductID]
    ) REFERENCES [Product] (
        [ProductID]
    ),
    CONSTRAINT [CK_ProductReview_Rating] CHECK ([Rating]>=(1) AND [Rating]<=(5))
) ON [PRIMARY]
GO


See Also

List of tables