Loading problem...
A revenue operations team needs a weekly influence report for account managers. Each customer account is owned by exactly one salesperson, and every sale belongs to a customer account.
Table: Salesperson
Table: Customer
Table: Sales
Influence metric:
Important rules:
Task: Return one row per salesperson with columns:
Supported submission environments:
Salesperson:
| salesperson_id | name |
|----------------|-------|
| 1 | Alice |
| 2 | Bob |
| 3 | Kim |
Customer:
| customer_id | salesperson_id |
|-------------|----------------|
| 11 | 1 |
| 12 | 1 |
| 20 | 2 |
Sales:
| sale_id | customer_id | price |
|---------|-------------|-------|
| 1001 | 11 | 300 |
| 1002 | 12 | 450 |
| 1003 | 20 | 200 |
| 1004 | 20 | 700 |[
{"salesperson_id":1,"name":"Alice","total":750},
{"salesperson_id":2,"name":"Bob","total":900},
{"salesperson_id":3,"name":"Kim","total":0}
]Alice owns customers 11 and 12, Bob owns customer 20, and Kim owns no customers, so Kim appears with total 0.
Salesperson:
| salesperson_id | name |
|----------------|--------|
| 10 | Nora |
| 20 | Priya |
Customer:
| customer_id | salesperson_id |
|-------------|----------------|
| 100 | 10 |
| 101 | 10 |
| 200 | 20 |
Sales:
| sale_id | customer_id | price |
|---------|-------------|-------|
| 1 | 100 | 50 |
| 2 | 100 | 30 |[
{"salesperson_id":10,"name":"Nora","total":80},
{"salesperson_id":20,"name":"Priya","total":0}
]Priya has a customer assignment but no sales rows for that customer, so Priya still appears with total 0.
Salesperson:
| salesperson_id | name |
|----------------|------|
| 99 | Omar |
Customer:
| customer_id | salesperson_id |
|-------------|----------------|
Sales:
| sale_id | customer_id | price |
|---------|-------------|-------|[
{"salesperson_id":99,"name":"Omar","total":0}
]With no customers and no sales, the salesperson must still be returned with zero total.
Constraints