Write a SQL query to find the repeat purchase rate of customers who bought a specific skincare product within 30 days of their initial purchase. Use the Sephora product named Hydrating Facial Mask and treat a repeat as another purchase of that same product within 30 calendar days.
product_name, initial_customers, repeat_customers, and repeat_purchase_rate.| Column | Type | Description |
|---|---|---|
| customer_idPK | INT | Unique customer identifier |
| customer_name | VARCHAR(100) | Customer display name |
| VARCHAR(255) | Customer email address |
| Column | Type | Description |
|---|---|---|
| product_idPK | INT | Unique product identifier |
| product_name | VARCHAR(150) | Product name |
| category | VARCHAR(80) | Merchandising category |
| description | TEXT | Product description |
| Column | Type | Description |
|---|---|---|
| order_idPK | INT | Unique order identifier |
| customer_id | INT | Customer who placed the order |
| order_date | DATE | Date the order was placed |
| order_status | VARCHAR(30) | Order fulfillment status |
| Column | Type | Description |
|---|---|---|
| order_item_idPK | INT | Unique order-line identifier |
| order_id | INT | Related order |
| product_id | INT | Purchased product |
| quantity | INT | Units purchased |