Database: restaurant
Question: What is the percentage of restaurants in the Bay Area region that scored over 4 for the review rating?
Evidence: scored over 4 refers to review > 4; percentage = divide(count(id_restaurant where region = 'bay area' and review > 4), count(id_restaurant where region = 'Bay Area')) * 100%
SQL: SELECT CAST(SUM(IIF(T2.review > 4, 1, 0)) AS REAL) * 100 / COUNT(T2.id_restaurant) FROM geographic AS T1 RIGHT JOIN generalinfo AS T2 ON T1.city = T2.city WHERE T1.region = 'bay area'

Database: sales_in_weather
Question: Please list the dates on which the temperature of station no.2 was above the 30-year normal.
Evidence: temperature above the 30-year normal refers to depart > 0; station no.2 refers to station_nbr = 2
SQL: SELECT `date` FROM weather WHERE station_nbr = 2 AND depart > 0

Database: retail_complains
Question: Among the clients born between 1980 and 2000, list the name of male clients who complained through referral.
Evidence: born between 1980 and 2000 refers to year BETWEEN 1980 AND 2000; name = first, middle, last; male refers to sex = 'Male'; complained through refers to "Submitted via";
SQL: SELECT T1.first, T1.middle, T1.last FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T1.year BETWEEN 1980 AND 2000 AND T1.sex = 'Male' AND T2.`Submitted via` = 'Referral'

Database: world_development_indicators
Question: How many countries have country note description as "Sources: UN Energy Statistics (2014)"? List the currency of these countries.
Evidence: countries refer to CountryCode; currency refers to CurrencyUnit;
SQL: SELECT COUNT(DISTINCT T1.Countrycode) FROM Country AS T1 INNER JOIN CountryNotes AS T2 ON T1.CountryCode = T2.Countrycode WHERE T2.Description = 'Sources: UN Energy Statistics (2014)' UNION SELECT DISTINCT t1.CurrencyUnit FROM country AS t1 INNER JOIN countrynotes AS t2 ON t1.CountryCode = t2.Countrycode WHERE t2.Description = 'Sources: UN Energy Statistics (2014)'

Database: simpson_episodes
Question: What are the titles of the episodes that have received more 7-star votes than the season average?
Evidence: episodes that have received more 7-star votes than the season average refers to votes > DIVIDE(SUM(votes), COUNT(stars = 7))
SQL: SELECT DISTINCT T1.episode_id FROM Episode AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE T2.stars = 7 AND T2.votes > 0.7 * ( SELECT CAST(COUNT(votes) AS REAL) / COUNT(CASE WHEN stars = 7 THEN 1 ELSE 0 END) FROM Vote );

Database: chicago_crime
Question: Find the commander's name, email address, and phone number of the Ogden district.
Evidence: commander's name refers to commander; email address refers to email; phone number refers to phone
SQL: SELECT commander, email, phone FROM District WHERE district_name = 'Ogden'

Database: public_review_platform
Question: List the city of the business where they open from 1 pm to 6 pm on Saturday.
Evidence: 1 pm refers to opening_time = '1PM'; 6 pm refers to closing_time = '6PM'; on Saturday refers to day_of_week = 'Saturday'
SQL: SELECT T1.city FROM Business AS T1 INNER JOIN Business_Hours AS T2 ON T1.business_id = T2.business_id INNER JOIN Days AS T3 ON T2.day_id = T3.day_id WHERE T2.closing_time LIKE '6PM' AND T2.opening_time LIKE '1PM' AND T3.day_of_week LIKE 'Saturday'

Database: olympics
Question: How many athletes from Malaysia have won a medal?
Evidence: Malaysia refers to region_name = 'Malaysia'; athletes won a medal refer to competitor_id where medal_id <> 4;
SQL: SELECT COUNT(T3.person_id) FROM medal AS T1 INNER JOIN competitor_event AS T2 ON T1.id = T2.medal_id INNER JOIN games_competitor AS T3 ON T2.competitor_id = T3.id INNER JOIN person_region AS T4 ON T3.person_id = T4.person_id INNER JOIN noc_region AS T5 ON T4.region_id = T5.id WHERE T5.region_name = 'Malaysia' AND T1.id != 4

