Database: retail_world
Question: What is the largest quantity of "Manjimup Dried Apples" for an order?
Evidence: the largest quantity of "Manjimup Dried Apples" refers to MAX(Quantity) where ProductName = 'Manjimup Dried Apples';
SQL: SELECT T2.Quantity FROM Products AS T1 INNER JOIN `Order Details` AS T2 ON T2.ProductID = T1.ProductID WHERE T1.ProductName = 'Manjimup Dried Apples' ORDER BY T2.Quantity DESC LIMIT 1

Database: human_resources
Question: How many male Regional Managers are there?
Evidence: male refers to gender = 'M'; Regional Managers is a position title
SQL: SELECT COUNT(*) FROM employee AS T1  INNER JOIN position AS T2  ON T1.positionID = T2.positionID WHERE T2.positiontitle = 'Regional Manager' AND T1.gender = 'M'

Database: video_games
Question: How much are the sales of the games in region ID 4?
Evidence: how much are the sales = SUM(num_sales);
SQL: SELECT SUM(T.num_sales) * 100000 FROM region_sales AS T WHERE T.region_id = 4

Database: cs_semester
Question: List the professors' IDs and students' IDs with the lowest research ability.
Evidence: the lowest research ability refers to MIN(capability); professor’s ID refers to prof_id;
SQL: SELECT prof_id, student_id FROM RA WHERE capability = ( SELECT MIN(capability) FROM RA )

Database: car_retails
Question: How much did Petit Auto pay on 2004-08-09?
Evidence: Petit Auto is name of customer; paymentDate = '2004-08-09';
SQL: SELECT t1.amount FROM payments AS t1 INNER JOIN customers AS t2 ON t1.customerNumber = t2.customerNumber WHERE t2.customerName = 'Petit Auto' AND t1.paymentDate = '2004-08-09'

Database: public_review_platform
Question: How many users manage to get uber votes for all of the review category? Find out what are the user average star.
Evidence: users refer to user_id; uber votes for all of the review category refer to review_votes_funny = 'uber' AND review_votes_useful = 'uber' AND review_votes_cool = 'uber';
SQL: SELECT COUNT(T2.user_id) AS USER_IDS, T2.user_average_stars FROM Reviews AS T1 INNER JOIN Users AS T2 ON T1.user_id = T2.user_id WHERE T1.review_votes_funny = 'Uber' AND T1.review_votes_useful = 'Uber' AND T1.review_votes_cool = 'Uber'

Database: soccer_2016
Question: Calculate the run rate at the end of 17 overs of the match ID 335987 on 4/18/2008.
Evidence: 4/18/2008 refers to Match_Date = 4/18/2008; end of 17 overs refers to count(Toss_Name = 'field' ) = 17; run rate = divide(sum(Runs_Scored) when Toss_Name = 'bat', sum(Over_Id) when Toss_Name = 'field')
SQL: SELECT CAST(COUNT(CASE WHEN T1.Toss_Name = 'bat' THEN T3.Runs_Scored ELSE NULL END) AS REAL) / SUM(CASE WHEN T1.Toss_Name = 'field' THEN 1 ELSE 0 END) FROM Toss_Decision AS T1 INNER JOIN Match AS T2 ON T1.Toss_Id = T2.Toss_Decide INNER JOIN Batsman_Scored AS T3 ON T2.Match_Id = T3.Match_Id WHERE T2.Match_Id = 335987 AND T2.Match_Date = '2008-04-18' GROUP BY T3.Over_Id HAVING COUNT(T1.Toss_Name = 'field') = 17

Database: superstore
Question: Please list the IDs of the orders made by Aimee Bixby with more than 3 kinds of products ordered.
Evidence: made by Aimee Bixby refers to "Customer Name" = 'Aimee Bixby'; with more than 3 kinds of products ordered refers to count("Product ID") > 3;
SQL: SELECT DISTINCT T2.`Order ID` FROM people AS T1 INNER JOIN central_superstore AS T2 ON T1.`Customer ID` = T2.`Customer ID` WHERE T1.`Customer Name` = 'Aimee Bixby' GROUP BY T2.`Product ID` HAVING COUNT(T2.`Product ID`) > 3

Database: restaurant
Question: What is the name of the 24 hour diner at San Francisco?
Evidence: name refers to label; 24 hour diner refers to food_type = '24 hour diner'; San Francisco refers to city = 'san francisco'
SQL: SELECT label FROM generalinfo WHERE food_type = '24 hour diner' AND city = 'san francisco'

