Virtusa's delivery portfolio team needs to identify the highest-performing services within selected categories. Write a PostgreSQL query that aggregates completed sales and ranks services independently within the Cloud and Data & AI categories.
category, product_name, total_revenue, and performance_rank.performance_rank.category, performance_rank, and product_name ascending, while sorting total_revenue descending.total_revenue equal to 0.00.| Column | Type | Description |
|---|---|---|
| product_idPK | INT | Unique service identifier |
| product_name | VARCHAR(120) | Virtusa delivery service name |
| category | VARCHAR(80) | Service category |
| active | BOOLEAN | Whether the service is currently offered |
| Column | Type | Description |
|---|---|---|
| sale_idPK | INT | Unique sales record identifier |
| product_id | INT | Referenced service, nullable for unassigned sales |
| amount | DECIMAL(12,2) | Sale value |
| status | VARCHAR(20) | Sale processing status |