This technical problem asks the reader to write a SQL query that returns the names and total spending for customers who have made a purchase from the store in the last 30 days. The input is provided in the form of two tables, customers and orders, and the output is expected in the form of a table with two columns, name and total_spent.
This solution is complete and solves the problem. It uses a JOIN to combine information from the customers and orders table and then uses the SUM function to calculate the total amount spent for each customer. The solution also uses the DATE_SUB function to only consider orders from the last 30 days.
Evaluated at: 2022-11-21 02:16:20