This technical problem involves writing a SQL query to return all customers who have made a purchase in the last 30 days, as well as the total amount they have spent.
This solution is complete and solves the problem. It uses a JOIN to combine information from the customers and purchases table and then uses the GROUP BY clause to sum the total amount spent for each customer. The solution also uses the DATE_SUB function to only consider purchases made in the last 30 days.
Evaluated at: 2022-11-27 02:16:18