Database: professional_basketball
Question: Which team did the all league rebound champion play in 1997? Give the full name of the team.
Evidence: rebound champion refers to max(rebounds); 1997 refers to 1997; full name refers to teams.name
SQL: SELECT T1.name FROM teams AS T1 INNER JOIN players_teams AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year WHERE T2.year = 1997 GROUP BY T1.name ORDER BY SUM(rebounds + dRebounds) DESC LIMIT 1

Database: beer_factory
Question: What is the full name of the customer that had made the most transactions in August, 2014?
Evidence: full name = First, Last; made the most transactions refers to MAX(COUNT(TransactionID)); in August, 2014 refers to SUBSTR(TransactionDate, 1, 4) = '2014' AND SUBSTR(TransactionDate, 6, 2) = '08';
SQL: SELECT T1.First, T1.Last FROM customers AS T1 INNER JOIN `transaction` AS T2 ON T1.CustomerID = T2.CustomerID WHERE STRFTIME('%Y-%m', T2.TransactionDate) = '2014-08' GROUP BY T1.CustomerID ORDER BY COUNT(T2.CustomerID) DESC LIMIT 1

Database: movie_3
Question: In 2006, how many restricted films were released?
Evidence: restricted refers to rating = 'R'; release refers to release_year; in 2006 refers to release_year = 2006; film refers to title
SQL: SELECT COUNT(film_id) FROM film WHERE rating = 'R' AND release_year = 2006

Database: sales_in_weather
Question: On which day was the weather more windy in station no.1, 2012/1/1 or 2012/1/2?
Evidence: station no.1 refers to station_nbr = 1; 2012/1/1 refers to date = '2012-01-01'; 2012/1/2 refers to date = '2012-01-02'; more windy refers to Max(avgspeed)
SQL: SELECT CASE WHEN (SUM(CASE WHEN `date` = '2012-01-01' THEN avgspeed ELSE 0 END) - SUM(CASE WHEN `date` = '2012-01-02' THEN avgspeed ELSE 0 END)) > 0 THEN '2012-01-01' ELSE '2012-01-02' END FROM weather WHERE station_nbr = 1

Database: retail_complains
Question: Which product got the most five stars, and how many?
Evidence: most five stars refers to MAX(COUNT(stars = 5));
SQL: SELECT T.Product, MAX(T.num) FROM ( SELECT Product, COUNT(Stars) AS num FROM reviews WHERE Stars = 5 GROUP BY Product ) T

Database: video_games
Question: Which platform is the most popular in Europe?
Evidence: platform that is the most popular refers to platform_name WHERE MAX(num_sales); in Europe refers to region_name = 'Europe' ;
SQL: SELECT T.platform_name FROM ( SELECT T4.platform_name FROM region AS T1 INNER JOIN region_sales AS T2 ON T1.id = T2.region_id INNER JOIN game_platform AS T3 ON T2.game_platform_id = T3.id INNER JOIN platform AS T4 ON T3.platform_id = T4.id WHERE T1.region_name = 'Europe' ORDER BY T2.num_sales DESC LIMIT 1 ) t

Database: image_and_language
Question: List all the attribute classes of the images that have a (5,5) coordinate.
Evidence: attribute classes refer to ATT_CLASS; (5,5) coordinate refers to X and Y coordinates of the bounding box where X = 5 and Y = 5;
SQL: SELECT T1.ATT_CLASS FROM ATT_CLASSES AS T1 INNER JOIN IMG_OBJ_ATT AS T2 ON T1.ATT_CLASS_ID = T2.ATT_CLASS_ID INNER JOIN IMG_OBJ AS T3 ON T2.IMG_ID = T3.IMG_ID WHERE T3.X = 5 AND T3.Y = 5

Database: beer_factory
Question: How many stars did Urijah Faber rate for Frostie?
Evidence: stars refers to StarRating; Frostie refers to BrandName = 'Frostie';
SQL: SELECT T2.StarRating FROM customers AS T1 INNER JOIN rootbeerreview AS T2 ON T1.CustomerID = T2.CustomerID INNER JOIN rootbeerbrand AS T3 ON T2.BrandID = T3.BrandID WHERE T1.First = 'Urijah' AND T1.Last = 'Faber' AND T3.BrandName = 'Frostie'

