Description
Customer reviews of products they have purchased.
Table properties
| name | value |
|---|
| name | [Production].[ProductReview] |
| created | Mar 19 2009 9:08PM |
| modified | Mar 19 2009 9:08PM
|
| ansi nulls | on
|
| quoted identifier | on
|
| row count | 4 |
| Size of data | 16 kb |
| Size of indexes | 56 kb |
| Maximum size of a single row | 15,828 bytes |
Columns
| column | datatype | length | bytes | default | nulls | PK | FK | UQ | computed | comment |
|---|
| ProductReviewID | int identity(1,1) | 10 | 4 | | no
| yes
| |
| no
| Primary key for ProductReview records.
|
| ProductID | int | 10 | 4 | | no
|
| Product.ProductID
|
| no
| Product identification number. Foreign key to Product.ProductID.
|
| ReviewerName | Name | 50 | 200 | | no
|
| |
| no
| Name of the reviewer.
|
| ReviewDate | datetime | 23 | 8 | (getdate()) | no
|
| |
| no
| Date review was submitted.
|
| EmailAddress | nvarchar(50) | 50 | 200 | | no
|
| |
| no
| Reviewer's e-mail address.
|
| Rating | int | 10 | 4 | | no
|
| |
| no
| Product rating given by the reviewer. Scale is 1 to 5 with 5 as the highest rating.
|
| Comments | nvarchar(3850) | 3850 | 15400 | | yes
|
| |
| no
| Reviewer's comments
|
| 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_ProductReview_Product_ProductID | ProductID | Product.ProductID |
| Foreign key constraint referencing Product.ProductID.
|
Check constraints
| name | column | comment |
|---|
CK_ProductReview_Rating([Rating]>=(1) AND [Rating]<=(5)) | Rating
| Check constraint [Rating] BETWEEN (1) AND (5)
|
Defaults
Dependency graph
Objects that [Production].[ProductReview] depends on
| name | object type | level |
|---|
| Name | type | 1 |
Sample rows
| ProductReviewID | ProductID | ReviewerName | ReviewDate | EmailAddress | Rating | Comments | ModifiedDate |
|---|
| 1
| 709
| John Smith
| 10/20/2003 12:00:00 AM
| john@fourthcoffee.com
| 5
| I can't believe I'm singing the praises of a pair of socks, but I just came back from a grueling
3-...
| 10/20/2003 12:00:00 AM
|
| 2
| 937
| David
| 12/15/2003 12:00:00 AM
| david@graphicdesigninstitute.com
| 4
| A little on the heavy side, but overall the entry/exit is easy in all conditions. I've used these pe...
| 12/15/2003 12:00:00 AM
|
| 3
| 937
| Jill
| 12/17/2003 12:00:00 AM
| jill@margiestravel.com
| 2
| Maybe it's just because I'm new to mountain biking, but I had a terrible time getting use
to these ...
| 12/17/2003 12:00:00 AM
|
| 4
| 798
| Laura Norman
| 12/17/2003 12:00:00 AM
| laura@treyresearch.net
| 5
| The Road-550-W from Adventure Works Cycles is everything it's advertised to be. Finally, a quality b...
| 12/17/2003 12:00:00 AM
|
Code
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,
[ProductReviewID] [int] IDENTITY(1,1) NOT NULL,
[ReviewDate] [datetime] NOT NULL,
[EmailAddress] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[Rating] [int] NOT NULL,
[ModifiedDate] [datetime] NOT NULL,
CONSTRAINT [PK_ProductReview_ProductReviewID] PRIMARY KEY CLUSTERED
(
[ProductReviewID] 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 [Production].[ProductReview] WITH CHECK ADD CONSTRAINT [FK_ProductReview_Product_ProductID] FOREIGN KEY([ProductID])
REFERENCES [Production].[Product] ([ProductID])
ALTER TABLE [Production].[ProductReview] CHECK CONSTRAINT [FK_ProductReview_Product_ProductID]
ALTER TABLE [Production].[ProductReview] WITH CHECK ADD CONSTRAINT [CK_ProductReview_Rating] CHECK (([Rating]>=(1) AND [Rating]<=(5)))
ALTER TABLE [Production].[ProductReview] CHECK CONSTRAINT [CK_ProductReview_Rating]
ALTER TABLE [Production].[ProductReview] ADD CONSTRAINT [DF_ProductReview_ReviewDate] DEFAULT (getdate()) FOR [ReviewDate]
ALTER TABLE [Production].[ProductReview] ADD CONSTRAINT [DF_ProductReview_ModifiedDate] DEFAULT (getdate()) FOR [ModifiedDate]