Write a SQL query using window functions to rank customers by monthly revenue within each region at Keysight Technologies.
Use the provided customer and revenue transaction data. Include customers with at least one transaction, exclude customers without a region, and treat NULL revenue as zero.
region, revenue_month, customer_id, customer_name, monthly_revenue, and revenue_rank.revenue_month, region, revenue_rank, and customer_id.| Column | Type | Description |
|---|---|---|
| customer_idPK | INT | Unique customer identifier |
| customer_name | VARCHAR(100) | Customer business name |
| region | VARCHAR(50) | Customer geographic region |
| Column | Type | Description |
|---|---|---|
| transaction_idPK | INT | Unique revenue transaction identifier |
| customer_id | INT | Customer associated with the transaction |
| transaction_date | DATE | Date on which revenue was recorded |
| revenue | DECIMAL(12,2) | Revenue amount for the transaction |