Database: shakespeare
Question: Among the comedy works of Shakespeare, what is the percentage of his works with a character named "antonio"?
Evidence: comedy works refers to GenreType = 'Comedy'; a character named "antonio" refers to CharName = 'antonio'; percentage = divide(sum(CharName = 'Antonio'), count(CharName)) as percentage
SQL: SELECT CAST(SUM(IIF(T4.CharName = 'antonio', 1, 0)) AS REAL) * 100 / COUNT(T1.id) FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id INNER JOIN paragraphs AS T3 ON T2.id = T3.chapter_id INNER JOIN characters AS T4 ON T3.character_id = T4.id WHERE T1.GenreType = 'Comedy'

Database: shakespeare
Question: What is the character and work ID of the text "Fear not thou, man, thou shalt lose nothing here."?
Evidence: character refers to chapter_id; text "Fear not thou, man, thou shalt lose nothing here."  refers to PlainText = 'Fear not thou, man, thou shalt lose nothing here.'
SQL: SELECT T2.character_id, T1.work_id FROM chapters AS T1 INNER JOIN paragraphs AS T2 ON T1.id = T2.chapter_id WHERE T2.PlainText = 'Fear not thou, man, thou shalt lose nothing here.'

Database: soccer_2016
Question: How many players have the bowling skill greater than 2?
Evidence: bowling skill greater than 2 refers to Bowling_skill > 2
SQL: SELECT COUNT(Player_Name) FROM Player WHERE Bowling_skill > 2

Database: restaurant
Question: List the full address of all the American restaurants with a review of 4 or more?
Evidence: full address refers to street_num, street_name, city; American restaurant refers to food_type = 'american'; a review of 4 or more refers to review > 4
SQL: SELECT T1.street_num, T1.street_name, T1.city FROM location AS T1 INNER JOIN generalinfo AS T2 ON T1.city = T2.city WHERE T2.review >= 4

Database: legislator
Question: Please list the username of the current official Facebook presence of all the current legislators that are famous or impact.
Evidence: username of the current official Facebook presence of the legislators refers to facebook; legislators that are famous or impact refers to wikipedia_id is not null;
SQL: SELECT T2.facebook FROM current AS T1 INNER JOIN `social-media` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T1.wikipedia_id IS NOT NULL GROUP BY T2.facebook

Database: soccer_2016
Question: How many matches were played on May 2008?
Evidence: in May 2008 refers to SUBSTR(Match_Date, 1, 4) = '2008' AND SUBSTR(Match_Date, 7, 1) = '5'
SQL: SELECT SUM(CASE WHEN SUBSTR(Match_Date, 7, 1) = '5' THEN 1 ELSE 0 END) FROM `Match` WHERE SUBSTR(Match_Date, 1, 4) = '2008'

Database: bike_share_1
Question: What is the maximum dew point in Fahrenheit degree on 7/15/2014 in the area with a zip code of 94301?
Evidence: the maximum dew point in Fahrenheit degree refers to max_dew_point_f; date = '7/15/2014';
SQL: SELECT DISTINCT CASE WHEN date = '7/15/2014' AND zip_code = 94301 THEN max_dew_point_f END FROM weather

Database: simpson_episodes
Question: List down the names of person born in California, USA.
Evidence: California refers to birth_region = 'California'; USA refers to birth_country = 'USA'
SQL: SELECT name FROM Person WHERE birth_region = 'California' AND birth_country = 'USA';

Database: donor
Question: Please list the titles of projects by which schools in Abington was donated.
Evidence: Abington is school_city;
SQL: SELECT T2.title FROM projects AS T1 INNER JOIN essays AS T2 ON T1.projectid = T2.projectid WHERE T1.school_city LIKE 'Abington'

Database: university
Question: Calculate the number of international students of University of Wisconsin-Madison in 2013.
Evidence: international students refers to DIVIDE(MULTIPLY(num_students, pct_international_students), 100); University of Wisconsin-Madison refers to university_name = 'University of Wisconsin-Madison'; in 2013 refers to year = 2013
SQL: SELECT CAST(T1.num_students * T1.pct_international_students AS REAL) / 100 FROM university_year AS T1 INNER JOIN university AS T2 ON T1.university_id = T2.id WHERE T1.year = 2013 AND T2.university_name = 'University of Wisconsin-Madison'

Database: legislator
Question: Give the full name of legislators who have accounts on OpenSecrets.org.
Evidence: full name refers to first_name, last_name; have accounts on OpenSecrets.org refers to opensecrets_id IS NOT NULL AND opensecrets_id <> ''
SQL: SELECT COUNT(*) FROM current WHERE opensecrets_id IS NOT NULL AND opensecrets_id <> ''