Database: car_retails
Question: On what date did the customer with the lowest credit limit serviced by sales representative Barry Jones make payments for his/her orders?
SQL: SELECT T3.paymentDate FROM employees AS T1 INNER JOIN customers AS T2 ON T1.employeeNumber = T2.salesRepEmployeeNumber INNER JOIN payments AS T3 ON T2.customerNumber = T3.customerNumber WHERE T1.firstName = 'Barry' AND T1.lastName = 'Jones' AND T1.jobTitle = 'Sales Rep' ORDER BY T2.creditLimit ASC LIMIT 1

Database: movie_platform
Question: How many paying subscribers gave a rating to the movie "One Flew Over the Cuckoo's Nest"?
Evidence: paying subscribers refer to user_has_payment_method = 1; movie "One Flew Over the Cuckoo's Nest" refers to movie_id = 'One Flew Over the Cuckoo''s Nest'
SQL: SELECT COUNT(T1.user_id) FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id INNER JOIN ratings_users AS T3 ON T1.user_id = T3.user_id WHERE T2.movie_title = 'One Flew Over the Cuckoo''s Nest' AND T3.user_has_payment_method = 1

Database: world_development_indicators
Question: Please calculate the percentage of Sub-Saharan African countries which are in the Special trade system.
Evidence: Sub-Saharan African is the name of the region; SystemOfTrade = 'Special trade system'; countries refer to CountryCode; DIVIDE(COUNT (CountryCode where SystemOfTrade = 'Special trade system' and Region = 'Sub-Saharan Africa'), COUNT(CountryCode where Region = 'Sub-Saharan Africa')) as percentage;
SQL: SELECT  CAST(SUM(CASE WHEN Region = 'Sub-Saharan Africa' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(CountryCode) FROM Country WHERE SystemOfTrade = 'Special trade system'

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: image_and_language
Question: List all the IDs of images that have objects with the attributes of 'wired'.
Evidence: IDs of images refer to IMG_ID; objects with the attributes of 'wired' refer to ATT_CLASS = 'wired';
SQL: SELECT DISTINCT T2.IMG_ID FROM ATT_CLASSES AS T1 INNER JOIN IMG_OBJ_ATT AS T2 ON T1.ATT_CLASS_ID = T2.ATT_CLASS_ID WHERE T1.ATT_CLASS = 'wired'

Database: donor
Question: Find out if the project with the title Team More Books! has a New York teaching fellow.
Evidence: title Team More Books! Refers to title = 'Team More Books!'; as a New York teaching fellow refers to teacher_ny_teaching_fellow = 't'
SQL: SELECT T2.teacher_ny_teaching_fellow FROM essays AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T1.title LIKE 'Team More Books!'

Database: regional_sales
Question: Calculate the total net profit of the store located in highest median income city.
Evidence: net profit can be computed as SUBTRACT(Unit Price, Unit Cost); highest median income city refers to City Name where MAX(Median Income);
SQL: SELECT SUM(REPLACE(T1.`Unit Price`, ',', '') - REPLACE(T1.`Unit Cost`, ',', '')) FROM `Sales Orders` AS T1 INNER JOIN `Store Locations` AS T2 ON T2.StoreID = T1._StoreID ORDER BY T2.`Median Income` DESC LIMIT 1

Database: soccer_2016
Question: List the player's name of Mumbai Indians in the match ID 335990.
Evidence: Mumbai Indians refers to Team_Name = 'Mumbai Indians'; match ID 335990 refers to Match_Id = 335990
SQL: SELECT T3.Team_Name FROM Player AS T1 INNER JOIN Player_Match AS T2 ON T2.Player_Id = T1.Player_Id INNER JOIN Team AS T3 ON T3.Team_Id = T2.Team_Id WHERE T2.Match_Id = 335990 AND T3.Team_Name = 'Mumbai Indians' GROUP BY T3.Team_Name

Database: music_platform_2
Question: Indicates the title of all podcasts in the fiction category.
SQL: SELECT T2.title FROM categories AS T1 INNER JOIN podcasts AS T2 ON T2.podcast_id = T1.podcast_id WHERE T1.category = 'fiction'

Database: student_loan
Question: Count the number of male students who belong to foreign legion.
Evidence: belong to foreign legion refers to organ = 'foreign_legion';
SQL: SELECT COUNT(T1.name) FROM male AS T1 INNER JOIN enlist AS T2 ON T1.name = T2.name WHERE T2.organ = 'foreign_legion'

Database: address
Question: Provide the zip codes and area codes of the postal points with the community post office type at the elevation above 6000.
Evidence: community post office type refers to type = 'Community Post Office'; elevation above 6000 refers to elevation > 6000;
SQL: SELECT T1.zip_code, T1.area_code FROM area_code AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T2.type = 'Community Post Office ' AND T2.elevation > 6000

Database: public_review_platform
Question: How many businesses in Glendale city that are still running is opened from 8AM to 6PM?
Evidence: still running refers to active = 'true'; opened from 8AM to 6PM refers to opening_time = '8AM' AND closing_time = '6PM';
SQL: SELECT COUNT(T1.category_name) FROM Categories AS T1 INNER JOIN Business_Categories AS T2 ON T1.category_id = T2.category_id INNER JOIN Business AS T3 ON T2.business_id = T3.business_id INNER JOIN Business_Hours AS T4 ON T3.business_id = T4.business_id WHERE T3.city LIKE 'Glendale' AND T4.opening_time LIKE '8AM' AND T4.closing_time LIKE '6PM'

Database: talkingdata
Question: Give the number of 30-year-old users who were active in the events on 2016/5/2.
Evidence: 30-year-old refers to age = '30'; active refers to is_active = 1; on 2016/5/2 refers to timestamp = '2016/5/2 XX:XX:XX';
SQL: SELECT COUNT(T3.device_id) FROM app_events AS T1 INNER JOIN events AS T2 ON T1.event_id = T2.event_id INNER JOIN gender_age AS T3 ON T2.device_id = T3.device_id WHERE SUBSTR(`timestamp`, 1, 10) = '2016-05-02' AND T1.is_active = 1 AND T3.age = '30'

Database: soccer_2016
Question: In the database, how many times is the number of Indian cities to the South African cities?
Evidence: Indian refers to Country_Name = 'India'; South African refers to Country_Name = 'South Africa'; how many times = divide(count(City_Id where Country_Name = 'India'), count(City_Id where Country_Name = 'South Africa'))
SQL: SELECT CAST(SUM(CASE WHEN T2.Country_Name = 'India' THEN 1 ELSE 0 END) AS REAL) / SUM(CASE WHEN T2.Country_Name = 'South Africa' THEN 1 ELSE 0 END) FROM City AS T1 INNER JOIN Country AS T2 ON T1.Country_Id = T2.Country_Id

Database: books
Question: The book name "The Season: A Candid Look at Broadway" was published by which publisher?
Evidence: "The Season: A Candid Look at Broadway" is the  title of the book; publisher refers to publisher_name
SQL: SELECT T2.publisher_name FROM book AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.publisher_id WHERE T1.title = 'The Season: A Candid Look at Broadway'

Database: movie
Question: What is the MPAA rating for the movie with the character named "Peter Quill" in it?
Evidence: MPAA rating = 'G' means General audiences; MPAA rating = 'PG' means Parental guidance suggested; MPAA rating = 'R'means Restricted; MPAA rating = 'X' means No one under 17 admitted
SQL: SELECT T1.`MPAA Rating` FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID WHERE T2.`Character Name` = 'Peter Quill'

Database: mental_health_survey
Question: Among respondents who participated in the survey in 2016, what percentage had a mental health disorder in the past?
Evidence: respondents and 'users' are synonyms; percentage = divide(count(SurveyID = 2016& QuestionID = 32 & AnswerText = 'Yes'), count(SurveyID = 2016& QuestionID = 32))*100%
SQL: SELECT CAST(SUM(CASE  WHEN T1.AnswerText LIKE 'Yes' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.SurveyID) FROM Answer AS T1 INNER JOIN Question AS T2 ON T1.QuestionID = T2.questionid WHERE T1.QuestionID = 32 AND T1.SurveyID = 2016