Database: retail_complains
Question: In what years were the clients who demanded more problems with Certificate of deposit born?
Evidence: more problems with Certificate refers to MAX(COUNT("Sub-product" = '(CD) Certificate of deposit'));
SQL: SELECT T1.year FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T2.`Sub-product` = '(CD) Certificate of deposit' GROUP BY T1.year ORDER BY COUNT(T1.year) DESC LIMIT 1

Database: address
Question: What are the names of the states whose postal point is not affiliated with any organization?
Evidence: postal point is not affiliated with any organization refers to division is null
SQL: SELECT DISTINCT T2.name FROM zip_data AS T1 INNER JOIN state AS T2 ON T1.state = T2.abbreviation WHERE T1.division IS NULL

Database: books
Question: What is the second-least common method of shipping?
Evidence: method of shipping refers to method_name; least method refers to Min(Count(method_id))
SQL: SELECT T2.method_name FROM cust_order AS T1 INNER JOIN shipping_method AS T2 ON T1.shipping_method_id = T2.method_id GROUP BY T2.method_name ORDER BY COUNT(T2.method_id) ASC LIMIT 1, 1

Database: chicago_crime
Question: At which district did the multiple homicide case number JB120039 occurred?
Evidence: multiple homicide refers to Count(case_number) > 1; district refers to district_name
SQL: SELECT T1.district_no, T1.district_name FROM District AS T1 INNER JOIN Crime AS T2 ON T1.district_no = T2.district_no WHERE T2.case_number = 'JB120039' GROUP BY T1.district_no, T1.district_name

Database: world
Question: List all the countries in the continent of Asia that use English as their unofficial language.
Evidence: use English as unofficial language refers to Language = 'English' WHERE IsOfficial = 'F';
SQL: SELECT T1.Name FROM Country AS T1 INNER JOIN CountryLanguage AS T2 ON T1.Code = T2.CountryCode WHERE T1.Continent = 'Asia' AND T2.IsOfficial = 'F' GROUP BY T1.Name

Database: airline
Question: Give the code of the airport described as Driftwood Bay, AK: Driftwood Bay Airport.
Evidence: Driftwood Bay, AK: Driftwood Bay Airport refers to Description = 'Driftwood Bay, AK: Driftwood Bay Airport';
SQL: SELECT Code FROM Airports WHERE Description = 'Driftwood Bay, AK: Driftwood Bay Airport'

Database: soccer_2016
Question: List down all of the winning teams' IDs that played in St George's Park.
Evidence: winning teams' refers to Match_Winner; played in St George's Park refers to Venue_Name like 'St George%'
SQL: SELECT T2.Match_Winner FROM Venue AS T1 INNER JOIN Match AS T2 ON T1.Venue_Id = T2.Venue_Id WHERE T1.Venue_Name LIKE 'St George%'

Database: food_inspection
Question: How many establishments have an inspection score of no more than 50?
Evidence: establishments have the same meaning as businesses; inspection score of no more than 50 refers to score < 50;
SQL: SELECT COUNT(DISTINCT business_id) FROM inspections WHERE score < 50

Database: menu
Question: How many dishes do not have correct data for the year in which it appeared first?
Evidence: do not have correct data refers to first_appeared < 1851 or first_appeared > 2012;
SQL: SELECT COUNT(*) FROM Dish WHERE first_appeared < 1851 OR first_appeared > 2012

Database: movie_platform
Question: Which of the film directed by director Abbas Kiarostami has the highest average score?
Evidence: Abbas Kiarostami' is director_name; the highest Average score refers to Max(Avg(rating_score));
SQL: SELECT T2.movie_title FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T2.director_name = 'Abbas Kiarostami' GROUP BY T2.movie_title ORDER BY SUM(T1.rating_score) / COUNT(T1.rating_id) DESC LIMIT 1

Database: retail_complains
Question: Complaint about Credit Card mostly came from clients of which age group?
Evidence: about Credit Card refers to Product = 'Credit Card'; teenager refers to 13 < age < = 19; adult refers to 19 < age < = 65; elder refers to age < = 65
SQL: SELECT SUM(CASE WHEN T1.age > 13 AND T1.age <= 19 THEN 1 ELSE 0 END), SUM(CASE WHEN T1.age > 19 AND T1.age <= 65 THEN 1 ELSE 0 END) AS adult , SUM(CASE WHEN T1.age > 65 THEN 1 ELSE 0 END) AS elder FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T2.Product = 'Credit card'

