Database: regional_sales
Question: What was the best discount applied to sales orders in 2020?
Evidence: sales orders in 2020 refers to Substr(OrderDate, -2) = '20'; best discount applied refers to Max(Discount Applied)
SQL: SELECT MAX(`Discount Applied`) FROM `Sales Orders` WHERE OrderDate LIKE '%/%/20'

Database: airline
Question: Give the name of the airline to which tail number N202NN belongs to.
Evidence: name of the airline refers to Description; tail number refers to TAIL_NUM; TAIL_NUM = 'N202NN';
SQL: SELECT T2.Description FROM Airlines AS T1 INNER JOIN `Air Carriers` AS T2 ON T1.OP_CARRIER_AIRLINE_ID = T2.Code WHERE T1.TAIL_NUM = 'N202NN' GROUP BY T2.Description

Database: authors
Question: In year 1999, list the titles and conference's short name of paper authored by someone named "Philip".
Evidence: in year 1999 refers to Year = 1999;  someone named "Philip" refers to Name LIKE 'Philip%'
SQL: SELECT T1.Title, T3.ShortName FROM Paper AS T1 INNER JOIN PaperAuthor AS T2 ON T1.Id = T2.PaperId INNER JOIN Conference AS T3 ON T1.ConferenceId = T3.Id WHERE T1.Year = 1999 AND T2.Name LIKE 'Philip%'

Database: donor
Question: Which cities in the Los Angeles Unified School District has bought supplies from Quill.com?
Evidence: cities refer to school_city; Los Angeles Unified School District refer to school_district = 'Los Angeles Unified School District'; supplies refer to project_resource_type; Quill.com refer to vendor_name
SQL: SELECT T2.school_city FROM resources AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T2.school_district = 'Los Angeles Unif Sch Dist' AND T1.vendor_name = 'Quill.com'

Database: talkingdata
Question: What are the ages and genders of the LG L70 users?
Evidence: LG L70 refers to phone_brand = 'LG' AND device_model = 'L70';
SQL: SELECT T2.age, T2.gender FROM phone_brand_device_model2 AS T1 INNER JOIN gender_age AS T2 ON T2.device_id = T1.device_id WHERE T1.phone_brand = 'LG' AND T1.device_model = 'L70'

Database: social_media
Question: How many tweets are posted by male users in Argentina?
Evidence: "Argentina" is the Country; male user refers to Gender = 'Male'
SQL: SELECT COUNT(T1.TweetID) FROM twitter AS T1 INNER JOIN location AS T2 ON T2.LocationID = T1.LocationID INNER JOIN user AS T3 ON T1.UserID = T3.UserID WHERE T3.Gender = 'Male' AND T2.Country = 'Argentina'

Database: chicago_crime
Question: Which district is the community area Lincoln Square grouped into?
Evidence: district refers to side; community area Lincoln Square refers to community_area_name = 'Lincoln Square'
SQL: SELECT side FROM Community_Area WHERE community_area_name = 'Lincoln Square'

Database: talkingdata
Question: Which category has more app users, Securities or Finance?
Evidence: more app users refers to SUBTRACT(IF(SUM(category = 'Securities'), SUM(category = 'Finance')) > 0,'Securities','Finance') as more;
SQL: SELECT IIF(SUM(IIF(T2.category = 'Securities', 1, 0)) - SUM(IIF(T2.category = 'Finance', 1, 0)) > 0, 'Securities', 'Finance') AS diff FROM app_labels AS T1 INNER JOIN label_categories AS T2 ON T1.label_id = T2.label_id

Database: music_platform_2
Question: What is the average rating for the "crime-junkie" podcast?
Evidence: "crime-junkie" podcast refers to title = 'crime-junkie'; average rating = Divide (Sum(rating), Count(rating))
SQL: SELECT AVG(T2.rating) FROM podcasts AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id WHERE T1.title = 'Crime Junkie'

Database: restaurant
Question: List the food type of the restaurant located in 22779 6th St., Hayward City.
Evidence: 22779 refers to street_num = 22779; 6th St. refers to street_name = '6th St'
SQL: SELECT T2.food_type FROM location AS T1 INNER JOIN generalinfo AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE T1.street_num = 22779 AND T1.street_name = '6th St' AND T2.city = 'hayward'

