Database: social_media
Question: For the tweet which got the most likes, state the gender of the user who tweeted it.
Evidence: most likes refers to Max(Likes)
SQL: SELECT T2.Gender FROM twitter AS T1 INNER JOIN user AS T2 ON T1.UserID = T2.UserID ORDER BY T1.Likes DESC LIMIT 1

Database: video_games
Question: Which company published the game with the most sales in North America?
Evidence: company refers to publisher_name; the most sales refers to max(num_sales); in North America refers to region_name = 'North America'
SQL: SELECT T.publisher_name FROM ( SELECT T5.publisher_name, SUM(T2.num_sales) * 100000 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 game_publisher AS T4 ON T3.game_publisher_id = T4.id INNER JOIN publisher AS T5 ON T4.publisher_id = T5.id WHERE T1.region_name = 'North America' GROUP BY T5.publisher_name ORDER BY SUM(T2.num_sales) * 100000 DESC LIMIT 1 ) t

Database: cs_semester
Question: Among the professors who have more than 3 research assistants, how many of them are male?
Evidence: research assistant refers to the student who serves for research where the abbreviation is RA; more than 3 research assistant refers to COUNT(student_id) > 3;
SQL: SELECT COUNT(*) FROM ( SELECT T2.prof_id FROM RA AS T1 INNER JOIN prof AS T2 ON T1.prof_id = T2.prof_id WHERE T2.gender = 'Male' GROUP BY T1.prof_id HAVING COUNT(T1.student_id) > 3 )

Database: world_development_indicators
Question: Which country has the smallest land area in square kilometers for 19 consecutive years starting from year 1961? Indicate how much is its land area in square kilometers in those years and the income group of the country.
Evidence: the smallest land area in square kilometers refers to min(value where IndicatorName like 'Land area (sq. km)'); for 19 consecutive years starting from year 1961 refers to Year between 1961 and 1979
SQL: SELECT T1.CountryName, SUM(T1.Value) area, T2.IncomeGroup FROM Indicators AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.CountryCode WHERE T1.IndicatorName = 'Land area (sq. km)' AND T1.Year >= 1961 AND T1.Year < 1980 GROUP BY T1.CountryCode ORDER BY SUM(T1.Value) ASC LIMIT 1

Database: books
Question: List all of the books that were published in 1995.
Evidence: published in 1995 refers to publication_date LIKE '1995%'; ; list of book refers to title
SQL: SELECT title FROM book WHERE STRFTIME('%Y', publication_date) = '1995'

Database: regional_sales
Question: Which sales team id has the highest number of orders in 2018?
Evidence: the highest number of orders in 2018 refers to MAX(COUNT(OrderNumber where SUBSTR(OrderDate, -2) = '18'));
SQL: SELECT _SalesTeamID FROM `Sales Orders` WHERE OrderDate LIKE '%/%/18' GROUP BY _SalesTeamID ORDER BY COUNT(_SalesTeamID) DESC LIMIT 1

Database: cs_semester
Question: What is the average capability of students with less than a 2.5 GPA?
Evidence: average capability = AVG(capability); gpa < 2.5;
SQL: SELECT CAST(SUM(T1.capability) AS REAL) / COUNT(T1.student_id) FROM RA AS T1 INNER JOIN student AS T2 ON T1.student_id = T2.student_id WHERE T2.gpa < 2.5

Database: video_games
Question: Calculate the number of games in the fighting genre.
Evidence: fighting genre refers to genre_name = 'Fighting';
SQL: SELECT COUNT(T1.id) FROM game AS T1 INNER JOIN genre AS T2 ON T1.genre_id = T2.id WHERE T2.genre_name = 'Fighting'

Database: student_loan
Question: Among students who have been absent for nine months, how many of them are disabled?
Evidence: absent for 9 months refers to month = 9;
SQL: SELECT COUNT(T1.name) FROM disabled AS T1 LEFT JOIN longest_absense_from_school AS T2 ON T2.name = T1.name WHERE T2.month = 9

