Your question is SQL Join and Customer Totals. 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.
Univar Solutions needs a customer-level sales summary for reporting across its chemical distribution business. Write a PostgreSQL query that joins customer records with qualifying sales transactions.
customers, including customers with no completed sales.Place the sales-status condition in the join logic so customers without qualifying sales remain in the output.
| Column | Type | Description |
|---|---|---|
| customer_idPK | INT | Unique customer identifier |
| customer_name | VARCHAR(100) | Customer account name |
| region | VARCHAR(50) | Univar Solutions sales region |
| Column | Type | Description |
|---|---|---|
| sale_idPK | INT | Unique sales transaction identifier |
| customer_id | INT | Customer associated with the transaction |
| sale_date | DATE | Transaction date |
| sale_amount | NUMERIC(12,2) | Monetary value of the transaction |
| status | VARCHAR(20) | Transaction status |