This stored procedure accepts a ProductID and returns a recordset of all reviews in the Reviews table for that product.
Definition:CREATE Procedure usp_ReviewsList ( @ProductID int ) AS SELECT ProductReviewID, ReviewerName, Rating, Comments FROM Production.ProductReview WHERE ProductID = @ProductID;Database Tables Used:
ProductReview: The ProductReview table has a many to one relationship to the Product table. The ProductReview table contains all product reviews written by users. We decided not to create a relationship between CustomerName to the FullName in the Customers table to allow for anyone to review a product without logging into the system. The ratings used in our implementation range from 1 to 5 stars. The actual review text is allowed to be as large as 3850 characters.