Database: retail_complains
Question: List the full names and phone numbers of clients that were from the Pacific.
Evidence: full name refers to first, middle, last; the Pacific refers to division = 'Pacific'
SQL: SELECT T1.first, T1.middle, T1.last, T1.phone FROM client AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id WHERE T2.division = 'Pacific'

Database: human_resources
Question: Among the employees with poor performance, provide the managers' full names, location city, address and its zip code.
Evidence: poor performance refers to performance = 'Poor'; full name = firstname, lastname; managers is a position title
SQL: SELECT T1.firstname, T1.lastname, T2.locationcity, T2.address, T2.zipcode FROM employee AS T1  INNER JOIN location AS T2  ON T1.locationID = T2.locationID INNER JOIN position AS T3  ON T3.positionID = T1.positionID WHERE T3.positiontitle = 'Manager' AND T1.performance = 'Poor'

Database: app_store
Question: How many apps have rating of 5?
Evidence: FALSE;
SQL: SELECT COUNT(App) FROM playstore WHERE Rating = 5

Database: simpson_episodes
Question: Who did "The Tiny Canadian" play as in the show?
Evidence: "The Tiny Canadian" refers to nickname = 'The Tiny Canadian'; play as in the show refers to role

SQL: SELECT T2.role FROM Person AS T1 INNER JOIN Credit AS T2 ON T1.name = T2.person WHERE T1.nickname = 'The Tiny Canadian';

Database: cs_semester
Question: Among the students who took the course Machine Learning Theory, how many of them are undergraduates?
Evidence: UG is an abbreviated name of undergraduate student in which type = 'UG';
SQL: SELECT COUNT(T1.student_id) FROM student AS T1 INNER JOIN registration AS T2 ON T1.student_id = T2.student_id INNER JOIN course AS T3 ON T2.course_id = T3.course_id WHERE T3.name = 'Machine Learning Theory' AND T1.type = 'UG'

Database: coinmarketcap
Question: What is the total value of Argentum coined traded in the past 24 hours on 2016/10/11.
Evidence: total value in the past 24 hours refers to volume_24h; on 11/10/16 refers to date = '2016-11-10'
SQL: SELECT T2.volume_24h FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T1.name = 'Argentum' AND T2.date = '2016-10-11'

Database: simpson_episodes
Question: What is the character that won the award in Primetime Emmy 2009?
Evidence: won the award in Primetime Emmy 2009 refers to award_category = 'Primetime Emmy' and year = 2009
SQL: SELECT DISTINCT T2.character FROM Award AS T1 INNER JOIN Character_Award AS T2 ON T1.award_id = T2.award_id WHERE T1.award_category = 'Primetime Emmy' AND T1.year = 2009 AND T1.result = 'Winner';

Database: retails
Question: List the names of the countries with the below-average number of customers in ascending order of customer numbers.
Evidence: the names of countries with the below-average number of customers refer to n_name where COUNT(c_name) < DIVIDE(COUNT(c_name)), COUNT(n_name);
SQL: SELECT T2.n_name FROM customer AS T1 INNER JOIN nation AS T2 ON T1.c_nationkey = T2.n_nationkey GROUP BY T2.n_name HAVING COUNT(T1.c_name) > ( SELECT COUNT(customer.c_name) / COUNT(DISTINCT nation.n_name) FROM customer INNER JOIN nation ON customer.c_nationkey = nation.n_nationkey ) ORDER BY COUNT(T1.c_name)

Database: simpson_episodes
Question: State the birth place of co-executive producer for nominee of "Outstanding Animated Program (For Programming Less Than One Hour)" award.
Evidence: co-executive producer refers to role = 'co-executive producer'; nominee of "Outstanding Animated Program (For Programming Less Than One Hour)" award refers to award = 'Outstanding Animated Program (For Programming Less Than One Hour)' and result = 'Nominee'
SQL: SELECT T1.birth_place FROM Person AS T1 INNER JOIN Award AS T2 ON T1.name = T2.person WHERE T2.award = 'Outstanding Animated Program (For Programming Less Than One Hour)' AND T2.role = 'co-executive producer';

