Tell me about a time you used SQL to solve a business problem.
Support your answer with a representative PostgreSQL query using the supplied customer and order tables. Explain the business question, assumptions, validation steps, and how the result informed a decision.
customer_id, customer_name, completed_order_count, total_revenue, and latest_order_date.| Column | Type | Description |
|---|---|---|
| customer_idPK | INT | Unique customer identifier |
| customer_name | VARCHAR(100) | Customer display name |
| segment | VARCHAR(30) | Optional customer segment |
| Column | Type | Description |
|---|---|---|
| order_idPK | INT | Unique order identifier |
| customer_id | INT | Customer associated with the order |
| order_date | DATE | Date the order was placed |
| status | VARCHAR(20) | Order processing status |
| amount | NUMERIC(10,2) | Order revenue amount |