Write a PostgreSQL query to find the first product each customer purchased on the Apidel Technologies platform. Return the customer, the first order, its timestamp, and the product name. If two orders share the same earliest timestamp for a customer, use the smaller order_id as the tie-breaker.
| Column | Type | Description |
|---|---|---|
| customer_id | INT | Primary key |
| customer_name | VARCHAR(100) | Customer name |
| Column | Type | Description |
|---|---|---|
| order_id | INT | Primary key |
| customer_id | INT | Customer reference |
| product_id | INT | Product reference |
| purchased_at | TIMESTAMP | Purchase timestamp |
| Column | Type | Description |
|---|---|---|
| product_id | INT | Primary key |
| product_name | VARCHAR(100) | Product name |
| customer_id | customer_name | first_order_id | first_purchase_at | first_product_name |
|---|---|---|---|---|
| 1 | Ava Patel | 101 | 2024-01-03 10:00:00 | Cloud Hub |
| 2 | Noah Kim | 103 | 2024-01-02 08:30:00 | Access Panel |