Modules
Data Analyst
Data Engineer
Product Data Scientist
AI Engineer
Machine Learning Engineer
Prompt Engineer
Using the table payments (from the previous question) which has the following columns:
| Column Name | Description |
|---|---|
| payment_id | Unique ID for each payment |
| customer_id | ID of the customer |
| amount | Amount of the payment |
| payment_date | Date of the payment |
| category | Payment category ('Retail', 'Service', 'Subscription') |
You are being asked to analyze the average monthly payment amounts by category, but only include months. Round your average payment by 2 decimal points.
Hint: Group your data by month using DATE_TRUNC('month', payment_date)
| month | avg_retail | avg_service | avg_subscription |
|---|---|---|---|
| 2023-04-01 | 370 | 645 | 1306 |
| 2023-02-01 | 227.5 | 776 | 1165 |
| 2023-10-01 | 445 | 710 | 1120 |
| 2023-05-01 | 360 | 586 | 1020 |
Using the table payments (from the previous question) which has the following columns:
| Column Name | Description |
|---|---|
| payment_id | Unique ID for each payment |
| customer_id | ID of the customer |
| amount | Amount of the payment |
| payment_date | Date of the payment |
| category | Payment category ('Retail', 'Service', 'Subscription') |
You are being asked to analyze the average monthly payment amounts by category, but only include months. Round your average payment by 2 decimal points.
Hint: Group your data by month using DATE_TRUNC('month', payment_date)
| month | avg_retail | avg_service | avg_subscription |
|---|---|---|---|
| 2023-04-01 | 370 | 645 | 1306 |
| 2023-02-01 | 227.5 | 776 | 1165 |
| 2023-10-01 | 445 | 710 | 1120 |
| 2023-05-01 | 360 | 586 | 1020 |