Chinastark/bird_dataset huggingface dataset:
Database: shipping
Question: Identify the total weight of shipments transported in 2016 by the newest Peterbilt.
Evidence: transported in 2016 refers to CAST(ship_date as DATE) = 2016; 'Peterbilt' is the make; newest refers to Max(model_year)
SQL: 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
Database: shipping
Question: What was the maximum weight of the shipment carried to Boston? Name the customer of that shipment.
Evidence: "Boston" is the city_name; maximum weight refers to Max(weight); customer refers to cust_name
SQL: 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
Database: shipping
Question: Where was shipment no. 1002 headed?
Evidence: shipment no. 1002 refers to ship_id = 1002; where shipment was headed refers to city_name
SQL: 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'
Database: shipping
Question: What is the average shipment weight carried by the oldest Mack?
Evidence: "Mack" is the make; oldest refers to Min(model_year); average shipment weight refers to AVG(weight)
SQL: SELECT AVG(T2.weight) FROM truck AS T1 INNER JOIN shipment AS T2 ON T1.truck_id = T2.truck_id WHERE T1.make = 'Mack'
Database: shipping
Question: Identify the full name of the driver who delivered a shipment to the city of New York in February 2016.
Evidence: "New York" is the city_name; in February 2016 refers to ship_date LIKE '2016-02%'; full name refers to first_name, last_name
SQL: 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%'
Database: shipping
Question: Name the customer who sent the shipment to Oak Park.
Evidence: "Oak Park" is the city_name; customer name refers to cust_name
SQL: 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'
Database: shipping
Question: Determine the number of shipments delivered by Andrea Simons to Huntsville in 2016.
Evidence: "Huntsville" is the city_name; in 2016 refers to Cast(ship_date AS DATE) = 2016; number of shipment refers to Count(ship_id)
SQL: 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'
Database: shipping
Question: How many shipments does each driver deliver per month on average?
Evidence: shipment data was for 24 months in 2016 and 2017 respectively; deliver per month on average refers to Divide(Count(ship_id), Multiply (24, Count(driver_id)))
SQL: 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
Database: shipping
Question: Among all shipments placed by Sunguard Window Tinting & Truck Accessories in 2017, identify the percentage of shipments whose weight exceeded 10,000 pounds.
Evidence: "Sunguard Window Tinting & Truck Accessories" is the cust_name; weight exceed 10,000 pounds refers to weight > = 10000; in 2017 refers to Cast(ship_date AS DATE) = 2017; percentage = Divide (Sum(weight > = 10000), Sum(weight)) * 100
SQL: 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'
Database: shipping
Question: Among all shipments delivered by Sue Newel, identify the percentage of shipments that were placed by Autoware Inc.
Evidence: "Autoware Inc" is the cust_name; percentage = Divide (Count(ship_id where cust_name = 'Autoware Inc'), Count(ship_id)) * 100
SQL: 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'
Database: shipping
Question: How many cities which belong to New Jersey have transported weight greater than 20000?
Evidence: "New Jersey" is the state; transported weight greater than 20000 refers to Sum(weight) > 20000
SQL: 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 )
Database: shipping
Question: How many cities whose polulation is larger than 50000 pounds have shipment in 2017?
Evidence: population is larger than 50000 refers to population > 50000
SQL: 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'
Database: shipping
Question: State the weight of shipments transported by Peterbilt.
Evidence: "Peterbilt" is the make
SQL: SELECT T2.weight FROM truck AS T1 INNER JOIN shipment AS T2 ON T1.truck_id = T2.truck_id WHERE make = 'Peterbilt'
Database: shipping
Question: What is the model year of the truck used in shipment id 1003?
Evidence: shipment id 1003 refers to ship_id = 1003
SQL: 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'
Database: shipping
Question: What is the brand of truck used in shipment id 1011?
Evidence: shipment id 1011 refers to ship_id = 1011; brand of truck refers to make
SQL: SELECT T1.make FROM truck AS T1 INNER JOIN shipment AS T2 ON T1.truck_id = T2.truck_id WHERE T2.ship_id = '1011'
Database: shipping
Question: What is the first name of the driver who transported shipment id 1028?
Evidence: shipment id 1028 refers to ship_id = 1028
SQL: 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
Database: shipping
Question: List out the state of driver who transported the shipment id 1055.
Evidence: shipment id 1055 refers to ship_id = 1055
SQL: SELECT T2.state FROM shipment AS T1 INNER JOIN driver AS T2 ON T1.driver_id = T2.driver_id WHERE T1.ship_id = '1055'
Database: shipping
Question: State the address of drivers who transported the shipment with weight greater than 50000 pounds.
Evidence: shipment with weight greater than 50000 pounds refers to Sum(weight) > 50000
SQL: 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
Database: shipping
Question: Give the full name of driver who transported the items on 3/2/2016.
Evidence: on 3/2/2016 refers to ship_date = '2016-02-03'; full name refers to first_name, last_name
SQL: 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'
Database: shipping
Question: What is the average annual revenue of customers who have shipment weight of less than 65000 pounds?
Evidence: weight of less than 65000 pounds refers to weight < 65000; average annual revenue refers to AVG(annual_revenue)
SQL: 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
Database: shipping
Question: What is the percentage of wholesaler customers who have shipment weight of not greater than 70000 pounds?
Evidence: "wholesaler" is the cust_type; weight of not greater than 70000 pounds refers to weight < 70000; percentage = Divide (Count(cust_id where weight < 70000), Count(cust_id)) * 100
SQL: 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'
Database: shipping
Question: What is the last name of driver who transported shipment id 1088?
Evidence: shipment id 1088 refers to ship_id = 1088
SQL: 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'
Database: shipping
Question: Give the phone of drivers who transported shipment weight of greater than 20000 pounds.
Evidence: shipment weight of greater than 20000 pounds refers to Sum(weight) > 20000
SQL: 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
Database: shipping
Question: What is the brand and model of truck used in shipment id 1055?
Evidence: shipment id 1055 refers to ship_id = 1055; brand refers to make; model refers to model_year
SQL: 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'
Database: shipping
Question: How many trucks were manufactured in year 2009?
Evidence: manufactured in year 2009 refers to model_year = 2009
SQL: SELECT COUNT(truck_id) FROM truck WHERE model_year = 2009
Database: shipping
Question: How many customers are manufacturer?
Evidence: "manufacturer" is the cust_type
SQL: SELECT COUNT(*) FROM customer WHERE cust_type = 'manufacturer'
Database: shipping
Question: How many customers who live in California that are retailers?
Evidence: "retailer" is the cust_type; live in California refers to state = 'CA'
SQL: SELECT COUNT(*) FROM customer WHERE cust_type = 'retailer' AND state = 'CA'
Database: shipping
Question: How many cities are in Connecticut?
Evidence: "Connecticut" is the state
SQL: SELECT COUNT(*) FROM city WHERE state = 'Connecticut'
Database: shipping
Question: What is the most populated city in California?
Evidence: in California refers to state = 'CA'; most populated city refers to Max(population)
SQL: SELECT city_name FROM city WHERE state = 'California' AND population = ( SELECT MAX(population) FROM city WHERE state = 'California' )
Database: shipping
Question: What is the annual revenue of Klett & Sons Repair?
Evidence: "Klett & Sons Repair" is the cust_name
SQL: SELECT annual_revenue FROM customer WHERE cust_name = 'Klett & Sons Repair'
Database: shipping
Question: Who is the driver that transported the lightest weight of shipment? Provide the full name of the driver.
Evidence: lightest weight refers to Min(weight); full name refers to first_name, last_name
SQL: 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
Database: shipping
Question: How many shipments were shipped to customers living in California in year 2016?
Evidence: living in California refers to state = 'CA'; in year 2016 refers to CAST(ship_date AS DATE) = 2016
SQL: 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'
Database: shipping
Question: What is the brand of the truck that is used to ship by Zachery Hicks?
Evidence: brand of truck refers to make
SQL: 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'
Database: shipping
Question: List all the name of the customers that received a shipment in February 2017.
Evidence: shipment in February 2017 refers to ship_date LIKE '2017-02-%'; name of customer refers to cust_name
SQL: 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%'
Database: shipping
Question: Provide the brand of the truck and the name of the driver that transported goods in Klett & Sons Repair.
Evidence: "Klett & Sons Repair" is the cust_name; brand of truck refers to make; name of driver refers to first_name, last_name
SQL: 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'
Database: shipping
Question: What is the shipment ID of the heaviest shipment that Zachery Hicks transported?
Evidence: shipment ID refers to ship_id; heaviest shipment refers to Max(weight)
SQL: 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
Database: shipping
Question: How many shipments did Zachery Hicks transport goods to New York in the year 2016?
Evidence: "New York" is the city_name; in 2016 refers to CAST(ship_date AS DATE) = 2016
SQL: 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'
Database: shipping
Question: Which headquarter's truck has the highest shipments in year 2016?
Evidence: in 2016 refers to CAST(ship_date AS DATE) = 2016; make = 'Peterbilt' means headquarter is 'Texas (TX)', make = 'Mack' means headquarter is 'North Carolina (NC)', make = 'Kenworth' means headquarter is 'Washington (WA)'; highest shipment refers to MAX(COUNT(ship_id))
SQL: 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.ship_id) DESC LIMIT 1
Database: shipping
Question: How many shipments were shipped to the least populated city in California?
Evidence: "California" is the state; least populated city refers to Min(population)
SQL: 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
Database: shipping
Question: In which city did the heaviest shipment transported?
Evidence: heaviest shipment refers to Max(weight); city refers to city_name
SQL: 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
Database: shipping
Question: List all the cities where Zachery Hicks transported goods.
Evidence: city refers to city_name
SQL: 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'
Database: shipping
Question: Calculate the average number of shipments that Zachery Hicks shipped in year 2017.
Evidence: in year 2017 refers to CAST(ship_date AS DATE) = 2017; percentage = Divide (Count(ship_id where first_name = 'Zachery' AND last_name = 'Hicks'), Count(ship_id)) * 100
SQL: 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'
Database: shipping
Question: Calculate the percentage of the weight of goods being transported by Zachery Hicks to California in year 2016.
Evidence: "California" is the state; in 2016 refers to CAST (ship_date AS DATE) = 2016; percentage = Divide (Sum(weight where first_name = 'Zachery' AND last_name = 'Hicks'), Sum(weight)) * 100
SQL: 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'
Database: shipping
Question: How many shipments were shipped by the driver named Zachary Hicks?
SQL: SELECT COUNT(*) FROM shipment AS T1 INNER JOIN driver AS T2 ON T1.driver_id = T2.driver_id WHERE T1.driver_id = 23
Database: shipping
Question: What is the ship ID of shipments shipped to the city with the largest area?
Evidence: city with largest area refers to Max(area)
SQL: 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
Database: shipping
Question: List the drivers who shipped the shipments to the least populated city.
Evidence: least populated city refers to Min(population); name refers to first_name, last_name
SQL: 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
Database: shipping
Question: Among the shipments shipped to Cicero, Illinois, how many shipments weighed between 9,000 to 15,000?
Evidence: "Cicero" is the city; 'Illinois' is the state
SQL: 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
Database: shipping
Question: What model year of truck delivered the ship ID 1233?
SQL: 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'
Database: shipping
Question: What is the address of the driver that delivers the shipment for the customer lives at 7052 Carroll Road, San Diego, California?
Evidence: "7052 Carroll Road" is the address of customer; 'San Diego' is the city; 'California' is the state
SQL: 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'
Database: shipping
Question: Among the shipments delivered by Maria Craft, how many shipments were delivered in 2017?
Evidence: delivered in 2017 refers to Cast(ship_date AS DATE) = 2017
SQL: 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'
Database: shipping
Question: What is the truck's model year used to ship the ship ID 1245?
SQL: 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'
Database: shipping
Question: Where does the driver of ship ID 1127 live?
Evidence: live refers to address
SQL: SELECT T2.address FROM shipment AS T1 INNER JOIN driver AS T2 ON T1.driver_id = T2.driver_id WHERE T1.ship_id = '1127'
Database: shipping
Question: Give the annual revenue of the customer of ship ID 1047.
SQL: 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'
Database: shipping
Question: What is the weight of the shipment delivered by Andrea Simons on March 7, 2016?
Evidence: on March 7, 2016 refers to ship_date = '2016-03-07'
SQL: 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'
Database: shipping
Question: Provide the destination city of the shipment shipped by January 16, 2017.
Evidence: January 16, 2017 refers to ship_date = '2017-01-16'; city refers to city_name
SQL: 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'
Database: shipping
Question: How many shipments were delivered to a customer from New York?
Evidence: "New York" refers to state = 'NY'
SQL: SELECT COUNT(*) FROM shipment AS T1 INNER JOIN customer AS T2 ON T1.cust_id = T2.cust_id WHERE T2.state = 'NY'
Database: shipping
Question: What is the name of the customer of ship ID 1147?
Evidence: name of customer refers to cust_name
SQL: 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'
Database: shipping
Question: List the ship ID of shipments shipped to the most populated city.
Evidence: most populated city refers to Max(population)
SQL: 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
Database: shipping
Question: List the driver's name of the shipment shipped on February 22, 2016.
Evidence: on February 22, 2016 refers to ship_date = '2016-02-22'; driver's name refers to first_name, last_name
SQL: 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'
Database: shipping
Question: List the weight of the customer's shipment with annual revenue of 39448581.
SQL: SELECT T1.weight FROM shipment AS T1 INNER JOIN customer AS T2 ON T1.cust_id = T2.cust_id WHERE T2.annual_revenue = 39448581
Database: shipping
Question: What is the customer's address for the shipment with ship ID 1117?
SQL: SELECT T2.address FROM shipment AS T1 INNER JOIN customer AS T2 ON T1.cust_id = T2.cust_id WHERE T1.ship_id = '1117'
Database: shipping
Question: Among the shipments to a customer from Texas, what percentage of the shipments shipped in 2017?
Evidence: "Texas" refers to state = 'TX'; shipped in 2017 refers to CAST(ship_date AS DATE) = 2017; percentage = Divide (Count (ship_id where CAST(ship_date AS DATE) = 2017), Count (ship_id)) * 100
SQL: 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'
Database: shipping
Question: Calculate the difference between the number of shipments shipped by the truck with the model year 2005 and model year 2006.
Evidence: "2005" and "2006" are both model_year of truck; difference = Subtract (Count (ship_id where model_year = 2005), Count(ship_id where model_year = 2006))
SQL: 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
Database: shipping
Question: List the driver's name of the shipment with a weight greater than 95% of the average weight of all shipments.
Evidence: weight greater than 95% of average weight refers to weight > Multiply (AVG(weight), 0.95); driver name refers to first_name, last_name
SQL: 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 )
Database: language_corpus
Question: Name the longest Catalan language Wikipedia page title and state the number of different words in this page.
Evidence: longest title refers to max(length(title))
SQL: SELECT title, words FROM pages WHERE title = ( SELECT MAX(LENGTH(title)) FROM pages )
Database: language_corpus
Question: List all the Catalan language wikipedia page title with less than 10 number of different words in these pages.
Evidence: less than 10 number of different words refers to words < 10
SQL: SELECT title FROM pages WHERE words < 10
Database: language_corpus
Question: List the page number for Catalan language wikipedia pages containing the word 'Art' in the page title.
Evidence: containing the word 'Art' refers to title LIKE '% Art %'
SQL: SELECT page FROM pages WHERE title LIKE 'Art%' OR title LIKE '%Art%' OR title LIKE '%Art'
Database: language_corpus
Question: What is the title of Catalan language wikipedia page with revision page id '16203226'?
Evidence: revision page id '16203226' refers to revision = 16203226
SQL: SELECT title FROM pages WHERE revision = 16203226
Database: language_corpus
Question: List the titles for all Catalan language wikipedia page from revision page id 106600 to 106700.
Evidence: from revision page id 106600 to 106700 refers to revision BETWEEN 106600 AND 106700
SQL: SELECT title FROM pages WHERE revision BETWEEN 106600 AND 106700