Database: world_development_indicators
Question: How many countries are having their country's footnotes described as "unspecified"? Please provide the full names of any three of those countries.
Evidence: described as "unspecified" refers to Description = 'Not specified'; full names refers to LongName
SQL: SELECT COUNT(DISTINCT T1.CountryCode)  FROM Country AS T1 INNER JOIN Footnotes AS T2 ON T1.CountryCode = T2.Countrycode WHERE T2.Description = 'Unspecified' OR T2.Description = 'Not specified' UNION SELECT T1.LongName FROM Country AS T1 INNER JOIN Footnotes AS T2 ON T1.CountryCode = T2.Countrycode WHERE T2.Description = 'Unspecified' OR T2.Description = 'Not specified' LIMIT 4

Database: retail_world
Question: Which company name in London city has the most stocked products?
Evidence: the most stocked products refers to MAX(UnitsInStock)
SQL: SELECT T2.CompanyName FROM Products AS T1 INNER JOIN Suppliers AS T2 ON T1.SupplierID = T2.SupplierID WHERE T2.City = 'London' ORDER BY T1.UnitsInStock DESC LIMIT 1

Database: social_media
Question: Please list the texts of the top 3 tweets with the most number of unique users seeing the tweet.
Evidence: the most number of unique users seeing refers to Max(Reach)
SQL: SELECT text FROM twitter ORDER BY Reach DESC LIMIT 3

Database: donor
Question: In which city is there a greater number of schools that have received donations of less than 10 dollars?
Evidence: received donations of less than 10 dollars refers to dollar_amount = 'under_10'; city refers to school_city


SQL: SELECT T2.school_city FROM donations AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T1.dollar_amount = 'under_10' GROUP BY T2.school_city ORDER BY COUNT(T2.schoolid) DESC LIMIT 1

Database: public_review_platform
Question: List out the state of businesses which have opening time at 1AM.
Evidence: state refers to city
SQL: SELECT DISTINCT T1.state FROM Business AS T1 INNER JOIN Business_Hours AS T2 ON T1.business_id = T2.business_id WHERE T2.opening_time = '1AM'

Database: retail_complains
Question: Among the reviews from midwest region, what are the products that received 1 star?
Evidence: 1 star refers to Stars = 1
SQL: SELECT DISTINCT T3.Product FROM state AS T1 INNER JOIN district AS T2 ON T1.StateCode = T2.state_abbrev INNER JOIN reviews AS T3 ON T2.district_id = T3.district_id WHERE T1.Region = 'Midwest' AND T3.Stars = 1

Database: food_inspection_2
Question: What is the assumed name of the business located at 2903 W Irving Park Rd?
Evidence: assumed name refers to dba_name; 2903 W Irving Park Rd refers to address = '2903 W IRVING PARK RD '
SQL: SELECT DISTINCT dba_name FROM establishment WHERE address = '2903 W IRVING PARK RD '

Database: authors
Question: Write down the title and affiliation of the preprinted paper written by "Roger J.Marshal".
Evidence: "Roger J. Marshall" is the name of author; preprinted paper refers to ConferenceId = 0 AND JournalId = 0
SQL: SELECT T1.Title, T2.Affiliation FROM Paper AS T1 INNER JOIN PaperAuthor AS T2 ON T1.Id = T2.PaperId WHERE T2.Name = 'Roger J. Marshall' AND T1.ConferenceID = 0 AND T1.JournalID = 0

Database: soccer_2016
Question: In the matches where the winning margin is less than fifty, how many teams won by wicket?
Evidence: winning margin is less than fifty refers to Win_Margin < 50; won by wicket refers to Win_Type = 'wickets'
SQL: SELECT COUNT(T2.Win_Id) FROM `Match` AS T1 INNER JOIN Win_By AS T2 ON T1.Win_Type = T2.Win_Id WHERE T2.Win_Type = 'wickets' AND T1.Win_Margin < 50

Database: movie_platform
Question: Among all movies in the list, calculate the percentage of movies that were never been rated?
Evidence: percentage of movies that were never been rated refers to DIVIDE(COUNT(main_movies.movie_id ! = main_ratings.movie_id),COUNT(movie_id))
SQL: SELECT CAST(SUM(CASE WHEN T2.movie_id IS NULL THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T2.movie_id) FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id