input
stringlengths
122
2.7k
output
stringlengths
24
805
[INST] Here is a database schema: driver : driver_id [ INTEGER ] primary_key first_name [ TEXT ] last_name [ TEXT ] address [ TEXT ] city [ TEXT ] state [ TEXT ] zip_code [ INTEGER ] phone [ TEXT ] shipment : ship_id [ INTEGER ] primary_key cust_id [ INTEGER ] shipment.cust_id = customer.cust_id weight [ REAL ] truck_i...
SELECT T1.weight FROM shipment AS T1 INNER JOIN driver AS T2 ON T1.driver_id = T2.driver_id WHERE T2.first_name = 'Leszek' AND T2.last_name = 'Kieltyka' AND T1.ship_date = '2017-09-25';
[INST] Here is a database schema: city : city_id [ INTEGER ] primary_key city_name [ TEXT ] state [ TEXT ] population [ INTEGER ] area [ REAL ] shipment : ship_id [ INTEGER ] primary_key cust_id [ INTEGER ] shipment.cust_id = customer.cust_id weight [ REAL ] truck_id [ INTEGER ] shipment.truck_id = truck.truck_id drive...
SELECT T2.area FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id WHERE T1.ship_id = '1346';
[INST] Here is a database schema: customer : cust_id [ INTEGER ] primary_key cust_name [ TEXT ] annual_revenue [ INTEGER ] cust_type [ TEXT ] address [ TEXT ] city [ TEXT ] state [ TEXT ] zip [ REAL ] phone [ TEXT ] shipment : ship_id [ INTEGER ] primary_key cust_id [ INTEGER ] shipment.cust_id = customer.cust_id weigh...
SELECT T1.weight FROM shipment AS T1 INNER JOIN customer AS T2 ON T1.cust_id = T2.cust_id WHERE T2.cust_name = 'U-haul Center Of N Syracuse' AND T1.ship_date = '2016-09-21';
[INST] Here is a database schema: driver : driver_id [ INTEGER ] primary_key first_name [ TEXT ] last_name [ TEXT ] address [ TEXT ] city [ TEXT ] state [ TEXT ] zip_code [ INTEGER ] phone [ TEXT ] truck : truck_id [ INTEGER ] primary_key make [ TEXT ] model_year [ INTEGER ] shipment : ship_id [ INTEGER ] primary_key c...
SELECT T3.first_name, T3.last_name FROM truck AS T1 INNER JOIN shipment AS T2 ON T1.truck_id = T2.truck_id INNER JOIN driver AS T3 ON T3.driver_id = T2.driver_id WHERE T1.truck_id = '3' AND T2.ship_date = '2016-09-19';
[INST] Here is a database schema: city : city_id [ INTEGER ] primary_key city_name [ TEXT ] state [ TEXT ] population [ INTEGER ] area [ REAL ] shipment : ship_id [ INTEGER ] primary_key cust_id [ INTEGER ] shipment.cust_id = customer.cust_id weight [ REAL ] truck_id [ INTEGER ] shipment.truck_id = truck.truck_id drive...
SELECT T2.area / T2.population FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id WHERE T1.ship_id = '1369';
[INST] Here is a database schema: truck : truck_id [ INTEGER ] primary_key make [ TEXT ] model_year [ INTEGER ] shipment : ship_id [ INTEGER ] primary_key cust_id [ INTEGER ] shipment.cust_id = customer.cust_id weight [ REAL ] truck_id [ INTEGER ] shipment.truck_id = truck.truck_id driver_id [ INTEGER ] shipment.driver...
SELECT CAST(COUNT(T2.ship_id) AS REAL) / COUNT(DISTINCT T1.truck_id) FROM truck AS T1 INNER JOIN shipment AS T2 ON T1.truck_id = T2.truck_id WHERE T1.make = 'Kenworth';
[INST] Here is a database schema: driver : driver_id [ INTEGER ] primary_key first_name [ TEXT ] last_name [ TEXT ] address [ TEXT ] city [ TEXT ] state [ TEXT ] zip_code [ INTEGER ] phone [ TEXT ] shipment : ship_id [ INTEGER ] primary_key cust_id [ INTEGER ] shipment.cust_id = customer.cust_id weight [ REAL ] truck_i...
SELECT T1.weight FROM shipment AS T1 INNER JOIN driver AS T2 ON T1.driver_id = T2.driver_id WHERE T2.first_name = 'Sue' AND T2.last_name = 'Newell' ORDER BY T1.ship_date ASC LIMIT 1;
[INST] Here is a database schema: customer : cust_id [ INTEGER ] primary_key cust_name [ TEXT ] annual_revenue [ INTEGER ] cust_type [ TEXT ] address [ TEXT ] city [ TEXT ] state [ TEXT ] zip [ REAL ] phone [ TEXT ] shipment : ship_id [ INTEGER ] primary_key cust_id [ INTEGER ] shipment.cust_id = customer.cust_id weigh...
SELECT T2.cust_name FROM shipment AS T1 INNER JOIN customer AS T2 ON T1.cust_id = T2.cust_id ORDER BY T1.weight DESC LIMIT 1;
[INST] Here is a database schema: driver : driver_id [ INTEGER ] primary_key first_name [ TEXT ] last_name [ TEXT ] address [ TEXT ] city [ TEXT ] state [ TEXT ] zip_code [ INTEGER ] phone [ TEXT ] shipment : ship_id [ INTEGER ] primary_key cust_id [ INTEGER ] shipment.cust_id = customer.cust_id weight [ REAL ] truck_i...
SELECT T2.first_name, T2.last_name FROM shipment AS T1 INNER JOIN driver AS T2 ON T1.driver_id = T2.driver_id ORDER BY T1.ship_date ASC LIMIT 1;
[INST] Here is a database schema: customer : cust_id [ INTEGER ] primary_key cust_name [ TEXT ] annual_revenue [ INTEGER ] cust_type [ TEXT ] address [ TEXT ] city [ TEXT ] state [ TEXT ] zip [ REAL ] phone [ TEXT ] shipment : ship_id [ INTEGER ] primary_key cust_id [ INTEGER ] shipment.cust_id = customer.cust_id weigh...
SELECT COUNT(T2.ship_id) FROM customer AS T1 INNER JOIN shipment AS T2 ON T1.cust_id = T2.cust_id WHERE T1.cust_name = 'Olympic Camper Sales Inc';
[INST] Here is a database schema: city : city_id [ INTEGER ] primary_key city_name [ TEXT ] state [ TEXT ] population [ INTEGER ] area [ REAL ] customer : cust_id [ INTEGER ] primary_key cust_name [ TEXT ] annual_revenue [ INTEGER ] cust_type [ TEXT ] address [ TEXT ] city [ TEXT ] state [ TEXT ] zip [ REAL ] phone [ T...
SELECT COUNT(*) FROM customer AS T1 INNER JOIN shipment AS T2 ON T1.cust_id = T2.cust_id INNER JOIN city AS T3 ON T3.city_id = T2.city_id WHERE T3.city_name = 'New York' AND T1.cust_name = 'Harry''s Hot Rod Auto & Truck Accessories';
[INST] Here is a database schema: truck : truck_id [ INTEGER ] primary_key make [ TEXT ] model_year [ INTEGER ] shipment : ship_id [ INTEGER ] primary_key cust_id [ INTEGER ] shipment.cust_id = customer.cust_id weight [ REAL ] truck_id [ INTEGER ] shipment.truck_id = truck.truck_id driver_id [ INTEGER ] shipment.driver...
SELECT COUNT(T2.ship_id) FROM truck AS T1 INNER JOIN shipment AS T2 ON T1.truck_id = T2.truck_id WHERE T1.make = 'Mack' ORDER BY T2.weight DESC LIMIT 1;
[INST] Here is a database schema: city : city_id [ INTEGER ] primary_key city_name [ TEXT ] state [ TEXT ] population [ INTEGER ] area [ REAL ] driver : driver_id [ INTEGER ] primary_key first_name [ TEXT ] last_name [ TEXT ] address [ TEXT ] city [ TEXT ] state [ TEXT ] zip_code [ INTEGER ] phone [ TEXT ] shipment : s...
SELECT T1.first_name, T1.last_name FROM driver AS T1 INNER JOIN shipment AS T2 ON T1.driver_id = T2.driver_id INNER JOIN city AS T3 ON T3.city_id = T2.city_id GROUP BY T1.first_name, T1.last_name, T3.population HAVING T3.population = MAX(T3.population) ORDER BY COUNT(*) DESC LIMIT 1;
[INST] Here is a database schema: truck : truck_id [ INTEGER ] primary_key make [ TEXT ] model_year [ INTEGER ] shipment : ship_id [ INTEGER ] primary_key cust_id [ INTEGER ] shipment.cust_id = customer.cust_id weight [ REAL ] truck_id [ INTEGER ] shipment.truck_id = truck.truck_id driver_id [ INTEGER ] shipment.driver...
SELECT COUNT(*) FROM truck AS T1 INNER JOIN shipment AS T2 ON T1.truck_id = T2.truck_id WHERE T2.weight < 1000 ORDER BY T1.model_year ASC LIMIT 1;
[INST] Here is a database schema: customer : cust_id [ INTEGER ] primary_key cust_name [ TEXT ] annual_revenue [ INTEGER ] cust_type [ TEXT ] address [ TEXT ] city [ TEXT ] state [ TEXT ] zip [ REAL ] phone [ TEXT ] shipment : ship_id [ INTEGER ] primary_key cust_id [ INTEGER ] shipment.cust_id = customer.cust_id weigh...
SELECT T2.annual_revenue FROM shipment AS T1 INNER JOIN customer AS T2 ON T1.cust_id = T2.cust_id GROUP BY T1.cust_id ORDER BY COUNT(T1.cust_id) DESC LIMIT 1;
[INST] Here is a database schema: city : city_id [ INTEGER ] primary_key city_name [ TEXT ] state [ TEXT ] population [ INTEGER ] area [ REAL ] customer : cust_id [ INTEGER ] primary_key cust_name [ TEXT ] annual_revenue [ INTEGER ] cust_type [ TEXT ] address [ TEXT ] city [ TEXT ] state [ TEXT ] zip [ REAL ] phone [ T...
SELECT COUNT(*) FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id INNER JOIN customer AS T3 ON T3.cust_id = T1.cust_id WHERE T2.city_name = 'Downey' AND STRFTIME('%Y', T1.ship_date) = '2016' AND T3.state = 'CA';
[INST] Here is a database schema: city : city_id [ INTEGER ] primary_key city_name [ TEXT ] state [ TEXT ] population [ INTEGER ] area [ REAL ] driver : driver_id [ INTEGER ] primary_key first_name [ TEXT ] last_name [ TEXT ] address [ TEXT ] city [ TEXT ] state [ TEXT ] zip_code [ INTEGER ] phone [ TEXT ] shipment : s...
SELECT COUNT(*) FROM driver AS T1 INNER JOIN shipment AS T2 ON T1.driver_id = T2.driver_id INNER JOIN city AS T3 ON T3.city_id = T2.city_id WHERE T1.first_name = 'Holger' AND T1.last_name = 'Nohr' AND T3.city_name = 'North Las Vegas';
[INST] Here is a database schema: city : city_id [ INTEGER ] primary_key city_name [ TEXT ] state [ TEXT ] population [ INTEGER ] area [ REAL ] shipment : ship_id [ INTEGER ] primary_key cust_id [ INTEGER ] shipment.cust_id = customer.cust_id weight [ REAL ] truck_id [ INTEGER ] shipment.truck_id = truck.truck_id drive...
SELECT COUNT(*) FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id ORDER BY T2.area / T2.population DESC LIMIT 1;
[INST] Here is a database schema: customer : cust_id [ INTEGER ] primary_key cust_name [ TEXT ] annual_revenue [ INTEGER ] cust_type [ TEXT ] address [ TEXT ] city [ TEXT ] state [ TEXT ] zip [ REAL ] phone [ TEXT ] Please write me a SQL statement that answers the following question: Determine the percentage of manufa...
SELECT CAST(SUM(CASE WHEN cust_type = 'manufacturer' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM customer WHERE state = 'TX';
[INST] Here is a database schema: city : city_id [ INTEGER ] primary_key city_name [ TEXT ] state [ TEXT ] population [ INTEGER ] area [ REAL ] shipment : ship_id [ INTEGER ] primary_key cust_id [ INTEGER ] shipment.cust_id = customer.cust_id weight [ REAL ] truck_id [ INTEGER ] shipment.truck_id = truck.truck_id drive...
SELECT SUM(T1.weight) FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id WHERE T2.city_name = 'San Mateo' AND STRFTIME('%Y', T1.ship_date) = '2016';
[INST] Here is a database schema: truck : truck_id [ INTEGER ] primary_key make [ TEXT ] model_year [ INTEGER ] shipment : ship_id [ INTEGER ] primary_key cust_id [ INTEGER ] shipment.cust_id = customer.cust_id weight [ REAL ] truck_id [ INTEGER ] shipment.truck_id = truck.truck_id driver_id [ INTEGER ] shipment.driver...
SELECT SUM(T2.weight) FROM truck AS T1 INNER JOIN shipment AS T2 ON T1.truck_id = T2.truck_id WHERE T1.make = 'Peterbilt' AND STRFTIME('%Y', T2.ship_date) = '2016' ORDER BY T1.model_year DESC LIMIT 1;
[INST] Here is a database schema: city : city_id [ INTEGER ] primary_key city_name [ TEXT ] state [ TEXT ] population [ INTEGER ] area [ REAL ] customer : cust_id [ INTEGER ] primary_key cust_name [ TEXT ] annual_revenue [ INTEGER ] cust_type [ TEXT ] address [ TEXT ] city [ TEXT ] state [ TEXT ] zip [ REAL ] phone [ T...
SELECT T1.weight, T2.cust_name FROM shipment AS T1 INNER JOIN customer AS T2 ON T1.cust_id = T2.cust_id INNER JOIN city AS T3 ON T3.city_id = T1.city_id WHERE T3.city_name = 'Boston' ORDER BY T1.weight DESC LIMIT 1;
[INST] Here is a database schema: city : city_id [ INTEGER ] primary_key city_name [ TEXT ] state [ TEXT ] population [ INTEGER ] area [ REAL ] shipment : ship_id [ INTEGER ] primary_key cust_id [ INTEGER ] shipment.cust_id = customer.cust_id weight [ REAL ] truck_id [ INTEGER ] shipment.truck_id = truck.truck_id drive...
SELECT T2.city_name FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id WHERE T1.ship_id = '1002';
[INST] Here is a database schema: truck : truck_id [ INTEGER ] primary_key make [ TEXT ] model_year [ INTEGER ] shipment : ship_id [ INTEGER ] primary_key cust_id [ INTEGER ] shipment.cust_id = customer.cust_id weight [ REAL ] truck_id [ INTEGER ] shipment.truck_id = truck.truck_id driver_id [ INTEGER ] shipment.driver...
SELECT AVG(T2.weight) FROM truck AS T1 INNER JOIN shipment AS T2 ON T1.truck_id = T2.truck_id WHERE T1.make = 'Mack';
[INST] Here is a database schema: city : city_id [ INTEGER ] primary_key city_name [ TEXT ] state [ TEXT ] population [ INTEGER ] area [ REAL ] driver : driver_id [ INTEGER ] primary_key first_name [ TEXT ] last_name [ TEXT ] address [ TEXT ] city [ TEXT ] state [ TEXT ] zip_code [ INTEGER ] phone [ TEXT ] shipment : s...
SELECT T3.first_name, T3.last_name FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id INNER JOIN driver AS T3 ON T3.driver_id = T1.driver_id WHERE T2.city_name = 'New York' AND T1.ship_date LIKE '2016-02%';
[INST] Here is a database schema: city : city_id [ INTEGER ] primary_key city_name [ TEXT ] state [ TEXT ] population [ INTEGER ] area [ REAL ] customer : cust_id [ INTEGER ] primary_key cust_name [ TEXT ] annual_revenue [ INTEGER ] cust_type [ TEXT ] address [ TEXT ] city [ TEXT ] state [ TEXT ] zip [ REAL ] phone [ T...
SELECT T2.cust_name FROM shipment AS T1 INNER JOIN customer AS T2 ON T1.cust_id = T2.cust_id INNER JOIN city AS T3 ON T3.city_id = T1.city_id WHERE T3.city_name = 'Oak Park';
[INST] Here is a database schema: city : city_id [ INTEGER ] primary_key city_name [ TEXT ] state [ TEXT ] population [ INTEGER ] area [ REAL ] driver : driver_id [ INTEGER ] primary_key first_name [ TEXT ] last_name [ TEXT ] address [ TEXT ] city [ TEXT ] state [ TEXT ] zip_code [ INTEGER ] phone [ TEXT ] shipment : s...
SELECT COUNT(*) FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id INNER JOIN driver AS T3 ON T3.driver_id = T1.driver_id WHERE T3.first_name = 'Andrea' AND T3.last_name = 'Simons' AND T2.city_name = 'Huntsville' AND STRFTIME('%Y', T1.ship_date) = '2016';
[INST] Here is a database schema: driver : driver_id [ INTEGER ] primary_key first_name [ TEXT ] last_name [ TEXT ] address [ TEXT ] city [ TEXT ] state [ TEXT ] zip_code [ INTEGER ] phone [ TEXT ] shipment : ship_id [ INTEGER ] primary_key cust_id [ INTEGER ] shipment.cust_id = customer.cust_id weight [ REAL ] truck_i...
SELECT CAST(COUNT(*) AS REAL) / (12 * COUNT(T2.driver_id)) FROM shipment AS T1 INNER JOIN driver AS T2 ON T1.driver_id = T2.driver_id;
[INST] Here is a database schema: customer : cust_id [ INTEGER ] primary_key cust_name [ TEXT ] annual_revenue [ INTEGER ] cust_type [ TEXT ] address [ TEXT ] city [ TEXT ] state [ TEXT ] zip [ REAL ] phone [ TEXT ] shipment : ship_id [ INTEGER ] primary_key cust_id [ INTEGER ] shipment.cust_id = customer.cust_id weigh...
SELECT CAST(SUM(CASE WHEN T1.weight >= 10000 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM shipment AS T1 INNER JOIN customer AS T2 ON T1.cust_id = T2.cust_id WHERE T2.cust_name = 'Sunguard Window Tinting & Truck Accessories' AND STRFTIME('%Y', T1.ship_date) = '2017';
[INST] Here is a database schema: customer : cust_id [ INTEGER ] primary_key cust_name [ TEXT ] annual_revenue [ INTEGER ] cust_type [ TEXT ] address [ TEXT ] city [ TEXT ] state [ TEXT ] zip [ REAL ] phone [ TEXT ] driver : driver_id [ INTEGER ] primary_key first_name [ TEXT ] last_name [ TEXT ] address [ TEXT ] city ...
SELECT CAST(SUM(CASE WHEN T3.cust_name = 'Autoware Inc' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) AS per FROM shipment AS T1 INNER JOIN driver AS T2 ON T1.driver_id = T2.driver_id INNER JOIN customer AS T3 ON T3.cust_id = T1.cust_id WHERE T2.first_name = 'Sue' AND T2.last_name = 'Newell';
[INST] Here is a database schema: city : city_id [ INTEGER ] primary_key city_name [ TEXT ] state [ TEXT ] population [ INTEGER ] area [ REAL ] shipment : ship_id [ INTEGER ] primary_key cust_id [ INTEGER ] shipment.cust_id = customer.cust_id weight [ REAL ] truck_id [ INTEGER ] shipment.truck_id = truck.truck_id drive...
SELECT COUNT(*) FROM ( SELECT T2.city_id AS CITYID FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id WHERE T2.state = 'New Jersey' GROUP BY T2.city_id HAVING SUM(T1.weight) > 20000 );
[INST] Here is a database schema: city : city_id [ INTEGER ] primary_key city_name [ TEXT ] state [ TEXT ] population [ INTEGER ] area [ REAL ] shipment : ship_id [ INTEGER ] primary_key cust_id [ INTEGER ] shipment.cust_id = customer.cust_id weight [ REAL ] truck_id [ INTEGER ] shipment.truck_id = truck.truck_id drive...
SELECT COUNT(*) FROM city AS T1 INNER JOIN shipment AS T2 ON T1.city_id = T2.city_id WHERE T1.population > 50000 AND STRFTIME('%Y', T2.ship_date) = '2017';
[INST] Here is a database schema: truck : truck_id [ INTEGER ] primary_key make [ TEXT ] model_year [ INTEGER ] shipment : ship_id [ INTEGER ] primary_key cust_id [ INTEGER ] shipment.cust_id = customer.cust_id weight [ REAL ] truck_id [ INTEGER ] shipment.truck_id = truck.truck_id driver_id [ INTEGER ] shipment.driver...
SELECT T2.weight FROM truck AS T1 INNER JOIN shipment AS T2 ON T1.truck_id = T2.truck_id WHERE make = 'Peterbilt';
[INST] Here is a database schema: truck : truck_id [ INTEGER ] primary_key make [ TEXT ] model_year [ INTEGER ] shipment : ship_id [ INTEGER ] primary_key cust_id [ INTEGER ] shipment.cust_id = customer.cust_id weight [ REAL ] truck_id [ INTEGER ] shipment.truck_id = truck.truck_id driver_id [ INTEGER ] shipment.driver...
SELECT T1.model_year FROM truck AS T1 INNER JOIN shipment AS T2 ON T1.truck_id = T2.truck_id WHERE T2.ship_id = '1003';
[INST] Here is a database schema: truck : truck_id [ INTEGER ] primary_key make [ TEXT ] model_year [ INTEGER ] shipment : ship_id [ INTEGER ] primary_key cust_id [ INTEGER ] shipment.cust_id = customer.cust_id weight [ REAL ] truck_id [ INTEGER ] shipment.truck_id = truck.truck_id driver_id [ INTEGER ] shipment.driver...
SELECT T1.make FROM truck AS T1 INNER JOIN shipment AS T2 ON T1.truck_id = T2.truck_id WHERE T2.ship_id = '1011';
[INST] Here is a database schema: driver : driver_id [ INTEGER ] primary_key first_name [ TEXT ] last_name [ TEXT ] address [ TEXT ] city [ TEXT ] state [ TEXT ] zip_code [ INTEGER ] phone [ TEXT ] shipment : ship_id [ INTEGER ] primary_key cust_id [ INTEGER ] shipment.cust_id = customer.cust_id weight [ REAL ] truck_i...
SELECT T2.first_name, T2.last_name FROM shipment AS T1 INNER JOIN driver AS T2 ON T1.driver_id = T2.driver_id WHERE T1.ship_id = 1028;
[INST] Here is a database schema: driver : driver_id [ INTEGER ] primary_key first_name [ TEXT ] last_name [ TEXT ] address [ TEXT ] city [ TEXT ] state [ TEXT ] zip_code [ INTEGER ] phone [ TEXT ] shipment : ship_id [ INTEGER ] primary_key cust_id [ INTEGER ] shipment.cust_id = customer.cust_id weight [ REAL ] truck_i...
SELECT T2.state FROM shipment AS T1 INNER JOIN driver AS T2 ON T1.driver_id = T2.driver_id WHERE T1.ship_id = '1055';
[INST] Here is a database schema: driver : driver_id [ INTEGER ] primary_key first_name [ TEXT ] last_name [ TEXT ] address [ TEXT ] city [ TEXT ] state [ TEXT ] zip_code [ INTEGER ] phone [ TEXT ] shipment : ship_id [ INTEGER ] primary_key cust_id [ INTEGER ] shipment.cust_id = customer.cust_id weight [ REAL ] truck_i...
SELECT T2.address FROM shipment AS T1 INNER JOIN driver AS T2 ON T1.driver_id = T2.driver_id GROUP BY T2.driver_id HAVING SUM(T1.weight) > 50000;
[INST] Here is a database schema: driver : driver_id [ INTEGER ] primary_key first_name [ TEXT ] last_name [ TEXT ] address [ TEXT ] city [ TEXT ] state [ TEXT ] zip_code [ INTEGER ] phone [ TEXT ] shipment : ship_id [ INTEGER ] primary_key cust_id [ INTEGER ] shipment.cust_id = customer.cust_id weight [ REAL ] truck_i...
SELECT T2.first_name, T2.last_name FROM shipment AS T1 INNER JOIN driver AS T2 ON T1.driver_id = T2.driver_id WHERE T1.ship_date = '2016-03-02';
[INST] Here is a database schema: customer : cust_id [ INTEGER ] primary_key cust_name [ TEXT ] annual_revenue [ INTEGER ] cust_type [ TEXT ] address [ TEXT ] city [ TEXT ] state [ TEXT ] zip [ REAL ] phone [ TEXT ] shipment : ship_id [ INTEGER ] primary_key cust_id [ INTEGER ] shipment.cust_id = customer.cust_id weigh...
SELECT AVG(T1.annual_revenue) FROM customer AS T1 INNER JOIN shipment AS T2 ON T1.cust_id = T2.cust_id WHERE T2.weight < 65000;
[INST] Here is a database schema: customer : cust_id [ INTEGER ] primary_key cust_name [ TEXT ] annual_revenue [ INTEGER ] cust_type [ TEXT ] address [ TEXT ] city [ TEXT ] state [ TEXT ] zip [ REAL ] phone [ TEXT ] shipment : ship_id [ INTEGER ] primary_key cust_id [ INTEGER ] shipment.cust_id = customer.cust_id weigh...
SELECT CAST(SUM(CASE WHEN T2.weight < 70000 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM customer AS T1 INNER JOIN shipment AS T2 ON T1.cust_id = T2.cust_id WHERE T1.cust_type = 'wholesaler';
[INST] Here is a database schema: driver : driver_id [ INTEGER ] primary_key first_name [ TEXT ] last_name [ TEXT ] address [ TEXT ] city [ TEXT ] state [ TEXT ] zip_code [ INTEGER ] phone [ TEXT ] shipment : ship_id [ INTEGER ] primary_key cust_id [ INTEGER ] shipment.cust_id = customer.cust_id weight [ REAL ] truck_i...
SELECT T2.last_name FROM shipment AS T1 INNER JOIN driver AS T2 ON T1.driver_id = T2.driver_id WHERE T1.ship_id = '1088';
[INST] Here is a database schema: driver : driver_id [ INTEGER ] primary_key first_name [ TEXT ] last_name [ TEXT ] address [ TEXT ] city [ TEXT ] state [ TEXT ] zip_code [ INTEGER ] phone [ TEXT ] shipment : ship_id [ INTEGER ] primary_key cust_id [ INTEGER ] shipment.cust_id = customer.cust_id weight [ REAL ] truck_i...
SELECT T2.phone FROM shipment AS T1 INNER JOIN driver AS T2 ON T1.driver_id = T2.driver_id GROUP BY T2.driver_id HAVING SUM(T1.weight) > 20000;
[INST] Here is a database schema: truck : truck_id [ INTEGER ] primary_key make [ TEXT ] model_year [ INTEGER ] shipment : ship_id [ INTEGER ] primary_key cust_id [ INTEGER ] shipment.cust_id = customer.cust_id weight [ REAL ] truck_id [ INTEGER ] shipment.truck_id = truck.truck_id driver_id [ INTEGER ] shipment.driver...
SELECT T1.make, T1.model_year FROM truck AS T1 INNER JOIN shipment AS T2 ON T1.truck_id = T2.truck_id WHERE T2.ship_id = '1055';
[INST] Here is a database schema: truck : truck_id [ INTEGER ] primary_key make [ TEXT ] model_year [ INTEGER ] Please write me a SQL statement that answers the following question: How many trucks were manufactured in year 2009? [/INST] [/INST]
SELECT COUNT(truck_id) FROM truck WHERE model_year = 2009;
[INST] Here is a database schema: customer : cust_id [ INTEGER ] primary_key cust_name [ TEXT ] annual_revenue [ INTEGER ] cust_type [ TEXT ] address [ TEXT ] city [ TEXT ] state [ TEXT ] zip [ REAL ] phone [ TEXT ] Please write me a SQL statement that answers the following question: How many customers are manufacture...
SELECT COUNT(*) FROM customer WHERE cust_type = 'manufacturer';
[INST] Here is a database schema: customer : cust_id [ INTEGER ] primary_key cust_name [ TEXT ] annual_revenue [ INTEGER ] cust_type [ TEXT ] address [ TEXT ] city [ TEXT ] state [ TEXT ] zip [ REAL ] phone [ TEXT ] Please write me a SQL statement that answers the following question: How many customers who live in Cal...
SELECT COUNT(*) FROM customer WHERE cust_type = 'retailer' AND state = 'CA';
[INST] Here is a database schema: city : city_id [ INTEGER ] primary_key city_name [ TEXT ] state [ TEXT ] population [ INTEGER ] area [ REAL ] Please write me a SQL statement that answers the following question: How many cities are in Connecticut? [/INST] [/INST]
SELECT COUNT(*) FROM city WHERE state = 'Connecticut';
[INST] Here is a database schema: city : city_id [ INTEGER ] primary_key city_name [ TEXT ] state [ TEXT ] population [ INTEGER ] area [ REAL ] Please write me a SQL statement that answers the following question: What is the most populated city in California? [/INST] [/INST]
SELECT city_name FROM city WHERE state = 'California' AND population = ( SELECT MAX(population) FROM city WHERE state = 'California' );
[INST] Here is a database schema: customer : cust_id [ INTEGER ] primary_key cust_name [ TEXT ] annual_revenue [ INTEGER ] cust_type [ TEXT ] address [ TEXT ] city [ TEXT ] state [ TEXT ] zip [ REAL ] phone [ TEXT ] Please write me a SQL statement that answers the following question: What is the annual revenue of Klet...
SELECT annual_revenue FROM customer WHERE cust_name = 'Klett & Sons Repair';
[INST] Here is a database schema: driver : driver_id [ INTEGER ] primary_key first_name [ TEXT ] last_name [ TEXT ] address [ TEXT ] city [ TEXT ] state [ TEXT ] zip_code [ INTEGER ] phone [ TEXT ] shipment : ship_id [ INTEGER ] primary_key cust_id [ INTEGER ] shipment.cust_id = customer.cust_id weight [ REAL ] truck_i...
SELECT T2.first_name, T2.last_name FROM shipment AS T1 INNER JOIN driver AS T2 ON T1.driver_id = T2.driver_id ORDER BY T1.weight ASC LIMIT 1;
[INST] Here is a database schema: customer : cust_id [ INTEGER ] primary_key cust_name [ TEXT ] annual_revenue [ INTEGER ] cust_type [ TEXT ] address [ TEXT ] city [ TEXT ] state [ TEXT ] zip [ REAL ] phone [ TEXT ] shipment : ship_id [ INTEGER ] primary_key cust_id [ INTEGER ] shipment.cust_id = customer.cust_id weigh...
SELECT COUNT(*) AS per FROM customer AS T1 INNER JOIN shipment AS T2 ON T1.cust_id = T2.cust_id WHERE STRFTIME('%Y', T2.ship_date) = '2016' AND T1.state = 'CA';
[INST] Here is a database schema: driver : driver_id [ INTEGER ] primary_key first_name [ TEXT ] last_name [ TEXT ] address [ TEXT ] city [ TEXT ] state [ TEXT ] zip_code [ INTEGER ] phone [ TEXT ] truck : truck_id [ INTEGER ] primary_key make [ TEXT ] model_year [ INTEGER ] shipment : ship_id [ INTEGER ] primary_key c...
SELECT DISTINCT T1.make FROM truck AS T1 INNER JOIN shipment AS T2 ON T1.truck_id = T2.truck_id INNER JOIN driver AS T3 ON T3.driver_id = T2.driver_id WHERE T3.first_name = 'Zachery' AND T3.last_name = 'Hicks';
[INST] Here is a database schema: customer : cust_id [ INTEGER ] primary_key cust_name [ TEXT ] annual_revenue [ INTEGER ] cust_type [ TEXT ] address [ TEXT ] city [ TEXT ] state [ TEXT ] zip [ REAL ] phone [ TEXT ] shipment : ship_id [ INTEGER ] primary_key cust_id [ INTEGER ] shipment.cust_id = customer.cust_id weigh...
SELECT T1.cust_name FROM customer AS T1 INNER JOIN shipment AS T2 ON T1.cust_id = T2.cust_id WHERE T2.ship_date LIKE '2017-02%';
[INST] Here is a database schema: customer : cust_id [ INTEGER ] primary_key cust_name [ TEXT ] annual_revenue [ INTEGER ] cust_type [ TEXT ] address [ TEXT ] city [ TEXT ] state [ TEXT ] zip [ REAL ] phone [ TEXT ] driver : driver_id [ INTEGER ] primary_key first_name [ TEXT ] last_name [ TEXT ] address [ TEXT ] city ...
SELECT T3.make, T4.first_name, T4.last_name FROM customer AS T1 INNER JOIN shipment AS T2 ON T1.cust_id = T2.cust_id INNER JOIN truck AS T3 ON T3.truck_id = T2.truck_id INNER JOIN driver AS T4 ON T4.driver_id = T2.driver_id WHERE T1.cust_name = 'Klett & Sons Repair';
[INST] Here is a database schema: driver : driver_id [ INTEGER ] primary_key first_name [ TEXT ] last_name [ TEXT ] address [ TEXT ] city [ TEXT ] state [ TEXT ] zip_code [ INTEGER ] phone [ TEXT ] shipment : ship_id [ INTEGER ] primary_key cust_id [ INTEGER ] shipment.cust_id = customer.cust_id weight [ REAL ] truck_i...
SELECT T1.ship_id FROM shipment AS T1 INNER JOIN driver AS T2 ON T1.driver_id = T2.driver_id WHERE T2.first_name = 'Zachery' AND T2.last_name = 'Hicks' ORDER BY T1.weight DESC LIMIT 1;
[INST] Here is a database schema: city : city_id [ INTEGER ] primary_key city_name [ TEXT ] state [ TEXT ] population [ INTEGER ] area [ REAL ] driver : driver_id [ INTEGER ] primary_key first_name [ TEXT ] last_name [ TEXT ] address [ TEXT ] city [ TEXT ] state [ TEXT ] zip_code [ INTEGER ] phone [ TEXT ] shipment : s...
SELECT COUNT(*) FROM city AS T1 INNER JOIN shipment AS T2 ON T1.city_id = T2.city_id INNER JOIN driver AS T3 ON T3.driver_id = T2.driver_id WHERE T3.first_name = 'Zachery' AND T3.last_name = 'Hicks' AND T1.city_name = 'New York' AND STRFTIME('%Y', T2.ship_date) = '2016';
[INST] Here is a database schema: truck : truck_id [ INTEGER ] primary_key make [ TEXT ] model_year [ INTEGER ] shipment : ship_id [ INTEGER ] primary_key cust_id [ INTEGER ] shipment.cust_id = customer.cust_id weight [ REAL ] truck_id [ INTEGER ] shipment.truck_id = truck.truck_id driver_id [ INTEGER ] shipment.driver...
SELECT CASE WHEN T2.make = 'Peterbilt' THEN 'Texas (TX)' WHEN T2.make = 'Mack' THEN 'North Carolina (NC)' WHEN T2.make = 'Kenworth' THEN 'Washington (WA)' END AS "result" FROM shipment AS T1 INNER JOIN truck AS T2 ON T1.truck_id = T2.truck_id WHERE CAST(T1.ship_date AS DATE) = 2016 GROUP BY T2.make ORDER BY COUNT(T1.sh...
[INST] Here is a database schema: city : city_id [ INTEGER ] primary_key city_name [ TEXT ] state [ TEXT ] population [ INTEGER ] area [ REAL ] customer : cust_id [ INTEGER ] primary_key cust_name [ TEXT ] annual_revenue [ INTEGER ] cust_type [ TEXT ] address [ TEXT ] city [ TEXT ] state [ TEXT ] zip [ REAL ] phone [ T...
SELECT COUNT(T3.city_name) FROM customer AS T1 INNER JOIN shipment AS T2 ON T1.cust_id = T2.cust_id INNER JOIN city AS T3 ON T3.city_id = T2.city_id WHERE T3.state = 'California' ORDER BY T3.population ASC LIMIT 1;
[INST] Here is a database schema: city : city_id [ INTEGER ] primary_key city_name [ TEXT ] state [ TEXT ] population [ INTEGER ] area [ REAL ] shipment : ship_id [ INTEGER ] primary_key cust_id [ INTEGER ] shipment.cust_id = customer.cust_id weight [ REAL ] truck_id [ INTEGER ] shipment.truck_id = truck.truck_id drive...
SELECT T2.city_name FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id ORDER BY T1.weight DESC LIMIT 1;
[INST] Here is a database schema: city : city_id [ INTEGER ] primary_key city_name [ TEXT ] state [ TEXT ] population [ INTEGER ] area [ REAL ] driver : driver_id [ INTEGER ] primary_key first_name [ TEXT ] last_name [ TEXT ] address [ TEXT ] city [ TEXT ] state [ TEXT ] zip_code [ INTEGER ] phone [ TEXT ] shipment : s...
SELECT DISTINCT T3.city_name FROM shipment AS T1 INNER JOIN driver AS T2 ON T1.driver_id = T2.driver_id INNER JOIN city AS T3 ON T1.city_id = T3.city_id WHERE T2.first_name = 'Zachery' AND T2.last_name = 'Hicks';
[INST] Here is a database schema: driver : driver_id [ INTEGER ] primary_key first_name [ TEXT ] last_name [ TEXT ] address [ TEXT ] city [ TEXT ] state [ TEXT ] zip_code [ INTEGER ] phone [ TEXT ] shipment : ship_id [ INTEGER ] primary_key cust_id [ INTEGER ] shipment.cust_id = customer.cust_id weight [ REAL ] truck_i...
SELECT CAST(SUM(CASE WHEN T2.first_name = 'Zachery' AND T2.last_name = 'Hicks' THEN T1.ship_id ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM shipment AS T1 INNER JOIN driver AS T2 ON T1.driver_id = T2.driver_id WHERE STRFTIME('%Y', T1.ship_date) = '2017';
[INST] Here is a database schema: driver : driver_id [ INTEGER ] primary_key first_name [ TEXT ] last_name [ TEXT ] address [ TEXT ] city [ TEXT ] state [ TEXT ] zip_code [ INTEGER ] phone [ TEXT ] shipment : ship_id [ INTEGER ] primary_key cust_id [ INTEGER ] shipment.cust_id = customer.cust_id weight [ REAL ] truck_i...
SELECT CAST(SUM(CASE WHEN T2.first_name = 'Zachery' AND T2.last_name = 'Hicks' THEN T1.weight ELSE 0 END) AS REAL) * 100 / SUM(T1.weight) FROM shipment AS T1 INNER JOIN driver AS T2 ON T1.driver_id = T2.driver_id WHERE STRFTIME('%Y', T1.ship_date) = '2016';
[INST] Here is a database schema: driver : driver_id [ INTEGER ] primary_key first_name [ TEXT ] last_name [ TEXT ] address [ TEXT ] city [ TEXT ] state [ TEXT ] zip_code [ INTEGER ] phone [ TEXT ] shipment : ship_id [ INTEGER ] primary_key cust_id [ INTEGER ] shipment.cust_id = customer.cust_id weight [ REAL ] truck_i...
SELECT COUNT(*) FROM shipment AS T1 INNER JOIN driver AS T2 ON T1.driver_id = T2.driver_id WHERE T1.driver_id = 23;
[INST] Here is a database schema: city : city_id [ INTEGER ] primary_key city_name [ TEXT ] state [ TEXT ] population [ INTEGER ] area [ REAL ] shipment : ship_id [ INTEGER ] primary_key cust_id [ INTEGER ] shipment.cust_id = customer.cust_id weight [ REAL ] truck_id [ INTEGER ] shipment.truck_id = truck.truck_id drive...
SELECT T1.ship_id FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id ORDER BY T2.area DESC LIMIT 1;
[INST] Here is a database schema: city : city_id [ INTEGER ] primary_key city_name [ TEXT ] state [ TEXT ] population [ INTEGER ] area [ REAL ] driver : driver_id [ INTEGER ] primary_key first_name [ TEXT ] last_name [ TEXT ] address [ TEXT ] city [ TEXT ] state [ TEXT ] zip_code [ INTEGER ] phone [ TEXT ] shipment : s...
SELECT T3.first_name, T3.last_name FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id INNER JOIN driver AS T3 ON T3.driver_id = T1.driver_id ORDER BY T2.population ASC LIMIT 1;
[INST] Here is a database schema: city : city_id [ INTEGER ] primary_key city_name [ TEXT ] state [ TEXT ] population [ INTEGER ] area [ REAL ] shipment : ship_id [ INTEGER ] primary_key cust_id [ INTEGER ] shipment.cust_id = customer.cust_id weight [ REAL ] truck_id [ INTEGER ] shipment.truck_id = truck.truck_id drive...
SELECT COUNT(*) FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id WHERE T2.city_name = 'Cicero' AND T2.state = 'Illinois' AND T1.weight BETWEEN 9000 AND 15000;
[INST] Here is a database schema: truck : truck_id [ INTEGER ] primary_key make [ TEXT ] model_year [ INTEGER ] shipment : ship_id [ INTEGER ] primary_key cust_id [ INTEGER ] shipment.cust_id = customer.cust_id weight [ REAL ] truck_id [ INTEGER ] shipment.truck_id = truck.truck_id driver_id [ INTEGER ] shipment.driver...
SELECT T1.model_year FROM truck AS T1 INNER JOIN shipment AS T2 ON T1.truck_id = T2.truck_id WHERE T2.ship_id = '1233';
[INST] Here is a database schema: customer : cust_id [ INTEGER ] primary_key cust_name [ TEXT ] annual_revenue [ INTEGER ] cust_type [ TEXT ] address [ TEXT ] city [ TEXT ] state [ TEXT ] zip [ REAL ] phone [ TEXT ] driver : driver_id [ INTEGER ] primary_key first_name [ TEXT ] last_name [ TEXT ] address [ TEXT ] city ...
SELECT T3.address FROM shipment AS T1 INNER JOIN customer AS T2 ON T1.cust_id = T2.cust_id INNER JOIN driver AS T3 ON T3.driver_id = T1.driver_id WHERE T2.address = '7052 Carroll Road' AND T2.city = 'San Diego' AND T2.state = 'CA';
[INST] Here is a database schema: driver : driver_id [ INTEGER ] primary_key first_name [ TEXT ] last_name [ TEXT ] address [ TEXT ] city [ TEXT ] state [ TEXT ] zip_code [ INTEGER ] phone [ TEXT ] shipment : ship_id [ INTEGER ] primary_key cust_id [ INTEGER ] shipment.cust_id = customer.cust_id weight [ REAL ] truck_i...
SELECT COUNT(*) FROM shipment AS T1 INNER JOIN driver AS T2 ON T1.driver_id = T2.driver_id WHERE T2.first_name = 'Maria' AND T2.last_name = 'Craft' AND STRFTIME('%Y', T1.ship_date) = '2017';
[INST] Here is a database schema: truck : truck_id [ INTEGER ] primary_key make [ TEXT ] model_year [ INTEGER ] shipment : ship_id [ INTEGER ] primary_key cust_id [ INTEGER ] shipment.cust_id = customer.cust_id weight [ REAL ] truck_id [ INTEGER ] shipment.truck_id = truck.truck_id driver_id [ INTEGER ] shipment.driver...
SELECT T1.model_year FROM truck AS T1 INNER JOIN shipment AS T2 ON T1.truck_id = T2.truck_id WHERE T2.ship_id = '1245';
[INST] Here is a database schema: driver : driver_id [ INTEGER ] primary_key first_name [ TEXT ] last_name [ TEXT ] address [ TEXT ] city [ TEXT ] state [ TEXT ] zip_code [ INTEGER ] phone [ TEXT ] shipment : ship_id [ INTEGER ] primary_key cust_id [ INTEGER ] shipment.cust_id = customer.cust_id weight [ REAL ] truck_i...
SELECT T2.address FROM shipment AS T1 INNER JOIN driver AS T2 ON T1.driver_id = T2.driver_id WHERE T1.ship_id = '1127';
[INST] Here is a database schema: customer : cust_id [ INTEGER ] primary_key cust_name [ TEXT ] annual_revenue [ INTEGER ] cust_type [ TEXT ] address [ TEXT ] city [ TEXT ] state [ TEXT ] zip [ REAL ] phone [ TEXT ] shipment : ship_id [ INTEGER ] primary_key cust_id [ INTEGER ] shipment.cust_id = customer.cust_id weigh...
SELECT T2.annual_revenue FROM shipment AS T1 INNER JOIN customer AS T2 ON T1.cust_id = T2.cust_id WHERE T1.ship_id = '1047';
[INST] Here is a database schema: driver : driver_id [ INTEGER ] primary_key first_name [ TEXT ] last_name [ TEXT ] address [ TEXT ] city [ TEXT ] state [ TEXT ] zip_code [ INTEGER ] phone [ TEXT ] shipment : ship_id [ INTEGER ] primary_key cust_id [ INTEGER ] shipment.cust_id = customer.cust_id weight [ REAL ] truck_i...
SELECT T1.weight FROM shipment AS T1 INNER JOIN driver AS T2 ON T1.driver_id = T2.driver_id WHERE T2.first_name = 'Andrea' AND T2.last_name = 'Simons' AND T1.ship_date = '2016-03-07';
[INST] Here is a database schema: city : city_id [ INTEGER ] primary_key city_name [ TEXT ] state [ TEXT ] population [ INTEGER ] area [ REAL ] shipment : ship_id [ INTEGER ] primary_key cust_id [ INTEGER ] shipment.cust_id = customer.cust_id weight [ REAL ] truck_id [ INTEGER ] shipment.truck_id = truck.truck_id drive...
SELECT T2.city_name FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id WHERE T1.ship_date = '2017-01-16';
[INST] Here is a database schema: customer : cust_id [ INTEGER ] primary_key cust_name [ TEXT ] annual_revenue [ INTEGER ] cust_type [ TEXT ] address [ TEXT ] city [ TEXT ] state [ TEXT ] zip [ REAL ] phone [ TEXT ] shipment : ship_id [ INTEGER ] primary_key cust_id [ INTEGER ] shipment.cust_id = customer.cust_id weigh...
SELECT COUNT(*) FROM shipment AS T1 INNER JOIN customer AS T2 ON T1.cust_id = T2.cust_id WHERE T2.state = 'NY';
[INST] Here is a database schema: customer : cust_id [ INTEGER ] primary_key cust_name [ TEXT ] annual_revenue [ INTEGER ] cust_type [ TEXT ] address [ TEXT ] city [ TEXT ] state [ TEXT ] zip [ REAL ] phone [ TEXT ] shipment : ship_id [ INTEGER ] primary_key cust_id [ INTEGER ] shipment.cust_id = customer.cust_id weigh...
SELECT T2.cust_name FROM shipment AS T1 INNER JOIN customer AS T2 ON T1.cust_id = T2.cust_id WHERE T1.ship_id = '1147';
[INST] Here is a database schema: city : city_id [ INTEGER ] primary_key city_name [ TEXT ] state [ TEXT ] population [ INTEGER ] area [ REAL ] shipment : ship_id [ INTEGER ] primary_key cust_id [ INTEGER ] shipment.cust_id = customer.cust_id weight [ REAL ] truck_id [ INTEGER ] shipment.truck_id = truck.truck_id drive...
SELECT T1.ship_id FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id ORDER BY T2.population DESC LIMIT 1;
[INST] Here is a database schema: driver : driver_id [ INTEGER ] primary_key first_name [ TEXT ] last_name [ TEXT ] address [ TEXT ] city [ TEXT ] state [ TEXT ] zip_code [ INTEGER ] phone [ TEXT ] shipment : ship_id [ INTEGER ] primary_key cust_id [ INTEGER ] shipment.cust_id = customer.cust_id weight [ REAL ] truck_i...
SELECT T2.first_name, T2.last_name FROM shipment AS T1 INNER JOIN driver AS T2 ON T1.driver_id = T2.driver_id WHERE T1.ship_date = '2016-02-22';
[INST] Here is a database schema: customer : cust_id [ INTEGER ] primary_key cust_name [ TEXT ] annual_revenue [ INTEGER ] cust_type [ TEXT ] address [ TEXT ] city [ TEXT ] state [ TEXT ] zip [ REAL ] phone [ TEXT ] shipment : ship_id [ INTEGER ] primary_key cust_id [ INTEGER ] shipment.cust_id = customer.cust_id weigh...
SELECT T1.weight FROM shipment AS T1 INNER JOIN customer AS T2 ON T1.cust_id = T2.cust_id WHERE T2.annual_revenue = 39448581;
[INST] Here is a database schema: customer : cust_id [ INTEGER ] primary_key cust_name [ TEXT ] annual_revenue [ INTEGER ] cust_type [ TEXT ] address [ TEXT ] city [ TEXT ] state [ TEXT ] zip [ REAL ] phone [ TEXT ] shipment : ship_id [ INTEGER ] primary_key cust_id [ INTEGER ] shipment.cust_id = customer.cust_id weigh...
SELECT T2.address FROM shipment AS T1 INNER JOIN customer AS T2 ON T1.cust_id = T2.cust_id WHERE T1.ship_id = '1117';
[INST] Here is a database schema: customer : cust_id [ INTEGER ] primary_key cust_name [ TEXT ] annual_revenue [ INTEGER ] cust_type [ TEXT ] address [ TEXT ] city [ TEXT ] state [ TEXT ] zip [ REAL ] phone [ TEXT ] shipment : ship_id [ INTEGER ] primary_key cust_id [ INTEGER ] shipment.cust_id = customer.cust_id weigh...
SELECT CAST(SUM(CASE WHEN STRFTIME('%Y', T1.ship_date) = '2017' THEN 1 ELSE 0 END) AS REAL ) * 100 / COUNT(*) FROM shipment AS T1 INNER JOIN customer AS T2 ON T1.cust_id = T2.cust_id WHERE T2.state = 'TX';
[INST] Here is a database schema: truck : truck_id [ INTEGER ] primary_key make [ TEXT ] model_year [ INTEGER ] shipment : ship_id [ INTEGER ] primary_key cust_id [ INTEGER ] shipment.cust_id = customer.cust_id weight [ REAL ] truck_id [ INTEGER ] shipment.truck_id = truck.truck_id driver_id [ INTEGER ] shipment.driver...
SELECT SUM(CASE WHEN T1.model_year = '2005' THEN 1 ELSE 0 END) - SUM(CASE WHEN T1.model_year = '2006' THEN 1 ELSE 0 END) FROM truck AS T1 INNER JOIN shipment AS T2 ON T1.truck_id = T2.truck_id;
[INST] Here is a database schema: driver : driver_id [ INTEGER ] primary_key first_name [ TEXT ] last_name [ TEXT ] address [ TEXT ] city [ TEXT ] state [ TEXT ] zip_code [ INTEGER ] phone [ TEXT ] shipment : ship_id [ INTEGER ] primary_key cust_id [ INTEGER ] shipment.cust_id = customer.cust_id weight [ REAL ] truck_i...
SELECT T2.first_name, T2.last_name FROM shipment AS T1 INNER JOIN driver AS T2 ON T1.driver_id = T2.driver_id WHERE T1.weight * 100 > ( SELECT 95 * AVG(weight) FROM shipment );
[INST] Here is a database schema: pages : pid [ INTEGER ] primary_key lid [ INTEGER ] pages.lid = langs.lid page [ INTEGER ] revision [ INTEGER ] title [ TEXT ] words [ INTEGER ] Please write me a SQL statement that answers the following question: Name the longest Catalan language Wikipedia page title and state the nu...
SELECT title, words FROM pages WHERE title = ( SELECT MAX(LENGTH(title)) FROM pages );
[INST] Here is a database schema: pages : pid [ INTEGER ] primary_key lid [ INTEGER ] pages.lid = langs.lid page [ INTEGER ] revision [ INTEGER ] title [ TEXT ] words [ INTEGER ] Please write me a SQL statement that answers the following question: List all the Catalan language wikipedia page title with less than 10 nu...
SELECT title FROM pages WHERE words < 10;
[INST] Here is a database schema: pages : pid [ INTEGER ] primary_key lid [ INTEGER ] pages.lid = langs.lid page [ INTEGER ] revision [ INTEGER ] title [ TEXT ] words [ INTEGER ] Please write me a SQL statement that answers the following question: List the page number for Catalan language wikipedia pages containing th...
SELECT page FROM pages WHERE title LIKE 'Art%' OR title LIKE '%Art%' OR title LIKE '%Art';
[INST] Here is a database schema: pages : pid [ INTEGER ] primary_key lid [ INTEGER ] pages.lid = langs.lid page [ INTEGER ] revision [ INTEGER ] title [ TEXT ] words [ INTEGER ] Please write me a SQL statement that answers the following question: What is the title of Catalan language wikipedia page with revision page...
SELECT title FROM pages WHERE revision = 16203226;
[INST] Here is a database schema: pages : pid [ INTEGER ] primary_key lid [ INTEGER ] pages.lid = langs.lid page [ INTEGER ] revision [ INTEGER ] title [ TEXT ] words [ INTEGER ] Please write me a SQL statement that answers the following question: List the titles for all Catalan language wikipedia page from revision p...
SELECT title FROM pages WHERE revision BETWEEN 106600 AND 106700;
[INST] Here is a database schema: pages : pid [ INTEGER ] primary_key lid [ INTEGER ] pages.lid = langs.lid page [ INTEGER ] revision [ INTEGER ] title [ TEXT ] words [ INTEGER ] Please write me a SQL statement that answers the following question: How many Catalan language wikipedia pages have between 1000 to 2000 num...
SELECT COUNT(pid) FROM pages WHERE words BETWEEN 1000 AND 2000;
[INST] Here is a database schema: words : wid [ INTEGER ] primary_key word [ TEXT ] occurrences [ INTEGER ] pages_words : pid [ INTEGER ] pages_words.pid = pages.pid wid [ INTEGER ] pages_words.wid = words.wid occurrences [ INTEGER ] Please write me a SQL statement that answers the following question: List the page id...
SELECT T2.pid FROM words AS T1 INNER JOIN pages_words AS T2 ON T1.wid = T2.wid WHERE T1.word = 'decimal';
[INST] Here is a database schema: words : wid [ INTEGER ] primary_key word [ TEXT ] occurrences [ INTEGER ] pages_words : pid [ INTEGER ] pages_words.pid = pages.pid wid [ INTEGER ] pages_words.wid = words.wid occurrences [ INTEGER ] Please write me a SQL statement that answers the following question: Which word has t...
SELECT T1.word FROM words AS T1 INNER JOIN pages_words AS T2 ON T1.wid = T2.wid WHERE T2.occurrences = ( SELECT MAX(occurrences) FROM pages_words );
[INST] Here is a database schema: words : wid [ INTEGER ] primary_key word [ TEXT ] occurrences [ INTEGER ] biwords : lid [ INTEGER ] biwords.lid = langs.lid w1st [ INTEGER ] biwords.w1st = words.wid w2nd [ INTEGER ] biwords.w2nd = words.wid occurrences [ INTEGER ] Please write me a SQL statement that answers the foll...
SELECT T1.word FROM words AS T1 INNER JOIN biwords AS T2 ON T1.wid = T2.w1st WHERE T2.w2nd = ( SELECT wid FROM words WHERE word = 'antic' );
[INST] Here is a database schema: pages : pid [ INTEGER ] primary_key lid [ INTEGER ] pages.lid = langs.lid page [ INTEGER ] revision [ INTEGER ] title [ TEXT ] words [ INTEGER ] words : wid [ INTEGER ] primary_key word [ TEXT ] occurrences [ INTEGER ] pages_words : pid [ INTEGER ] pages_words.pid = pages.pid wid [ INT...
SELECT T1.title, T2.occurrences FROM pages AS T1 INNER JOIN pages_words AS T2 ON T1.pid = T2.pid INNER JOIN words AS T3 ON T2.wid = T3.wid WHERE T3.word = 'quipu';
[INST] Here is a database schema: words : wid [ INTEGER ] primary_key word [ TEXT ] occurrences [ INTEGER ] biwords : lid [ INTEGER ] biwords.lid = langs.lid w1st [ INTEGER ] biwords.w1st = words.wid w2nd [ INTEGER ] biwords.w2nd = words.wid occurrences [ INTEGER ] Please write me a SQL statement that answers the foll...
SELECT AVG(T2.occurrences) FROM words AS T1 INNER JOIN biwords AS T2 ON T1.wid = T2.w1st WHERE T2.w1st = ( SELECT wid FROM words WHERE word = 'sistema' );
[INST] Here is a database schema: langs : lid [ INTEGER ] primary_key lang [ TEXT ] locale [ TEXT ] pages [ INTEGER ] words [ INTEGER ] Please write me a SQL statement that answers the following question: What is the total pages of Wikipedia in Catalan language? [/INST] [/INST]
SELECT pages FROM langs WHERE lang = 'ca';
[INST] Here is a database schema: biwords : lid [ INTEGER ] biwords.lid = langs.lid w1st [ INTEGER ] biwords.w1st = words.wid w2nd [ INTEGER ] biwords.w2nd = words.wid occurrences [ INTEGER ] Please write me a SQL statement that answers the following question: In the Catalan language, which biwords pair appeared the m...
SELECT w1st, w2nd FROM biwords WHERE occurrences = ( SELECT MAX(occurrences) FROM biwords );
[INST] Here is a database schema: langs_words : lid [ INTEGER ] langs_words.lid = langs.lid wid [ INTEGER ] langs_words.wid = words.wid occurrences [ INTEGER ] Please write me a SQL statement that answers the following question: What is the word id of the catalan language that was repeated no more than 10 times in the...
SELECT wid FROM langs_words WHERE occurrences <= 10;
[INST] Here is a database schema: pages : pid [ INTEGER ] primary_key lid [ INTEGER ] pages.lid = langs.lid page [ INTEGER ] revision [ INTEGER ] title [ TEXT ] words [ INTEGER ] Please write me a SQL statement that answers the following question: What is the title of the Catalan language Wikipedia page that has the h...
SELECT title FROM pages WHERE words = ( SELECT MAX(words) FROM pages );
[INST] Here is a database schema: pages : pid [ INTEGER ] primary_key lid [ INTEGER ] pages.lid = langs.lid page [ INTEGER ] revision [ INTEGER ] title [ TEXT ] words [ INTEGER ] Please write me a SQL statement that answers the following question: What is the wikipedia page id of Arqueozoologia? [/INST] [/INST]
SELECT page FROM pages WHERE title = 'Arqueozoologia';