How would you identify customers who haven't made a purchase in the last 30 days but were previously active at Repsol?
Assume the analysis date is 2025-02-15 and only completed purchases count as activity. Return customers with at least one completed purchase before the 30-day cutoff.
customer_id, customer_name, last_purchase_date, and total_purchaseslast_purchase_date ascending, then customer_id ascending| Column | Type | Description |
|---|---|---|
| customer_idPK | INT | Unique Repsol customer identifier |
| customer_name | VARCHAR(100) | Customer name |
| signup_date | DATE | Date the customer registered |
| Column | Type | Description |
|---|---|---|
| purchase_idPK | INT | Unique purchase identifier |
| customer_id | INT | Customer associated with the purchase |
| purchase_date | DATE | Date of the purchase |
| purchase_status | VARCHAR(20) | Purchase status, such as completed or cancelled |
| amount_eur | DECIMAL(10,2) | Purchase value in euros |