Database: public_review_platform
Question: What is the average number of reviews written for active businesses that operate not more than 30 hours a week?
Evidence: avg(user_id) where active = 'true' and SUM(SUBTRACT(closing_time, opening_time)) < 30;
SQL: SELECT AVG(T3.user_id) FROM Business AS T1 INNER JOIN Business_Hours AS T2 ON T1.business_id = T2.business_id INNER JOIN Reviews AS T3 ON T1.business_id = T3.business_id WHERE T1.active = 'true' GROUP BY T2.closing_time - T2.opening_time HAVING SUM(T2.closing_time - T2.opening_time) < 30

Database: restaurant
Question: List all the average reviews of Chinese restaurants for each county from highest to lowest.
Evidence: Chinese restaurant refers to food_type = 'chinese'; average review refers to divide(sum(review), count(review))
SQL: SELECT AVG(T1.review) FROM generalinfo AS T1 INNER JOIN geographic AS T2 ON T1.city = T2.city WHERE T1.food_type = 'chinese' GROUP BY T1.id_restaurant ORDER BY AVG(T1.review) DESC

Database: image_and_language
Question: Which image has the highest number of "white" class attributes?
Evidence: "white" class attributes refers to ATT_CLASS = 'white'; highest number refers to max(count(ATT_CLASS_ID))
SQL: SELECT T1.IMG_ID AS IMGID FROM IMG_OBJ_att AS T1 INNER JOIN ATT_CLASSES AS T2 ON T1.ATT_CLASS_ID = T2.ATT_CLASS_ID WHERE T2.ATT_CLASS = 'white' GROUP BY T1.IMG_ID ORDER BY COUNT(T1.ATT_CLASS_ID) DESC LIMIT 1

Database: cs_semester
Question: What are the GPAs of the unpaid Research Assistants?
Evidence: Unpaid Research Assistants undertake their work without payment in which salary = 'free';
SQL: SELECT T2.gpa FROM RA AS T1 INNER JOIN student AS T2 ON T1.student_id = T2.student_id WHERE T1.salary = 'free'

Database: sales_in_weather
Question: What is the item number of the product with the highest number of units sold in store number 1 on 1/1/2012?
Evidence: item number refers to item_nbr; highest number of units sold refers to Max(units); store no.1 refers to store_nbr = 1; on 1/1/2012 refers to date = '2012-01-01'
SQL: SELECT item_nbr FROM sales_in_weather WHERE `date` = '2012-01-01' AND store_nbr = 1 ORDER BY units DESC LIMIT 1

Database: legislator
Question: What is the party and state of the legislator that has an open secrets ID of N00003689 and thomas ID of 186?
SQL: SELECT T2.party, T2.state FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T1.opensecrets_id = 'N00003689' AND T1.thomas_id = 186 GROUP BY T2.party, T2.state

Database: video_games
Question: Which publisher published Overwatch?
Evidence: which publisher refers to publisher_name; Overwatch refers to game_name = 'Overwatch';
SQL: SELECT T3.publisher_name FROM game AS T1 INNER JOIN game_publisher AS T2 ON T1.id = T2.game_id INNER JOIN publisher AS T3 ON T2.publisher_id = T3.id WHERE T1.game_name = 'Overwatch'

Database: world_development_indicators
Question: List out the table name and currency unit of countries using series code as FP.CPI.TOTL
SQL: SELECT T1.TableName, T1.CurrencyUnit FROM Country AS T1 INNER JOIN CountryNotes AS T2 ON T1.CountryCode = T2.Countrycode WHERE T2.SeriesCode = 'FP.CPI.TOTL'

Database: synthea
Question: List the ids of all the patients with condition that has a prevalence percentage of 18.8%.
Evidence: ids of the patients refer to PATIENT from conditions; condition that has a prevalence percentage of 18.8% refers to PREVALENCE PERCENTAGE = 18.8;
SQL: SELECT DISTINCT T1.PATIENT FROM conditions AS T1 INNER JOIN all_prevalences AS T2 ON lower(T2.ITEM) = lower(T1.DESCRIPTION) WHERE T2."PREVALENCE PERCENTAGE" = CAST(18.8 AS float)