Database: college_completion
Question: List down the states in 2011 with a national sector average of 20 and below.
Evidence: in 2011 refers to year = '2011'; national sector average of 20 and below refers to awards_per_natl_value < 20;
SQL: SELECT DISTINCT T1.state FROM state_sector_details AS T1 INNER JOIN state_sector_grads AS T2 ON T2.stateid = T1.stateid WHERE T2.year = 2011 AND T1.awards_per_natl_value <= 20

Database: regional_sales
Question: List the name of all customers who had made orders online.
Evidence: orders online refer to Sales Channel = 'Online';
SQL: SELECT T FROM ( SELECT CASE  WHEN T2.`Sales Channel` = 'Online' THEN T1.`Customer Names` ELSE NULL END AS T FROM Customers T1 INNER JOIN `Sales Orders` T2 ON T2._CustomerID = T1.CustomerID ) WHERE T IS NOT NULL

Database: law_episode
Question: Who was the nominee playing the role of Katrina Ludlow in the Law & Order series?
Evidence: nominee refers to result = 'Nominee'; the role of Katrina Ludlow refers to role = 'Katrina Ludlow'
SQL: SELECT T2.name FROM Award AS T1 INNER JOIN Person AS T2 ON T1.person_id = T2.person_id WHERE T1.result = 'Nominee' AND T1.role = 'Katrina Ludlow' AND T1.series = 'Law and Order'

Database: donor
Question: In the schools donated by the project of the resources provided by ABC School Supply, how many schools are public magnet schools?
Evidence: ABC School Supply is vendor_name;  public magnet school refers to school_magnet = 't';
SQL: SELECT COUNT(T2.schoolid) FROM resources AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T2.school_magnet = 't' AND T1.vendor_name = 'ABC School Supply'

Database: soccer_2016
Question: What is the name of the team that won the most number of matches in season 1?
Evidence: name of the team refers to Team_Name; the most number of matches refers to max(count(Match_Winner)); season 1 refers to season_Id = 1
SQL: SELECT Team_Name FROM Team WHERE Team_Id = ( SELECT Match_Winner FROM `Match` WHERE season_Id = 1 GROUP BY Match_Winner ORDER BY COUNT(Match_Winner) DESC LIMIT 1 )

Database: restaurant
Question: What are the restaurants that are located at "19th St. Oakland"?
Evidence: restaurant refers to label; "19th St. Oakland" refers to street_name = '19th St' AND city = 'Oakland'
SQL: SELECT T1.id_restaurant FROM generalinfo AS T1 INNER JOIN location AS T2 ON T1.id_restaurant = T2.id_restaurant WHERE T1.city = 'Oakland' AND T2.street_name = '19th St'

Database: talkingdata
Question: Please list the IDs of the events happened on all the vivo devices.
Evidence: IDs of the events refers to event_id; vivo devices refers to phone_brand = 'vivo';
SQL: SELECT T2.event_id FROM phone_brand_device_model2 AS T1 INNER JOIN events AS T2 ON T2.device_id = T1.device_id WHERE T1.phone_brand = 'vivo'

Database: books
Question: What is the email of the customers who place their orders with priority method?
Evidence: priority method refers to method_name = 'Priority'
SQL: SELECT T1.email FROM customer AS T1 INNER JOIN cust_order AS T2 ON T1.customer_id = T2.customer_id INNER JOIN shipping_method AS T3 ON T3.method_id = T2.shipping_method_id WHERE T3.method_name = 'Priority'

Database: disney
Question: For the movie in which Tress MacNeille was the voice actor for its character "Hyacinth Hippo", what was the release date of that movie?
Evidence: FALSE;
SQL: SELECT T1.release_date FROM characters AS T1 INNER JOIN `voice-actors` AS T2 ON T2.movie = T1.movie_title WHERE T2.character = 'Hyacinth Hippo' AND T2.`voice-actor` = 'Tress MacNeille'