Database: public_review_platform
Question: List the categories of inactive businesses in AZ.
Evidence: inactive business refers to active = 'FALSE'; 'AZ' is the state; category refers to category_name
SQL: SELECT T3.category_name 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.active LIKE 'FALSE' AND T1.state LIKE 'AZ'

Database: public_review_platform
Question: Which closed/not running Yelp business in "Sun City" has got the most reviews? Give the business id.
Evidence: closed/not running refers to active = 'False'; most reviews refers to MAX(COUNT(user_id));
SQL: SELECT T1.business_id FROM Business AS T1 INNER JOIN Reviews AS T2 ON T1.business_id = T2.business_id WHERE T1.city LIKE 'Sun City' AND T1.active LIKE 'FALSE' GROUP BY T1.business_id ORDER BY COUNT(T2.review_length) DESC LIMIT 1

Database: student_loan
Question: How many female students have no payment due?
Evidence: have no payment due refers to bool = 'neg'; female students refers to name NOT in male table
SQL: SELECT COUNT(name) FROM no_payment_due WHERE name NOT IN ( SELECT name FROM male )

Database: movie_3
Question: Give the name of the manager staff for store No.1.
Evidence: store no. 1 refers to store_id = 1; name refers to first_name, last_name
SQL: SELECT T1.first_name, T1.last_name FROM staff AS T1 INNER JOIN store AS T2 ON T1.store_id = T2.store_id WHERE T2.store_id = 1

Database: synthea
Question: Among the patients that started taking Ibuprofen 200mg Oral Tablet in 2016, how many Dominican patients stopped taking the medicine after exactly one month?
Evidence: Ibuprofen 200mg Oral Tablet refers to DESCRIPTION = 'Ibuprofen 200 MG Oral Tablet' from medications; started in 2016 refers to START like '2016%'; Dominican patients refer to ethnicity = 'dominican'; stopped taking the medicine after exactly one month refers to SUBTRACT(strftime('%m', STOP), strftime('%m', START)) = 1;
SQL: SELECT COUNT(DISTINCT T1.patient) FROM patients AS T1 INNER JOIN medications AS T2 ON T1.patient = T2.PATIENT WHERE T2.DESCRIPTION = 'Ibuprofen 200 MG Oral Tablet' AND T1.ethnicity = 'dominican' AND strftime('%Y', T2.START) = '2016' AND strftime('%m', T2.STOP) - strftime('%m', T2.START) = 1

Database: car_retails
Question: Please list different customer names with the payment amount of over 50,000.
Evidence: amount > 50000;
SQL: SELECT DISTINCT T2.customerName FROM payments AS T1 INNER JOIN customers AS T2 ON T1.customerNumber = T2.customerNumber WHERE T1.amount > 50000

Database: social_media
Question: What is the day of the week that tweet with ID tw-682712873332805633 was posted?
Evidence: "tw-682712873332805633" is the TweetID; day of the week refers to Weekday
SQL: SELECT Weekday FROM twitter WHERE TweetID = 'tw-682712873332805633'

Database: synthea
Question: What is the difference between average glucose reading for patients in the 20s and 50s?
Evidence: sum(case when t2.DATE-t1.birthdate between 20 and 29 then t2.VALUE else 0 end)/count(case when t2.DATE-t1.birthdate between 20 and 29 then t2.PATIENT else null end)-sum(case when t2.DATE-t1.birthdate between 50 and 59 then t2.VALUE else 0 end)/count(case when t2.DATE-t1.birthdate between 50 and 59 then t2.PATIENT else null end)
SQL: SELECT SUM(CASE WHEN ROUND((strftime('%J', T2.DATE) - strftime('%J', T1.birthdate)) / 365) BETWEEN 20 AND 30 THEN T2.VALUE ELSE 0 END) / COUNT(CASE WHEN ROUND((strftime('%J', T2.DATE) - strftime('%J', T1.birthdate)) / 365) BETWEEN 20 AND 30 THEN T2.PATIENT END) - SUM(CASE WHEN ROUND((strftime('%J', T2.DATE) - strftime('%J', T1.birthdate)) / 365) BETWEEN 50 AND 60 THEN T2.VALUE ELSE 0 END) / COUNT(CASE WHEN ROUND((strftime('%J', T2.DATE) - strftime('%J', T1.birthdate)) / 365) BETWEEN 50 AND 60 THEN T2.PATIENT END) AS difference FROM patients AS T1 INNER JOIN observations AS T2 ON T1.patient = T2.PATIENT WHERE T2.DESCRIPTION = 'Glucose'