Database: world
Question: What are the official languages used in Belgium?
Evidence: official languages refers to IsOfficial = 'T'; Belgium is a name of country;
SQL: SELECT T2.Language FROM Country AS T1 INNER JOIN CountryLanguage AS T2 ON T1.Code = T2.CountryCode WHERE T1.Name = 'Belgium' AND T2.IsOfficial = 'T'

Database: regional_sales
Question: Please indicate store id in the state of California that have been applied 20% discount in store.
Evidence: "California" is the name of State; in store refers to Sales Channel = 'In-Store'; 20% discount refers to Discount Applied = '0.2'
SQL: SELECT T FROM ( SELECT DISTINCT CASE  WHEN T2.State = 'California' AND T1.`Sales Channel` = 'In-Store' AND T1.`Discount Applied` = 0.2 THEN T2.StoreID END AS T FROM `Sales Orders` T1 INNER JOIN `Store Locations` T2 ON T2.StoreID = T1._StoreID ) WHERE T IS NOT NULL

Database: shipping
Question: How many shipments were shipped to customers living in California in year 2016?
Evidence: living in California refers to state = 'CA'; in year 2016 refers to CAST(ship_date AS DATE) = 2016
SQL: SELECT COUNT(*) AS per FROM customer AS T1 INNER JOIN shipment AS T2 ON T1.cust_id = T2.cust_id WHERE STRFTIME('%Y', T2.ship_date) = '2016' AND T1.state = 'CA'

Database: olympics
Question: Who is the heaviest athlete from Russia?
Evidence: the heaviest athlete refers to full_name where MAX(weight); from Russia refers to region_name = 'Russia';
SQL: SELECT T3.full_name FROM noc_region AS T1 INNER JOIN person_region AS T2 ON T1.id = T2.region_id INNER JOIN person AS T3 ON T2.person_id = T3.id WHERE T1.region_name = 'Russia' ORDER BY T3.weight DESC LIMIT 1

Database: food_inspection
Question: Provide the names, risk categories and descriptions for the eateries with violation type ID of 103111.
Evidence: eateries refer to business_id;
SQL: SELECT T2.name, T1.risk_category, T1.description FROM violations AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T1.violation_type_id = '103111'

Database: bike_share_1
Question: How many bicycle trip were made within San Jose city during August 2013?
Evidence: during August 2013 refers to start_date like '8/%/2013%';
SQL: SELECT COUNT(T2.id) FROM station AS T1 INNER JOIN trip AS T2 ON T2.start_station_name = T1.name WHERE T1.city = 'San Jose' AND T2.start_date LIKE '8/%/2013%' AND T2.start_station_name LIKE 'San Jose%' AND T2.end_station_name LIKE 'San Jose%'

Database: world_development_indicators
Question: Which country has the highest population in largest city for 19 consecutive years starting from 1960? Indicate the region to which the country is located.
Evidence: the highest population in largest city refers to max(value where IndicatorName = 'Population in largest city'); for 19 consecutive years starting from 1960 refers to Year BETWEEN'1960' and '1979'
SQL: SELECT T2.CountryCode, T2.Region FROM Indicators AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.CountryCode WHERE T1.IndicatorName = 'Population in largest city' AND T1.Year >= 1960 AND T1.Year < 1980 ORDER BY T2.Region DESC LIMIT 1

Database: cars
Question: Please list all the years in which the car model Chevrolet Impala was introduced in the market.
Evidence: year refers to model_year; Chevrolet Impala refers to car_name = 'chevrolet impala'
SQL: SELECT DISTINCT T1.model_year FROM production AS T1 INNER JOIN data AS T2 ON T1.ID = T2.ID WHERE T2.car_name = 'chevrolet impala'

Database: university
Question: In which country does Johns Hopkins University located?
Evidence: Johns Hopkins University refers to university_name = 'Johns Hopkins University'; which country refers to country_name
SQL: SELECT T2.country_name FROM university AS T1 INNER JOIN country AS T2 ON T1.country_id = T2.id WHERE T1.university_name = 'Johns Hopkins University'