SQL Query Generator — illustrative example INPUT Table orders has customer_id and total; find each customer's total spending. RESULT SELECT customer_id, SUM(total) AS total_spend FROM orders GROUP BY customer_id; REVIEW SQL generation needs schema names and the meaning of the desired result. Clarify joins and aggregation before treating a query as ready to run. This is a teaching example, not a live execution record.