ABC Commerce wants to identify customers with unusually high return activity. Write a PostgreSQL query that returns customers whose return percentage is greater than 50%.
orders.returns, while preserving customers with no returns during aggregation.return_percentage as returned orders divided by total orders, multiplied by 100, rounded to two decimals.Assume each non-null returns.order_id identifies a returned order. A return row with a null order ID is invalid for matching and must not increase any customer's return count.
| Column | Type | Description |
|---|---|---|
| order_idPK | INT | Unique order identifier |
| customer_id | INT | ABC Commerce customer identifier |
| customer_name | VARCHAR(100) | Customer display name |
| order_date | DATE | Date the order was placed |
| Column | Type | Description |
|---|---|---|
| return_idPK | INT | Unique return record identifier |
| order_id | INT | Order associated with the return, when known |
| returned_at | DATE | Date the order was returned |
| return_reason | VARCHAR(100) | Reason for the return |