Database: retails
Question: Which country has the least number of suppliers?
Evidence: country refers to n_name; the least number of suppliers refers to min(count(s_name))
SQL: SELECT T2.n_name FROM supplier AS T1 INNER JOIN nation AS T2 ON T1.s_nationkey = T2.n_nationkey GROUP BY T1.s_nationkey ORDER BY COUNT(T1.s_name) LIMIT 1

Database: legislator
Question: What is the title of legislator whose birthday on 2/20/1942?
Evidence: birthday on 2/20/1942 refers to birthday_bio = '1942-02-20'
SQL: SELECT T2.title FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T1.birthday_bio = '1942-02-20' GROUP BY T2.title

Database: legislator
Question: How many legislators have not been registered in Federal Election Commission data?
Evidence: have not been registered in Federal Election Commission data refers to fec_id is null OR fec_id = ''
SQL: SELECT COUNT(*) FROM current WHERE fec_id IS NULL OR fec_id = ''

Database: movies_4
Question: What is the third least common genre?
Evidence: least common genre refers to min(count(genre_name))
SQL: SELECT T2.genre_name FROM movie_genres AS T1 INNER JOIN genre AS T2 ON T1.genre_id = T2.genre_id GROUP BY T2.genre_id ORDER BY COUNT(T1.movie_id) LIMIT 2, 1

Database: address
Question: What is the longitude and latitude for the district represented by Grayson Alan?
SQL: SELECT T1.latitude, T1.longitude FROM zip_data AS T1 INNER JOIN zip_congress AS T2 ON T1.zip_code = T2.zip_code INNER JOIN congress AS T3 ON T2.district = T3.cognress_rep_id WHERE T3.first_name = 'Grayson' AND T3.last_name = 'Alan'

Database: public_review_platform
Question: Among the businesses which have attribute of beer_and_wine, how many business located in Peoria?
Evidence: attribute of beer_and_wine refers to attribute_value = 'beer_and_wine'; in Peoria refers to city = 'Peoria'
SQL: SELECT COUNT(T1.business_id) FROM Business_Attributes AS T1 INNER JOIN Business AS T2 ON T1.business_id = T2.business_id WHERE T2.city = 'Peoria' AND T1.attribute_value = 'beer_and_wine'

Database: bike_share_1
Question: Please write down the trip IDs which ended on the days when the minimum temperature is less than 45 degrees Fahrenheit.
Evidence: the minimum temperature is less than 45 degrees Fahrenheit refers to min_temperature_f<45;
SQL: SELECT T1.id FROM trip AS T1 INNER JOIN weather AS T2 ON T2.zip_code = T1.zip_code WHERE T2.min_temperature_f < 45

Database: restaurant
Question: What type of food is there in the restaurants on Adeline Street in Berkeley city?
Evidence: Adeline Street refers to street_name = 'adeline st'; type of food refers to food_type


SQL: SELECT T1.food_type FROM generalinfo AS T1 INNER JOIN location AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE T2.street_name = 'adeline st' AND T2.city = 'berkeley'

Database: retail_world
Question: How many employees report to Andrew Fuller?
Evidence: "Andrew Fuller" refers to FirstName = 'Andrew' AND LastName = 'Fuller'; report to refers to ReportsTo ! = NULL
SQL: SELECT COUNT(EmployeeID) FROM Employees WHERE ReportsTo = ( SELECT EmployeeID FROM Employees WHERE LastName = 'Fuller' AND FirstName = 'Andrew' )

Database: food_inspection_2
Question: Among the list of employees, what is the total number of supervisors?
Evidence: supervisor refers to title = 'Supervisor'
SQL: SELECT COUNT(employee_id) FROM employee WHERE title = 'Supervisor'

Database: synthea
Question: What is the id of the patient whose hypertension started most recently?
Evidence: id of the patient refers to PATIENT from conditions;  hypertension refers to DESCRIPTION = 'Hypertension'; most recently refers to MAX(START);
SQL: SELECT PATIENT FROM conditions WHERE START = ( SELECT MAX(START) FROM conditions WHERE DESCRIPTION = 'Hypertension' )