What is the name of the customer who has the most policies listed?
CREATE TABLE customers (customer_name VARCHAR, customer_id VARCHAR); CREATE TABLE customers_policies (customer_id VARCHAR)
SELECT TOP 1 t1.customer_name FROM customers AS t1 JOIN customers_policies AS t2 ON t1.customer_id = t2.customer_id GROUP BY t1.customer_name ORDER BY COUNT(*) DESC
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE customers (customer_name VARCHAR, customer_id VARCHAR); CREATE TABLE customers_policies (customer_id VARCHAR) Question: What is the name of the customer who has the most policies listed? [/INST] SELECT TOP 1 t1.customer_name FROM customers AS t1 JOIN customers_policies AS t2 ON t1.customer_id = t2.customer_id GROUP BY t1.customer_name ORDER BY COUNT(*) DESC </s>