Database: mental_health_survey
Question: How many respondents who participated in the survey in 2014 work remotely at least 50% of the time?
Evidence: respondents' and 'users' are synonyms; work remotely at least 50% of the time refers to AnswerText(SurveyID = 2014& QuestionID = 93) = 'Yes'
SQL: SELECT COUNT(T1.AnswerText) FROM Answer AS T1 INNER JOIN Question AS T2 ON T1.QuestionID = T2.questionid WHERE T1.QuestionID = 93 AND T1.SurveyID = 2014 AND T1.AnswerText = 'Yes'

Database: retail_world
Question: The sales of how many territories in total do the employees in London take charge of?
Evidence: London refers to city = 'London';
SQL: SELECT COUNT(T2.TerritoryID) FROM Employees AS T1 INNER JOIN EmployeeTerritories AS T2 ON T1.EmployeeID = T2.EmployeeID WHERE T1.City = 'London'

Database: genes
Question: For the genes that are located in the plasma membrane, please list their number of chromosomes.
SQL: SELECT T1.Chromosome FROM Genes AS T1 INNER JOIN Classification AS T2 ON T1.GeneID = T2.GeneID WHERE T2.Localization = 'plasma membrane'

Database: university
Question: How many students attended universities were there in 2011?
Evidence: in 2011 refers to year = 2011;
SQL: SELECT SUM(num_students) FROM university_year WHERE year = 2011

Database: retails
Question: What is the total amount of tax charged for the order placed by customer 88931 on 7/13/994?
Evidence: total amount of tax refers to sum(multiply(multiply(l_extendedprice, subtract(1, l_discount)), add(1, l_tax))); customer 88931 refers to o_custkey = 88931; on 7/13/1994 refers to o_orderdate = '1994-07-13'
SQL: SELECT SUM(T2.l_extendedprice * (1 - T2.l_discount) * (1 + T2.l_tax)) FROM orders AS T1 INNER JOIN lineitem AS T2 ON T1.o_orderkey = T2.l_orderkey WHERE T1.o_custkey = 88931 AND T1.o_orderdate = '1994-07-13'

Database: video_games
Question: How many games were sold on PS3 platform in Japan?
Evidence: how many games = MULTIPLY(SUM(num_sales), 100000); PS3 refers to platform_name = 'PS3'; Japan refers to region_name = 'Japan';
SQL: SELECT SUM(T1.num_sales * 100000) FROM region_sales AS T1 INNER JOIN region AS T2 ON T1.region_id = T2.id INNER JOIN game_platform AS T3 ON T1.game_platform_id = T3.id INNER JOIN platform AS T4 ON T3.platform_id = T4.id WHERE T2.region_name = 'Japan' AND T4.platform_name = 'PS3'

Database: cookbook
Question: Which ingredient appeared the least in recipes?
Evidence: ingredient appeared the least in recipes refers to MIN(ingredient_id)
SQL: SELECT T1.name FROM Ingredient AS T1 INNER JOIN Quantity AS T2 ON T1.ingredient_id = T2.ingredient_id GROUP BY T2.ingredient_id ORDER BY COUNT(T2.ingredient_id) ASC LIMIT 1

Database: soccer_2016
Question: Give the name of the youngest player.
Evidence: name of player refers to Player_Name; the youngest refers to max(DOB)
SQL: SELECT Player_Name FROM Player ORDER BY DOB DESC LIMIT 1

Database: food_inspection_2
Question: Among the facilities that have undergone at least one inspection in 2010, how many of them are in ward no.42?
Evidence: in 2010 refers to inspection_date like '2010%'; in ward no.42 refers to ward = 42
SQL: SELECT COUNT(DISTINCT T1.license_no) FROM inspection AS T1 INNER JOIN establishment AS T2 ON T1.license_no = T2.license_no WHERE strftime('%Y', T1.inspection_date) = '2010' AND T2.ward = 42