Your question is Rank Top SKUs and Forecast Next Quarter. Start with the requirements and the one table 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.
You are given raw player transaction data from an Activision commerce feed. Build a summary view that identifies the top-performing SKUs by revenue and projects each SKU’s next-quarter performance using recent quarterly trends.
Your result should show the top SKUs ranked by current-quarter revenue, along with their quarter-over-quarter growth rate and a simple next-quarter revenue projection based on the latest two completed quarters. Use PostgreSQL syntax only.
| Column | Type | Description |
|---|---|---|
| transaction_idPK | BIGINT | Unique transaction identifier |
| player_id | BIGINT | Player who made the purchase |
| sku_id | VARCHAR(50) | Purchased SKU identifier |
| sku_name | VARCHAR(255) | Display name of the SKU |
| transaction_ts | TIMESTAMP | Transaction timestamp |
| units | INT | Units purchased |
| gross_revenue | NUMERIC(12,2) | Revenue from the transaction |
| currency_code | CHAR(3) | Currency code |
| transaction_status | VARCHAR(20) | Status such as completed, refunded, or pending |