Questions on Java, MySQL, and Spring Boot
For the SQL portion, write a PostgreSQL query using the provided users and orders tables. Return customers whose completed-order total is greater than the average completed-order total among customers with completed orders.
user_id, user_name, completed_order_count, and total_completed_amount.total_completed_amount descending, then user_id ascending.| Column | Type | Description |
|---|---|---|
| user_idPK | INT | Unique user identifier |
| user_name | VARCHAR(100) | User's display name |
| Column | Type | Description |
|---|---|---|
| order_idPK | INT | Unique order identifier |
| user_id | INT | User associated with the order |
| status | VARCHAR(20) | Order state |
| amount | NUMERIC(10,2) | Order amount |