What are the name, phone number and email address of the customer who made the largest number of orders?
CREATE TABLE customers (customer_name VARCHAR, customer_phone VARCHAR, customer_email VARCHAR, customer_id VARCHAR); CREATE TABLE customer_orders (customer_id VARCHAR)
SELECT TOP 1 T1.customer_name, T1.customer_phone, T1.customer_email FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id GROUP BY T2.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_name VARCHAR, customer_phone VARCHAR, customer_email VARCHAR, customer_id VARCHAR); CREATE TABLE customer_orders (customer_id VARCHAR) Question: What are the name, phone number and email address of the customer who made the largest number of orders? [/INST] SELECT TOP 1 T1.customer_name, T1.customer_phone, T1.customer_email FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id GROUP BY T2.customer_id ORDER BY COUNT(*) DESC </s>