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