1sf/bird-sql-train-with-schema huggingface dataset:
Database: shipping
Tables: city, customer, driver, truck, shipment
Columns (table index, column name): -1, *, 0, city_id, 0, city_name, 0, state, 0, population, 0, area, 1, cust_id, 1, cust_name, 1, annual_revenue, 1, cust_type, 1, address, 1, city, 1, state, 1, zip, 1, phone, 2, driver_id, 2, first_name, 2, last_name, 2, address, 2, city, 2, state, 2, zip_code, 2, phone, 3, truck_id, 3, make, 3, model_year, 4, ship_id, 4, cust_id, 4, weight, 4, truck_id, 4, driver_id, 4, city_id, 4, ship_date
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
Tables: city, customer, driver, truck, shipment
Columns (table index, column name): -1, *, 0, city_id, 0, city_name, 0, state, 0, population, 0, area, 1, cust_id, 1, cust_name, 1, annual_revenue, 1, cust_type, 1, address, 1, city, 1, state, 1, zip, 1, phone, 2, driver_id, 2, first_name, 2, last_name, 2, address, 2, city, 2, state, 2, zip_code, 2, phone, 3, truck_id, 3, make, 3, model_year, 4, ship_id, 4, cust_id, 4, weight, 4, truck_id, 4, driver_id, 4, city_id, 4, ship_date
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
Tables: city, customer, driver, truck, shipment
Columns (table index, column name): -1, *, 0, city_id, 0, city_name, 0, state, 0, population, 0, area, 1, cust_id, 1, cust_name, 1, annual_revenue, 1, cust_type, 1, address, 1, city, 1, state, 1, zip, 1, phone, 2, driver_id, 2, first_name, 2, last_name, 2, address, 2, city, 2, state, 2, zip_code, 2, phone, 3, truck_id, 3, make, 3, model_year, 4, ship_id, 4, cust_id, 4, weight, 4, truck_id, 4, driver_id, 4, city_id, 4, ship_date
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
Tables: city, customer, driver, truck, shipment
Columns (table index, column name): -1, *, 0, city_id, 0, city_name, 0, state, 0, population, 0, area, 1, cust_id, 1, cust_name, 1, annual_revenue, 1, cust_type, 1, address, 1, city, 1, state, 1, zip, 1, phone, 2, driver_id, 2, first_name, 2, last_name, 2, address, 2, city, 2, state, 2, zip_code, 2, phone, 3, truck_id, 3, make, 3, model_year, 4, ship_id, 4, cust_id, 4, weight, 4, truck_id, 4, driver_id, 4, city_id, 4, ship_date
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
Tables: city, customer, driver, truck, shipment
Columns (table index, column name): -1, *, 0, city_id, 0, city_name, 0, state, 0, population, 0, area, 1, cust_id, 1, cust_name, 1, annual_revenue, 1, cust_type, 1, address, 1, city, 1, state, 1, zip, 1, phone, 2, driver_id, 2, first_name, 2, last_name, 2, address, 2, city, 2, state, 2, zip_code, 2, phone, 3, truck_id, 3, make, 3, model_year, 4, ship_id, 4, cust_id, 4, weight, 4, truck_id, 4, driver_id, 4, city_id, 4, ship_date
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
Tables: city, customer, driver, truck, shipment
Columns (table index, column name): -1, *, 0, city_id, 0, city_name, 0, state, 0, population, 0, area, 1, cust_id, 1, cust_name, 1, annual_revenue, 1, cust_type, 1, address, 1, city, 1, state, 1, zip, 1, phone, 2, driver_id, 2, first_name, 2, last_name, 2, address, 2, city, 2, state, 2, zip_code, 2, phone, 3, truck_id, 3, make, 3, model_year, 4, ship_id, 4, cust_id, 4, weight, 4, truck_id, 4, driver_id, 4, city_id, 4, ship_date
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
Tables: city, customer, driver, truck, shipment
Columns (table index, column name): -1, *, 0, city_id, 0, city_name, 0, state, 0, population, 0, area, 1, cust_id, 1, cust_name, 1, annual_revenue, 1, cust_type, 1, address, 1, city, 1, state, 1, zip, 1, phone, 2, driver_id, 2, first_name, 2, last_name, 2, address, 2, city, 2, state, 2, zip_code, 2, phone, 3, truck_id, 3, make, 3, model_year, 4, ship_id, 4, cust_id, 4, weight, 4, truck_id, 4, driver_id, 4, city_id, 4, ship_date
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
Tables: city, customer, driver, truck, shipment
Columns (table index, column name): -1, *, 0, city_id, 0, city_name, 0, state, 0, population, 0, area, 1, cust_id, 1, cust_name, 1, annual_revenue, 1, cust_type, 1, address, 1, city, 1, state, 1, zip, 1, phone, 2, driver_id, 2, first_name, 2, last_name, 2, address, 2, city, 2, state, 2, zip_code, 2, phone, 3, truck_id, 3, make, 3, model_year, 4, ship_id, 4, cust_id, 4, weight, 4, truck_id, 4, driver_id, 4, city_id, 4, ship_date
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
Tables: city, customer, driver, truck, shipment
Columns (table index, column name): -1, *, 0, city_id, 0, city_name, 0, state, 0, population, 0, area, 1, cust_id, 1, cust_name, 1, annual_revenue, 1, cust_type, 1, address, 1, city, 1, state, 1, zip, 1, phone, 2, driver_id, 2, first_name, 2, last_name, 2, address, 2, city, 2, state, 2, zip_code, 2, phone, 3, truck_id, 3, make, 3, model_year, 4, ship_id, 4, cust_id, 4, weight, 4, truck_id, 4, driver_id, 4, city_id, 4, ship_date
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
Tables: city, customer, driver, truck, shipment
Columns (table index, column name): -1, *, 0, city_id, 0, city_name, 0, state, 0, population, 0, area, 1, cust_id, 1, cust_name, 1, annual_revenue, 1, cust_type, 1, address, 1, city, 1, state, 1, zip, 1, phone, 2, driver_id, 2, first_name, 2, last_name, 2, address, 2, city, 2, state, 2, zip_code, 2, phone, 3, truck_id, 3, make, 3, model_year, 4, ship_id, 4, cust_id, 4, weight, 4, truck_id, 4, driver_id, 4, city_id, 4, ship_date
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
Tables: city, customer, driver, truck, shipment
Columns (table index, column name): -1, *, 0, city_id, 0, city_name, 0, state, 0, population, 0, area, 1, cust_id, 1, cust_name, 1, annual_revenue, 1, cust_type, 1, address, 1, city, 1, state, 1, zip, 1, phone, 2, driver_id, 2, first_name, 2, last_name, 2, address, 2, city, 2, state, 2, zip_code, 2, phone, 3, truck_id, 3, make, 3, model_year, 4, ship_id, 4, cust_id, 4, weight, 4, truck_id, 4, driver_id, 4, city_id, 4, ship_date
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
Tables: city, customer, driver, truck, shipment
Columns (table index, column name): -1, *, 0, city_id, 0, city_name, 0, state, 0, population, 0, area, 1, cust_id, 1, cust_name, 1, annual_revenue, 1, cust_type, 1, address, 1, city, 1, state, 1, zip, 1, phone, 2, driver_id, 2, first_name, 2, last_name, 2, address, 2, city, 2, state, 2, zip_code, 2, phone, 3, truck_id, 3, make, 3, model_year, 4, ship_id, 4, cust_id, 4, weight, 4, truck_id, 4, driver_id, 4, city_id, 4, ship_date
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
Tables: city, customer, driver, truck, shipment
Columns (table index, column name): -1, *, 0, city_id, 0, city_name, 0, state, 0, population, 0, area, 1, cust_id, 1, cust_name, 1, annual_revenue, 1, cust_type, 1, address, 1, city, 1, state, 1, zip, 1, phone, 2, driver_id, 2, first_name, 2, last_name, 2, address, 2, city, 2, state, 2, zip_code, 2, phone, 3, truck_id, 3, make, 3, model_year, 4, ship_id, 4, cust_id, 4, weight, 4, truck_id, 4, driver_id, 4, city_id, 4, ship_date
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
Tables: city, customer, driver, truck, shipment
Columns (table index, column name): -1, *, 0, city_id, 0, city_name, 0, state, 0, population, 0, area, 1, cust_id, 1, cust_name, 1, annual_revenue, 1, cust_type, 1, address, 1, city, 1, state, 1, zip, 1, phone, 2, driver_id, 2, first_name, 2, last_name, 2, address, 2, city, 2, state, 2, zip_code, 2, phone, 3, truck_id, 3, make, 3, model_year, 4, ship_id, 4, cust_id, 4, weight, 4, truck_id, 4, driver_id, 4, city_id, 4, ship_date
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
Tables: city, customer, driver, truck, shipment
Columns (table index, column name): -1, *, 0, city_id, 0, city_name, 0, state, 0, population, 0, area, 1, cust_id, 1, cust_name, 1, annual_revenue, 1, cust_type, 1, address, 1, city, 1, state, 1, zip, 1, phone, 2, driver_id, 2, first_name, 2, last_name, 2, address, 2, city, 2, state, 2, zip_code, 2, phone, 3, truck_id, 3, make, 3, model_year, 4, ship_id, 4, cust_id, 4, weight, 4, truck_id, 4, driver_id, 4, city_id, 4, ship_date
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
Tables: city, customer, driver, truck, shipment
Columns (table index, column name): -1, *, 0, city_id, 0, city_name, 0, state, 0, population, 0, area, 1, cust_id, 1, cust_name, 1, annual_revenue, 1, cust_type, 1, address, 1, city, 1, state, 1, zip, 1, phone, 2, driver_id, 2, first_name, 2, last_name, 2, address, 2, city, 2, state, 2, zip_code, 2, phone, 3, truck_id, 3, make, 3, model_year, 4, ship_id, 4, cust_id, 4, weight, 4, truck_id, 4, driver_id, 4, city_id, 4, ship_date
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
Tables: city, customer, driver, truck, shipment
Columns (table index, column name): -1, *, 0, city_id, 0, city_name, 0, state, 0, population, 0, area, 1, cust_id, 1, cust_name, 1, annual_revenue, 1, cust_type, 1, address, 1, city, 1, state, 1, zip, 1, phone, 2, driver_id, 2, first_name, 2, last_name, 2, address, 2, city, 2, state, 2, zip_code, 2, phone, 3, truck_id, 3, make, 3, model_year, 4, ship_id, 4, cust_id, 4, weight, 4, truck_id, 4, driver_id, 4, city_id, 4, ship_date
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
Tables: city, customer, driver, truck, shipment
Columns (table index, column name): -1, *, 0, city_id, 0, city_name, 0, state, 0, population, 0, area, 1, cust_id, 1, cust_name, 1, annual_revenue, 1, cust_type, 1, address, 1, city, 1, state, 1, zip, 1, phone, 2, driver_id, 2, first_name, 2, last_name, 2, address, 2, city, 2, state, 2, zip_code, 2, phone, 3, truck_id, 3, make, 3, model_year, 4, ship_id, 4, cust_id, 4, weight, 4, truck_id, 4, driver_id, 4, city_id, 4, ship_date
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
Tables: city, customer, driver, truck, shipment
Columns (table index, column name): -1, *, 0, city_id, 0, city_name, 0, state, 0, population, 0, area, 1, cust_id, 1, cust_name, 1, annual_revenue, 1, cust_type, 1, address, 1, city, 1, state, 1, zip, 1, phone, 2, driver_id, 2, first_name, 2, last_name, 2, address, 2, city, 2, state, 2, zip_code, 2, phone, 3, truck_id, 3, make, 3, model_year, 4, ship_id, 4, cust_id, 4, weight, 4, truck_id, 4, driver_id, 4, city_id, 4, ship_date
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
Tables: city, customer, driver, truck, shipment
Columns (table index, column name): -1, *, 0, city_id, 0, city_name, 0, state, 0, population, 0, area, 1, cust_id, 1, cust_name, 1, annual_revenue, 1, cust_type, 1, address, 1, city, 1, state, 1, zip, 1, phone, 2, driver_id, 2, first_name, 2, last_name, 2, address, 2, city, 2, state, 2, zip_code, 2, phone, 3, truck_id, 3, make, 3, model_year, 4, ship_id, 4, cust_id, 4, weight, 4, truck_id, 4, driver_id, 4, city_id, 4, ship_date
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
Tables: city, customer, driver, truck, shipment
Columns (table index, column name): -1, *, 0, city_id, 0, city_name, 0, state, 0, population, 0, area, 1, cust_id, 1, cust_name, 1, annual_revenue, 1, cust_type, 1, address, 1, city, 1, state, 1, zip, 1, phone, 2, driver_id, 2, first_name, 2, last_name, 2, address, 2, city, 2, state, 2, zip_code, 2, phone, 3, truck_id, 3, make, 3, model_year, 4, ship_id, 4, cust_id, 4, weight, 4, truck_id, 4, driver_id, 4, city_id, 4, ship_date
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
Tables: city, customer, driver, truck, shipment
Columns (table index, column name): -1, *, 0, city_id, 0, city_name, 0, state, 0, population, 0, area, 1, cust_id, 1, cust_name, 1, annual_revenue, 1, cust_type, 1, address, 1, city, 1, state, 1, zip, 1, phone, 2, driver_id, 2, first_name, 2, last_name, 2, address, 2, city, 2, state, 2, zip_code, 2, phone, 3, truck_id, 3, make, 3, model_year, 4, ship_id, 4, cust_id, 4, weight, 4, truck_id, 4, driver_id, 4, city_id, 4, ship_date
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
Tables: city, customer, driver, truck, shipment
Columns (table index, column name): -1, *, 0, city_id, 0, city_name, 0, state, 0, population, 0, area, 1, cust_id, 1, cust_name, 1, annual_revenue, 1, cust_type, 1, address, 1, city, 1, state, 1, zip, 1, phone, 2, driver_id, 2, first_name, 2, last_name, 2, address, 2, city, 2, state, 2, zip_code, 2, phone, 3, truck_id, 3, make, 3, model_year, 4, ship_id, 4, cust_id, 4, weight, 4, truck_id, 4, driver_id, 4, city_id, 4, ship_date
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
Tables: city, customer, driver, truck, shipment
Columns (table index, column name): -1, *, 0, city_id, 0, city_name, 0, state, 0, population, 0, area, 1, cust_id, 1, cust_name, 1, annual_revenue, 1, cust_type, 1, address, 1, city, 1, state, 1, zip, 1, phone, 2, driver_id, 2, first_name, 2, last_name, 2, address, 2, city, 2, state, 2, zip_code, 2, phone, 3, truck_id, 3, make, 3, model_year, 4, ship_id, 4, cust_id, 4, weight, 4, truck_id, 4, driver_id, 4, city_id, 4, ship_date
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
Tables: city, customer, driver, truck, shipment
Columns (table index, column name): -1, *, 0, city_id, 0, city_name, 0, state, 0, population, 0, area, 1, cust_id, 1, cust_name, 1, annual_revenue, 1, cust_type, 1, address, 1, city, 1, state, 1, zip, 1, phone, 2, driver_id, 2, first_name, 2, last_name, 2, address, 2, city, 2, state, 2, zip_code, 2, phone, 3, truck_id, 3, make, 3, model_year, 4, ship_id, 4, cust_id, 4, weight, 4, truck_id, 4, driver_id, 4, city_id, 4, ship_date
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
Tables: city, customer, driver, truck, shipment
Columns (table index, column name): -1, *, 0, city_id, 0, city_name, 0, state, 0, population, 0, area, 1, cust_id, 1, cust_name, 1, annual_revenue, 1, cust_type, 1, address, 1, city, 1, state, 1, zip, 1, phone, 2, driver_id, 2, first_name, 2, last_name, 2, address, 2, city, 2, state, 2, zip_code, 2, phone, 3, truck_id, 3, make, 3, model_year, 4, ship_id, 4, cust_id, 4, weight, 4, truck_id, 4, driver_id, 4, city_id, 4, ship_date
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
Tables: city, customer, driver, truck, shipment
Columns (table index, column name): -1, *, 0, city_id, 0, city_name, 0, state, 0, population, 0, area, 1, cust_id, 1, cust_name, 1, annual_revenue, 1, cust_type, 1, address, 1, city, 1, state, 1, zip, 1, phone, 2, driver_id, 2, first_name, 2, last_name, 2, address, 2, city, 2, state, 2, zip_code, 2, phone, 3, truck_id, 3, make, 3, model_year, 4, ship_id, 4, cust_id, 4, weight, 4, truck_id, 4, driver_id, 4, city_id, 4, ship_date
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
Tables: city, customer, driver, truck, shipment
Columns (table index, column name): -1, *, 0, city_id, 0, city_name, 0, state, 0, population, 0, area, 1, cust_id, 1, cust_name, 1, annual_revenue, 1, cust_type, 1, address, 1, city, 1, state, 1, zip, 1, phone, 2, driver_id, 2, first_name, 2, last_name, 2, address, 2, city, 2, state, 2, zip_code, 2, phone, 3, truck_id, 3, make, 3, model_year, 4, ship_id, 4, cust_id, 4, weight, 4, truck_id, 4, driver_id, 4, city_id, 4, ship_date
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
Tables: city, customer, driver, truck, shipment
Columns (table index, column name): -1, *, 0, city_id, 0, city_name, 0, state, 0, population, 0, area, 1, cust_id, 1, cust_name, 1, annual_revenue, 1, cust_type, 1, address, 1, city, 1, state, 1, zip, 1, phone, 2, driver_id, 2, first_name, 2, last_name, 2, address, 2, city, 2, state, 2, zip_code, 2, phone, 3, truck_id, 3, make, 3, model_year, 4, ship_id, 4, cust_id, 4, weight, 4, truck_id, 4, driver_id, 4, city_id, 4, ship_date
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'