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