Your question is Average Star Rating by Month. Start with the requirements and the two tables on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Amazon's Business Analytics team wants to monitor how customer sentiment changes for products over time. Write a PostgreSQL query that calculates the average published star rating for each product and calendar month.
products with customer_reviews using product_id.YYYY-MM.| Column | Type | Description |
|---|---|---|
| product_idPK | INT | Unique Amazon product identifier |
| product_name | VARCHAR(150) | Product display name |
| category | VARCHAR(80) | Product category |
| Column | Type | Description |
|---|---|---|
| review_idPK | INT | Unique customer review identifier |
| product_id | INT | Referenced product identifier |
| star_rating | INT | Customer rating from 1 to 5 |
| review_date | DATE | Date the review was submitted |
| review_status | VARCHAR(20) | Moderation status of the review |