Database: car_retails
Question: Please list the order number of the customer whose credit card has a limit of 45300.
Evidence: Credit card does not have a limit refers to creditLimit = 45300;
SQL: SELECT t1.orderNumber FROM orders AS t1 INNER JOIN customers AS t2 ON t1.customerNumber = t2.customerNumber WHERE t2.creditLimit = 45300

Database: public_review_platform
Question: How many businesses in the fashion industry are rated 5 stars?
Evidence: fashion industry refers to category_name = 'Fashion';
SQL: SELECT COUNT(T1.business_id) FROM Business AS T1 INNER JOIN Business_Categories ON T1.business_id = Business_Categories.business_id INNER JOIN Categories AS T3 ON Business_Categories.category_id = T3.category_id WHERE T1.stars = 5 AND T3.category_name LIKE 'Fashion'

Database: sales_in_weather
Question: What was the difference of number of units sold in station number 1 and number 2 on year 2012?
Evidence: station 1 refers to station_nbr = 1; station 2 refers to station_nbr = 2; on year 2012 refers to substring (date, 1, 4) = '2012'; difference = Subtract (Sum(units where station_nbr = 1), Sum(units where station_nbr = 2))
SQL: SELECT SUM(CASE WHEN T1.station_nbr = 1 THEN units ELSE 0 END) - SUM(CASE WHEN T1.station_nbr = 2 THEN units ELSE 0 END) FROM relation AS T1 INNER JOIN sales_in_weather AS T2 ON T1.store_nbr = T2.store_nbr WHERE T2.`date` LIKE '%2012%'

Database: professional_basketball
Question: List the first name, last name and team name of players who are drafted from 'Seattle' between year 1965 to 1970.
Evidence: team name refers to teams.name; drafted from 'Seattle' refers to draftFrom = 'Seattle'; between year 1965 to 1970 refers to draftYear between 1965 and 1970
SQL: SELECT DISTINCT T1.firstName, T1.lastName, T3.name FROM players AS T1 INNER JOIN draft AS T2 ON T1.playerID = T2.playerID INNER JOIN teams AS T3 ON T2.tmID = T3.tmID WHERE T2.draftFrom = 'Seattle' AND T2.draftYear BETWEEN 1965 AND 1970

Database: mental_health_survey
Question: How many questions were asked in the questionary for the mental health survey?
SQL: SELECT COUNT(questiontext) FROM Question

Database: codebase_comments
Question: What is the processed time to download the repository whose files are contained in the solution with the path "jeffdik_tachy\src\Tachy.sln".
SQL: SELECT DISTINCT T2.ProcessedTime FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T2.Path = 'jeffdik_tachysrcTachy.sln'

Database: restaurant
Question: What is the name of the Chinese restaurant that can be found at 104 San Tomas Aquino Road, Campbell?
Evidence: restaurant name refers to label; Chinese restaurant refers to food_type = 'chinese'; 104 San Tomas Aquino Road Campbell refers to street_num = 104 AND street_name = 'san tomas aquino road' AND city = 'campbell'
SQL: SELECT T1.label FROM generalinfo AS T1 INNER JOIN location AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE T2.street_num = 104 AND T1.city = 'campbell' AND T2.street_name = 'san tomas aquino road'

Database: student_loan
Question: State the number of male students who do not have payment due.
Evidence: do not have payment due refers to bool = 'neg';
SQL: SELECT COUNT(T1.name) FROM no_payment_due AS T1 INNER JOIN male AS T2 ON T2.name = T1.name WHERE T1.bool = 'pos'

Database: talkingdata
Question: What age group is the most using SM-T2558 model phones?
Evidence: age group using SM-T2558 model phones the most refers to MAX(COUNT(group WHERE device_model = 'SM-T2558')); SM-T2558 model phones refers to device_model = 'SM-T2558';
SQL: SELECT T.`group` FROM ( SELECT T1.`group`, COUNT(T1.device_id) AS num FROM gender_age AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T2.device_model = 'SM-T2558' GROUP BY T1.`group` ) AS T ORDER BY T.num DESC LIMIT 1

Database: retail_world
Question: How many territory fall into region 1?
Evidence: region 1 refers to RegionID = 1


SQL: SELECT COUNT(TerritoryID) FROM Territories WHERE RegionID = 1