Amazon’s customer analytics team wants to identify when each customer made their second purchase. Write a PostgreSQL query that returns every customer, including customers who have not yet made two purchases.
For this exercise, multiple purchases by the same customer on the same calendar date count as one purchase date.
NULL when no second date exists.customer_id, customer_name, and second_purchase_date, in that order.customer_id ascending.| Column | Type | Description |
|---|---|---|
| customer_idPK | INT | Unique Amazon customer identifier |
| customer_name | VARCHAR(100) | Customer’s name |
| Column | Type | Description |
|---|---|---|
| purchase_idPK | INT | Unique purchase identifier |
| customer_id | INT | Customer who made the purchase |
| purchase_date | DATE | Calendar date of the purchase |
| purchase_channel | VARCHAR(30) | Amazon purchase channel |