Your question is Revenue by Month From Orders. 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.
Mutual of Omaha's customer portal reporting team needs a monthly revenue summary based only on orders associated with known customers. Write a PostgreSQL query that joins orders to customers and aggregates order amounts by calendar month.
customer_id.order_date.YYYY-MM and total revenue for that month, ignoring NULL amounts.| Column | Type | Description |
|---|---|---|
| customer_idPK | INTEGER | Unique customer identifier |
| customer_name | VARCHAR(100) | Customer's full name |
| VARCHAR(150) | Customer email address |
| Column | Type | Description |
|---|---|---|
| order_idPK | INTEGER | Unique order identifier |
| customer_id | INTEGER | References customers.customer_id |
| order_date | DATE | Date the order was placed |
| order_amount | NUMERIC(12,2) | Revenue amount for the order |