Database: public_review_platform
Question: Among all the users with the average ratings of at least 4 and above of all reviews, calculate the percent that have no fans or followers.
Evidence: average ratings of at least 4 refers to user_average_stars > = 4; no fans or followers refers to user_fans = 'None'; percentage = divide(count(user_id where user_average_stars > = 4 and user_fans = 'None'), sum(user_id where user_average_stars > = 4))*100%
SQL: SELECT CAST(SUM(CASE WHEN user_fans = 'None' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(user_id) FROM Users WHERE user_average_stars >= 4

Database: chicago_crime
Question: Out of all the incidents of domestic violence reported at the ward represented by alderman Walter Burnett Jr., how many were arrested?
Evidence: domestic violence refers to domestic = 'TRUE'; arrested refers to arrest = 'TRUE'
SQL: SELECT SUM(CASE WHEN T2.arrest = 'TRUE' THEN 1 ELSE 0 END) FROM Ward AS T1 INNER JOIN Crime AS T2 ON T1.ward_no = T2.ward_no WHERE T1.alderman_first_name = 'Walter' AND T1.alderman_last_name = 'Burnett' AND alderman_name_suffix = 'Jr.' AND T2.domestic = 'TRUE'

Database: shakespeare
Question: How many poems did Shakespeare write?
Evidence: poems refers to GenreType = 'Poem'
SQL: SELECT COUNT(id) FROM works WHERE GenreType = 'Poem'

Database: legislator
Question: Which historical female legislator that have their term ended on the 3rd of March 1791?
Evidence: female legislator refers to gender_bio = 'F'; term ended on the 3rd of March 1791 refers to end = '1791-03-03';
SQL: SELECT T1.first_name, T1.last_name FROM historical AS T1 INNER JOIN `historical-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T2.end = '1791-03-03' AND T1.gender_bio = 'F'

Database: soccer_2016
Question: What is the total number of won matches of the team named "Pune Warriors"?
Evidence: the team named "Pune Warriors" refers to Team_Name = 'Pune Warriors'; the total number of won matches = count(Team_Name where Team_Id = Match_Winner)
SQL: SELECT SUM(CASE WHEN T2.Team_Name = 'Pune Warriors' THEN 1 ELSE 0 END) FROM Match AS T1 INNER JOIN Team AS T2 ON T2.Team_Id = T1.Match_Winner

Database: image_and_language
Question: What are the bounding boxes of the object samples with a predicted relation class of "by" in image no.1?
Evidence: bounding boxes of the object samples refers to (x, y, W, H); predicted relation class of "by" refers to PRED_CLASS = 'by'; image no.1 refers to IMG_ID = 1
SQL: SELECT T3.X, T3.Y, T3.W, T3.H FROM PRED_CLASSES AS T1 INNER JOIN IMG_REL AS T2 ON T1.PRED_CLASS_ID = T2.PRED_CLASS_ID INNER JOIN IMG_OBJ AS T3 ON T2.OBJ1_SAMPLE_ID = T3.OBJ_CLASS_ID WHERE T2.IMG_ID = 1 AND T1.PRED_CLASS = 'by'

Database: beer_factory
Question: What star rating is the most common for beers containing corn syrup?
Evidence: most common refers to MAX(COUNT(StarRating)); containing corn syrup refers to CornSyrup = 'TRUE';
SQL: SELECT T2.StarRating FROM rootbeerbrand AS T1 INNER JOIN rootbeerreview AS T2 ON T1.BrandID = T2.BrandID WHERE T1.CornSyrup = 'TRUE' GROUP BY T2.StarRating ORDER BY COUNT(T2.StarRating) DESC LIMIT 1

Database: shakespeare
Question: List the chapter ID of the works with a year greater than the 89% of average year of all listed works of Shakespeare.
Evidence: a year greater than the 89% of average year refers to DATE > multiply(divide(SUM(DATE) , COUNT(DATE)), 0.89)
SQL: SELECT T2.id FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id WHERE T1.DATE > ( SELECT AVG(DATE) FROM works ) * 0.89

Database: shakespeare
Question: How many chapters are there in "Midsummer Night's Dream"?
Evidence: in "Midsummer Night's Dream" refers to Title = 'Midsummer Night's Dream'
SQL: SELECT COUNT(T2.id) FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id WHERE T1.Title = 'Midsummer Night''s Dream'