Tell me about your experience using SQL stored procedures in data engineering or ETL workflows.
For a hands-on PostgreSQL response, implement a procedure that refreshes the customer order summary for January 2025. Include valid handling for customers without qualifying orders and ensure the result can be regenerated consistently.
customer_id, customer_name, region, completed_order_count, and completed_order_total.customer_id ascending.| Column | Type | Description |
|---|---|---|
| customer_idPK | INT | Unique customer identifier |
| customer_name | VARCHAR(100) | Customer display name |
| region | VARCHAR(50) | Customer sales region |
| Column | Type | Description |
|---|---|---|
| order_idPK | INT | Unique source order identifier |
| customer_id | INT | Customer associated with the order |
| order_date | DATE | Date the order was placed |
| amount | NUMERIC(12,2) | Order monetary amount |
| status | VARCHAR(20) | Order processing status |
| Column | Type | Description |
|---|---|---|
| customer_idPK | INT | Customer identifier in the refreshed summary |
| customer_name | VARCHAR(100) | Customer display name |
| region | VARCHAR(50) | Customer sales region |
| completed_order_count | BIGINT | Number of completed January orders |
| completed_order_total | NUMERIC(12,2) | Total amount of completed January orders |