Database: food_inspection_2
Question: Tell the address of employee who did inspection ID 52238?
SQL: SELECT T1.address FROM employee AS T1 INNER JOIN inspection AS T2 ON T1.employee_id = T2.employee_id WHERE T2.inspection_id = 52238

Database: european_football_1
Question: In how many matches in the Seria A division did both teams have equal goals?
Evidence: Seria A is a name of division; equal goals refers to FTR = 'D', where D stands for draft;
SQL: SELECT COUNT(T1.FTR) FROM matchs AS T1 INNER JOIN divisions AS T2 ON T1.Div = T2.division WHERE T2.name = 'Seria A' AND T1.FTR = 'D'

Database: citeseer
Question: Calculate the percentage of words used in Agents class label.
Evidence: percentage = (divide(count(word_cited_id where class_label = 'Agents')), (count(word_cited_id)))*100;
SQL: SELECT CAST(COUNT(DISTINCT CASE WHEN T1.class_label = 'Agents' THEN T2.word_cited_id ELSE NULL END) AS REAL) * 100 / COUNT(DISTINCT T2.word_cited_id) FROM paper AS T1 INNER JOIN content AS T2 ON T1.paper_id = T2.paper_id

Database: regional_sales
Question: Which region has the most number of sales team?
Evidence: the most number of sales team refers to MAX(COUNT(Sales Team));
SQL: SELECT Region FROM `Sales Team` GROUP BY Region ORDER BY COUNT(DISTINCT `Sales Team`) DESC LIMIT 1

Database: food_inspection_2
Question: Among the employees that receive a salary between $75000 to $85000, what is the difference between the number of employees which undergone an inspection that fined 100 and 500?
Evidence: salary between $75000 and $85000 refers to 75000 < = salary < = 80000; difference = subtract(count(inspection_id where fine = 100), count(inspection_id where fine = 500)) where 75000 < = salary < = 80000
SQL: SELECT SUM(CASE WHEN T3.fine = 100 THEN 1 ELSE 0 END) - SUM(CASE WHEN T3.fine = 500 THEN 1 ELSE 0 END) FROM employee AS T1 INNER JOIN inspection AS T2 ON T1.employee_id = T2.employee_id INNER JOIN violation AS T3 ON T2.inspection_id = T3.inspection_id WHERE T1.salary BETWEEN 75000 AND 80000

Database: cookbook
Question: Which recipe has the highest number of ingredients? Calculate the said recipe's total time of cooking.
Evidence: the highest number of ingredients refers to MAX(ingredient_id); total time refers to recipe_id, total time of cooking refers to TOTAL(prep_min, cook_min, stnd_min)
SQL: SELECT T2.recipe_id, T1.prep_min + T1.cook_min + T1.stnd_min FROM Recipe AS T1 INNER JOIN Quantity AS T2 ON T1.recipe_id = T2.recipe_id GROUP BY T2.recipe_id ORDER BY COUNT(T2.ingredient_id) DESC LIMIT 1

Database: college_completion
Question: Between 2011 to 2013, what is the average number of male Hispanic degree-seeking students at 2-year institutions who graduated within 150 percent of normal/expected time in United Education Institute-Huntington Park Campus?
Evidence: between 2011 to 2013 refers to year BETWEEN '2011' AND '2013'; male refers to gender = 'M'; Hispanic refers to race = 'H'; number of degree-seeking students at 2-year institutions who graduated within 150 percent of normal/expected time refers to grad_150; United Education Institute-Huntington Park Campus refers to chronname = 'United Education Institute-Huntington Park Campus';
SQL: SELECT AVG(T2.grad_150) FROM institution_details AS T1 INNER JOIN institution_grads AS T2 ON T2.unitid = T1.unitid WHERE T1.chronname = 'United Education Institute-Huntington Park Campus' AND T2.year BETWEEN 2011 AND 2013 AND T2.gender = 'M' AND T2.race = 'H'

Database: retail_world
Question: Describe the supplier companies, cities and products which total production amount is more than 120.
Evidence: total production amount is more than 120 refers to ADD(UnitsInstock, UnitsOnOrder) > 120
SQL: SELECT T2.CompanyName, T2.City, T1.ProductName FROM Products AS T1 INNER JOIN Suppliers AS T2 ON T1.SupplierID = T2.SupplierID WHERE T1.UnitsInStock + UnitsOnOrder > 120