What is the maximum total amount paid by a customer? List the customer id and amount.
CREATE TABLE Payments (customer_id VARCHAR, amount_paid INTEGER)
SELECT TOP 1 customer_id, SUM(amount_paid) FROM Payments GROUP BY customer_id ORDER BY SUM(amount_paid) DESC
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE Payments (customer_id VARCHAR, amount_paid INTEGER) Question: What is the maximum total amount paid by a customer? List the customer id and amount. [/INST] SELECT TOP 1 customer_id, SUM(amount_paid) FROM Payments GROUP BY customer_id ORDER BY SUM(amount_paid) DESC </s>