Your question is SQL for Customer Returns. Start with the requirements and the three 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.
ABC Education uses its customer operations data to identify customers with unusually high return activity. Write a PostgreSQL query that returns customers whose percentage of delivered orders with an approved or refunded return exceeds 50%.
order_status = 'delivered'.| Column | Type | Description |
|---|---|---|
| customer_idPK | INTEGER | Unique customer identifier |
| customer_name | VARCHAR(100) | Customer's full name |
| VARCHAR(255) | Customer email address | |
| region | VARCHAR(50) | ABC Education operating region |
| Column | Type | Description |
|---|---|---|
| order_idPK | INTEGER | Unique order identifier |
| customer_id | INTEGER | Customer who placed the order |
| order_status | VARCHAR(20) | Order lifecycle status |
| Column | Type | Description |
|---|---|---|
| return_idPK | INTEGER | Unique return record identifier |
| order_id | INTEGER | Order associated with the return |
| return_status | VARCHAR(20) | Return processing status |