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