Chinastark/bird_dataset huggingface dataset:
Database: menu
Question: What are the names of the dishes in the menu sponsored by The Society of Cumberland that was created for the 19th reunion at Grand Pacific Hotel in Chicago, Illinois?
Evidence: sponsored by The Society of Cumberland refers to sponsor = 'THE SOCIETY OF THE CUMBERLAND'; created for the 19th reunion refers to event = '19NTH REUNION'; Grand Pacific Hotel in Chicago, Illinois refers to place = 'GRAND PACIFIC HOTEL, CHICAGO, ILL';
SQL: SELECT T4.name FROM Menu AS T1 INNER JOIN MenuPage AS T2 ON T1.id = T2.menu_id INNER JOIN MenuItem AS T3 ON T2.id = T3.menu_page_id INNER JOIN Dish AS T4 ON T3.dish_id = T4.id WHERE T1.sponsor = 'THE SOCIETY OF THE CUMBERLAND' AND T1.event = '19NTH REUNION' AND T1.place = 'GRAND PACIFIC HOTEL,CHICAGO,ILL'
Database: menu
Question: Among the menus that include baked apples with cream, who is the sponsor of the menu with the highest price?
Evidence: baked apples with cream is a name of dish; highest price refers to MAX(price);
SQL: SELECT T4.sponsor FROM MenuPage AS T1 INNER JOIN MenuItem AS T2 ON T1.id = T2.menu_page_id INNER JOIN Dish AS T3 ON T2.dish_id = T3.id INNER JOIN Menu AS T4 ON T4.id = T1.menu_id WHERE T3.name = 'Baked apples with cream' AND T3.id = 107 ORDER BY T2.price DESC LIMIT 1
Database: menu
Question: What is the average number of dishes per menu in the Souper de Luxe menus? Identify what is the name of the dish that appeared the most in all of its menus.
Evidence: average number of dishes per menu = DIVIDE(COUNT(dish_id), COUNT(menu_page_id)); Souper de Luxe is a name of menu; dish that appeared the most in all of its menus refers to MAX(COUNT(dish_id));
SQL: SELECT COUNT(*), T1.dish_id FROM MenuItem AS T1 INNER JOIN MenuPage AS T2 ON T1.menu_page_id = T2.id INNER JOIN Menu AS T3 ON T2.menu_id = T3.id INNER JOIN Dish AS T4 ON T1.dish_id = T4.id WHERE T3.name = 'Souper de Luxe' GROUP BY T3.id ORDER BY COUNT(T1.dish_id) DESC LIMIT 1
Database: menu
Question: Please list the IDs of all the menus that are DIYs of the restaurant.
Evidence: menus that are DIYs of the restaurant refers to sponsor is null;
SQL: SELECT id FROM Menu WHERE sponsor IS NULL
Database: menu
Question: How many menus were created for lunch?
Evidence: created for lunch refers to event = 'LUNCH';
SQL: SELECT COUNT(*) FROM Menu WHERE event = 'LUNCH'
Database: menu
Question: Among the menus with over 10 pages, how many of them have over 20 dishes?
Evidence: menus with over 10 pages refers to page_count > 10; over 20 dishes refers to dish_count > 20;
SQL: SELECT COUNT(*) FROM Menu WHERE page_count > 10 AND dish_count > 20
Database: menu
Question: What is the ID of the menu with the most number of dishes?
Evidence: most number of dishes refers to MAX(COUNT(dish_count));
SQL: SELECT id FROM Menu ORDER BY dish_count DESC LIMIT 1
Database: menu
Question: How many dishes are there on the menu "Zentral Theater Terrace"?
Evidence: Zentral Theater Terrace is a name of menu;
SQL: SELECT COUNT(*) FROM Menu WHERE name = 'Zentral Theater Terrace'
Database: menu
Question: Among the menus that did not support taking out or booking in advance, how many of them were created before 1950?
Evidence: did not support taking out or booking in advance refers to call_number is null; created before 1950 refers to strftime('%Y', date) < '1950';
SQL: SELECT COUNT(*) FROM Menu WHERE call_number IS NULL AND strftime('%Y', date) < '1950'
Database: menu
Question: What is the image ID of page 1 of the menu "Zentral Theater Terrace"?
Evidence: page 1 refers to page_number = 1; Zentral Theater Terrace is a name of menu;
SQL: SELECT T2.image_id FROM Menu AS T1 INNER JOIN MenuPage AS T2 ON T1.id = T2.menu_id WHERE T1.name = 'Zentral Theater Terrace' AND T2.page_number = 1
Database: menu
Question: To which menu does the menu page image ID5189412 belong? Please give its name.
Evidence: FALSE;
SQL: SELECT T1.name FROM Menu AS T1 INNER JOIN MenuPage AS T2 ON T1.id = T2.menu_id WHERE T2.image_id = 5189412
Database: menu
Question: Which menu page has a bigger width, page 1 of "Zentral Theater Terrace" or page 1 of "Young's Hotel"?
Evidence: if SUM(full_width where page_number = 1 AND menu.name = 'Zentral Theater Terrace') > SUM(full_width where page_number = 1 AND menu.name = 'Young''s Hotel'), it means Zentral Theater Terrace menu page is bigger than Young's Hotel; if SUM(full_width WHERE page_number = 1 AND menu.name = 'Young''s Hotel') < SUM(full_width WHERE page_number = 1 AND menu.name = 'Zentral Theater Terrace'), it means Young's Hotel menu page is bigger than Zentral Theater Terrace;
SQL: SELECT CASE WHEN SUM(CASE WHEN T1.name = 'Zentral Theater Terrace' THEN T2.full_width ELSE 0 END) - SUM(CASE WHEN T1.name = 'Young''s Hotel' THEN T2.full_width ELSE 0 END) > 0 THEN 'Zentral Theater Terrace' ELSE 'Young''s Hotel' END FROM Menu AS T1 INNER JOIN MenuPage AS T2 ON T1.id = T2.menu_id
Database: menu
Question: Which menu page of "Ritz Carlton" has the biggest height?
Evidence: Ritz Carlton is a name of menu; biggest height refers to MAX(full_height);
SQL: SELECT T1.page_number FROM MenuPage AS T1 INNER JOIN Menu AS T2 ON T2.id = T1.menu_id WHERE T2.name = 'Ritz Carlton' ORDER BY T1.full_height DESC LIMIT 1
Database: menu
Question: Among the menu pages of "Ritz Carlton", how many of them have a width of over 1000?
Evidence: Ritz Carlton is a name of menu; width of over 2490 refers to full_width > 1000;
SQL: SELECT SUM(CASE WHEN T1.name = 'Ritz Carlton' THEN 1 ELSE 0 END) FROM Menu AS T1 INNER JOIN MenuPage AS T2 ON T1.id = T2.menu_id WHERE T2.full_width > 1000
Database: menu
Question: How many dishes are there on page 1 of menu ID12882?
Evidence: page 1 refers to page_number = 1;
SQL: SELECT SUM(CASE WHEN T1.page_number = 1 THEN 1 ELSE 0 END) FROM MenuPage AS T1 INNER JOIN MenuItem AS T2 ON T1.id = T2.menu_page_id WHERE T1.menu_id = 12882
Database: menu
Question: Please list the names of all the dishes on page 1 of menu ID12882.
Evidence: page 1 refers to page_number = 1;
SQL: SELECT T3.name FROM MenuPage AS T1 INNER JOIN MenuItem AS T2 ON T1.id = T2.menu_page_id INNER JOIN Dish AS T3 ON T2.dish_id = T3.id WHERE T1.menu_id = 12882 AND T1.page_number = 1
Database: menu
Question: Please list the page numbers of all the menu pages on which the dish "Chicken gumbo" had appeared.
Evidence: Chicken gumbo is a name of dish;
SQL: SELECT T1.page_number FROM MenuPage AS T1 INNER JOIN MenuItem AS T2 ON T1.id = T2.menu_page_id INNER JOIN Dish AS T3 ON T2.dish_id = T3.id WHERE T3.name = 'Chicken gumbo'
Database: menu
Question: Among the menu pages on which the dish "Chicken gumbo" had appeared, what is the menu ID of the one with the biggest width?
Evidence: Chicken gumbo is a name of dish; biggest width refers to MAX(full_width);
SQL: SELECT T1.id FROM MenuPage AS T1 INNER JOIN MenuItem AS T2 ON T1.id = T2.menu_page_id INNER JOIN Dish AS T3 ON T2.dish_id = T3.id WHERE T3.name = 'Chicken gumbo' ORDER BY T1.full_width DESC LIMIT 1
Database: menu
Question: For how many times had the dish "Chicken gumbo" appeared on a menu page?
Evidence: Chicken gumbo is a name of dish;
SQL: SELECT SUM(CASE WHEN T1.name = 'Chicken gumbo' THEN 1 ELSE 0 END) FROM Dish AS T1 INNER JOIN MenuItem AS T2 ON T1.id = T2.dish_id
Database: menu
Question: Among the menu pages on which the dish "Paysanne Soup" had appeared, how many of them had a stable price for the dish?
Evidence: Paysanne Soup is a name of dish; stable price refers to highest_price is null;
SQL: SELECT SUM(CASE WHEN T1.name = 'Paysanne Soup' THEN 1 ELSE 0 END) FROM Dish AS T1 INNER JOIN MenuItem AS T2 ON T1.id = T2.dish_id WHERE T1.highest_price IS NULL
Database: menu
Question: What is the highest price of the dish "Chicken gumbo" on a menu page?
Evidence: highest price refers to MAX(price); Chicken gumbo is a name of dish;
SQL: SELECT T2.price FROM Dish AS T1 INNER JOIN MenuItem AS T2 ON T1.id = T2.dish_id WHERE T1.name = 'Chicken gumbo' ORDER BY T2.price DESC LIMIT 1
Database: menu
Question: How much space does page 1 of the menu "Zentral Theater Terrace" cover?
Evidence: how much space = MULTIPLY(full_height, full_width); Zentral Theater Terrace is a name of menu;
SQL: SELECT T2.full_height * T2.full_width FROM Menu AS T1 INNER JOIN MenuPage AS T2 ON T1.id = T2.menu_id WHERE T1.name = 'Zentral Theater Terrace' AND T2.page_number = 1
Database: menu
Question: What is the average number of dishes per menu page of menu ID12882?
Evidence: average number of dishes per menu = DIVIDE(COUNT(dish_id), COUNT(page_count));
SQL: SELECT CAST(COUNT(dish_id) AS REAL) / COUNT(T3.page_count) FROM MenuItem AS T1 INNER JOIN MenuPage AS T2 ON T1.menu_page_id = T2.id INNER JOIN Menu AS T3 ON T2.menu_id = T3.id WHERE T2.menu_id = 12882
Database: shipping
Question: How many shipments were ordered by S K L Enterprises Inc in 2017?
Evidence: "S K L Enterprises Inc" is the cust_name; in 2017 refers to Cast(ship_date AS DATE) = 2017
SQL: 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 = 'S K L Enterprises Inc' AND STRFTIME('%Y', T2.ship_date) = '2017'
Database: shipping
Question: What is the total number of pounds being transported for S K L Enterprises Inc?
Evidence: "S K L Enterprises Inc" is the cust_name; total number of pounds refers to Sum(weight)
SQL: SELECT SUM(T2.weight) FROM customer AS T1 INNER JOIN shipment AS T2 ON T1.cust_id = T2.cust_id WHERE T1.cust_name = 'S K L Enterprises Inc'
Database: shipping
Question: Among the shipments done by Sue Newell, how many of them are for S K L Enterprises Inc?
Evidence: "S K L Enterprises Inc" is the cust_name
SQL: SELECT COUNT(*) FROM customer AS T1 INNER JOIN shipment AS T2 ON T1.cust_id = T2.cust_id INNER JOIN driver AS T3 ON T3.driver_id = T2.driver_id WHERE T1.cust_name = 'S K L Enterprises Inc' AND T3.first_name = 'Sue' AND T3.last_name = 'Newell'
Database: shipping
Question: How many shipments were ordered by a customer in Florida?
Evidence: customer in Florida refers to state = 'FL'
SQL: SELECT COUNT(T1.cust_id) FROM customer AS T1 INNER JOIN shipment AS T2 ON T1.cust_id = T2.cust_id WHERE T1.state = 'FL'
Database: shipping
Question: Please list the IDs of all the shipments made by a retailer customer.
Evidence: "retailer" is the cust_type;  IDs of shipments refers to ship_id
SQL: SELECT T2.ship_id FROM customer AS T1 INNER JOIN shipment AS T2 ON T1.cust_id = T2.cust_id WHERE T1.cust_type = 'retailer'
Database: shipping
Question: Among the customers having at least one shipment in 2017, how many of them have an annual revenue of over 30000000?
Evidence: shipment in 2017 refers to Cast(ship_date AS DATE) = 2017; annual revenue of over 30000000 refers to annual_revenue > 30000000
SQL: SELECT COUNT(COUNTCUSID) FROM ( SELECT COUNT(T1.cust_id) AS COUNTCUSID FROM customer AS T1 INNER JOIN shipment AS T2 ON T1.cust_id = T2.cust_id WHERE STRFTIME('%Y', T2.ship_date) = '2017' AND T1.annual_revenue > 30000000 GROUP BY T1.cust_id HAVING COUNT(T2.ship_id) >= 1 ) T3
Database: shipping
Question: How many shipments in 2017 were done by Sue Newell?
Evidence: 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 STRFTIME('%Y', T1.ship_date) = '2017' AND T2.first_name = 'Sue' AND T2.last_name = 'Newell'
Database: shipping
Question: What is the full name of the driver that has done the most shipments in 2017?
Evidence: driver refers to driver_id; full name refers to first_name, last_name; in 2017 refers to Cast(ship_date AS DATE) = 2017; Most shipment refers to Max(Sum(weight))
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 STRFTIME('%Y', T1.ship_date) = '2017' GROUP BY T2.first_name, T2.last_name ORDER BY COUNT(*) DESC LIMIT 1
Database: shipping
Question: Among the shipments in 2017, how many of them have the destination in New Jersey?
Evidence: in 2017 refers to Cast(ship_date AS DATE) = 2017; 'New Jersey' is the state
SQL: SELECT COUNT(*) FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id WHERE STRFTIME('%Y', T1.ship_date) = '2017' AND T2.state = 'New Jersey'
Database: shipping
Question: What is the maximum weight being transported to New York during a single shipment?
Evidence: "New York" is the city_name; maximum weight refers to Max(weight)
SQL: SELECT MAX(T1.weight) FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id WHERE T2.city_name = 'New York'
Database: shipping
Question: How much more pounds in total were transported to New York than to Chicago?
Evidence: "New York" and "Chicago" are both city_name; more pounds in total refers to Subtract (Sum(weight where city_name = 'New York'), Sum(weight where city_name = 'Chicago'))
SQL: SELECT SUM(CASE WHEN T2.city_name = 'New York' THEN T1.weight ELSE 0 END) - SUM(CASE WHEN T2.city_name = 'Chicago' THEN T1.weight ELSE 0 END) FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id
Database: shipping
Question: Please list the destination cities of all the shipments ordered by S K L Enterprises Inc.
Evidence: "S K L Enterprises Inc" is the cust_name; destination cities refers to city_name
SQL: SELECT DISTINCT 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 T1.cust_name = 'S K L Enterprises Inc'
Database: shipping
Question: What is the average weight of the goods being transported on a single shipment ordered by S K L Enterprises Inc?
Evidence: "S K L Enterprises Inc" is the cust_name; average = Divide (Sum(weight), Count(ship_id))
SQL: SELECT AVG(T2.weight) FROM customer AS T1 INNER JOIN shipment AS T2 ON T1.cust_id = T2.cust_id WHERE T1.cust_name = 'S K L Enterprises Inc'
Database: shipping
Question: Among all the shipments to Florida, what is the percentage of the shipment to Jacksonville?
Evidence: "Florida" is the state; "Jacksonville" is city_name;
SQL: SELECT CAST(SUM(CASE WHEN T2.city_name = 'Jacksonville' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id WHERE T2.state = 'Florida'
Database: shipping
Question: State the headquarter of the truck which completed shipment no.1045.
Evidence: shipment no. 1045 refers to ship_id = 1045; headquarter refers to if make = 'Peterbit', then 'Texax(TX)', if make = 'Mack', then 'North Carolina (NC)'; if make = 'Kenworth', then 'Washington (WA)'
SQL: SELECT T1.make FROM truck AS T1 INNER JOIN shipment AS T2 ON T1.truck_id = T2.truck_id WHERE T2.ship_id = 1045
Database: shipping
Question: How many shipments were delivered by the oldest truck model?
Evidence: oldest truck model refers to Min(model_year)
SQL: SELECT COUNT(*) FROM truck AS T1 INNER JOIN shipment AS T2 ON T1.truck_id = T2.truck_id GROUP BY T1.model_year ORDER BY T1.model_year ASC LIMIT 1
Database: shipping
Question: Who was the customer of shipment no.1275? Give the customer's name.
Evidence: shipment no. 1275 refers to ship_id = 1275; customer name 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_id = '1275'
Database: shipping
Question: Where was the destination city of shipment no.1701?
Evidence: shipment no. 1701 refers to ship_id = 1701; destination 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_id = '1701'
Database: shipping
Question: Give the name of the driver of shipment no.1021.
Evidence: shipment no. 1021 refers to ship_id = 1021; 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_id = '1021'
Database: shipping
Question: Tell the name of the driver who received the shipment on 2017/11/5.
Evidence: shipment on 2017/11/5 refers to ship_date = '2017-11/05'; 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 = '2017-11-05'
Database: shipping
Question: Show the population of the city which was the destination of shipment no.1398.
Evidence: shipment no. 1398 refers to ship_id = 1398
SQL: SELECT T2.population FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id WHERE T1.ship_id = '1398'
Database: shipping
Question: Provide the ship date of the first shipment to customers in South Carolina.
Evidence: "South Carolina" refers to state = 'SC'; first shipment refers to Min(ship_date)
SQL: SELECT MIN(T1.ship_date) FROM shipment AS T1 INNER JOIN customer AS T2 ON T1.cust_id = T2.cust_id WHERE T2.state = 'SC'
Database: shipping
Question: For the shipment received by Leszek Kieltyka on 2017/9/25, what was its weight?
Evidence: on 2017/9/25 refers to ship_date = '2017-09-25'
SQL: 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'
Database: shipping
Question: What is the area of the destination city of shipment No.1346?
Evidence: shipment no. 1346 refers to ship_id = 1346
SQL: SELECT T2.area FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id WHERE T1.ship_id = '1346'
Database: shipping
Question: Provide the weight of the shipment to U-haul Center Of N Syracuse on 2016/9/21.
Evidence: "U-haul Center Of N Syracuse" is the cust_name; on 2016/9/21 refers to ship_date = '2016/09/21'
SQL: 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'
Database: shipping
Question: Who was the driver of truck no.3 on 2016/9/19? Tell the full name.
Evidence: truck no. 3 refers to truck_id = 3; on 2016/9/19 refers to ship_date = '2016-09-19'; full name refers to first_name, last_name
SQL: 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'
Database: shipping
Question: Calculate the population density of the city as the destination of shipment no.1369.
Evidence: shipment no. 1369 refers to ship_id = 1369; population density refers to Divide (area, population)
SQL: 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'
Database: shipping
Question: What is the average number of shipments done by the Kenworth trucks?
Evidence: "Kenworth" is the make of truck; average = Divide (Count(ship_id where make = 'Kenworth'), Count(truck_id where make = 'Kenworth))
SQL: 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'
Database: shipping
Question: How many pounds did Sue Newell transport during her first shipment?
Evidence: first shipment refers to Min(ship_date); pounds refers to weight
SQL: 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
Database: shipping
Question: To whom did the company transport its heaviest shipment?
Evidence: heaviest shipment refers to Max(weight)
SQL: 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
Database: shipping
Question: What is the full name of the driver who transported the first shipment of the company?
Evidence: first shipment of the company refers to Min(ship_date); 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.ship_date ASC LIMIT 1
Database: shipping
Question: In total, how many shipments were transported to Olympic Camper Sales Inc?
Evidence: "Olympic Camper Sales Inc" is the cust_name
SQL: 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'
Database: shipping
Question: How many of the shipments bound for New York City were shipped to Harry's Hot Rod Auto and Truck Accessories?
Evidence: "New York" is the city_name; 'Harry's Hot Rod Auto & Truck Accessories' is the cust_name
SQL: 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'
Database: shipping
Question: Among the top 5 heaviest shipments, how many shipments were transported via Mack?
Evidence: heaviest shipment refers to Max(weight); via Mack refers to make = 'Mack'
SQL: 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
Database: shipping
Question: What is the full name of the driver who delivered the most shipments to the least populated city?
Evidence: least populated city refers to Min(population); fullname refers to first_name, last_name; most shipment refers to driver_id where Max(Count (ship_id))
SQL: 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
Database: shipping
Question: How many shipments with weight of no more than 1,000 pounds were shipped by the oldest truck?
Evidence: weight of no more than 1000 pounds refers to weight < 1000; oldest truck refers to Min (model_year)
SQL: 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
Database: shipping
Question: How much is the annual revenue of the customer with the most number of shipments?
Evidence: customer with the most number of shipment refers to cust_id where Max(Count(ship_id))
SQL: 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
Database: shipping
Question: Among the shipments for Downey, how many shipments were shipped to California in 2016?
Evidence: "Downey" is the city_name; 'California' is the state, whose abbreviation is CA; in 2016 refers to year(ship_date) = 2016,
SQL: 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'
Database: shipping
Question: How many shipments did Holger Nohr transport to North Las Vegas overall?
Evidence: "North Las Vegas" is the city_name
SQL: 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'
Database: shipping
Question: How many shipments were shipped to the most densely populated city?
Evidence: most densely populated city refers to Max(Divide(area, population))
SQL: 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
Database: shipping
Question: Determine the percentage of manufacturers who are from Texas among all of Lorenzo's customers.
Evidence: "Texas" refers to state = 'TX'; 'manufacturer' is the cust_type; percentage = Divide (Count(cust_id where state = 'TX'), Count(cust_id)) * 100
SQL: SELECT CAST(SUM(CASE WHEN cust_type = 'manufacturer' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM customer WHERE state = 'TX'
Database: shipping
Question: Identify the total weight of shipments transported to San Mateo, California, in 2016.
Evidence: "San Mateo" is the city_name; in 2016 refers to Cast(ship_date as DATE) = 2016
SQL: 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'