Database: language_corpus
Question: State the name of the pair of word that have id of 20 and 50?
Evidence: word that have id of 20 refers to wid = 20; word that have id of 50 refers to wid = 50;
SQL: SELECT T1.word, T3.word FROM words AS T1 INNER JOIN biwords AS T2 ON T1.wid = T2.w1st INNER JOIN words AS T3 ON T3.wid = T2.w2nd WHERE T2.w1st = 20 AND T2.w2nd = 50

Database: chicago_crime
Question: Which community area has the least population?
Evidence: community area refers to community_area_name; the least population refers to min(population)
SQL: SELECT community_area_name FROM Community_Area ORDER BY population ASC LIMIT 1

Database: professional_basketball
Question: How many teams in the NBA which has at least 3 all-star players?
Evidence: NBA refers to lgID = 'NBA'; have at least 3 all-star players refers to count(player_allstar.playerID) > 3
SQL: SELECT COUNT(*) FROM ( SELECT tmID FROM players_teams AS T1 INNER JOIN player_allstar AS T2 ON T1.playerID = T2.playerID WHERE T1.lgID = 'NBA' GROUP BY T1.tmID HAVING COUNT(DISTINCT T1.playerID) > 3 ) AS T3

Database: address
Question: What was the population of Wilcox County in 2010?
Evidence: population of Wilcox County in 2010 refers to SUM(population_2010) where county = 'WILCOX';
SQL: SELECT SUM(T2.population_2010) FROM country AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T1.county = 'WILCOX'

Database: chicago_crime
Question: Calculate the difference in the average number of vehicular hijackings and aggravated vehicular hijackings in the districts.
Evidence: "VEHICULAR HIJACKING" and "AGGRAVATED VEHICULAR HIJACKING" are both secondary_description; difference in average = Subtract (Divide(Count(secondary_description = 'VEHICULAR HIJACKING'), Count(district_name)), Divide(Count(secondary_description = "AGGRAVATED VEHICULAR HIJACKING"), Count(district_name)))
SQL: SELECT ROUND(CAST(COUNT(CASE WHEN T1.secondary_description = 'VEHICULAR HIJACKING' THEN T1.iucr_no END) AS REAL) / CAST(COUNT(DISTINCT CASE WHEN T1.secondary_description = 'VEHICULAR HIJACKING' THEN T3.district_name END) AS REAL) - CAST(COUNT(CASE WHEN T1.secondary_description = 'AGGRAVATED VEHICULAR HIJACKING' THEN T1.iucr_no END) AS REAL) / CAST(COUNT(DISTINCT CASE WHEN T1.secondary_description = 'AGGRAVATED VEHICULAR HIJACKING' THEN T3.district_name END) AS REAL), 4) AS "difference" FROM IUCR AS T1 INNER JOIN Crime AS T2 ON T2.iucr_no = T1.iucr_no INNER JOIN District AS T3 ON T3.district_no = T2.district_no

Database: human_resources
Question: How many employees are there in the "Miami" office?
Evidence: Miami office refers to locationcity = 'Miami'
SQL: SELECT COUNT(*) FROM employee AS T1  INNER JOIN location AS T2  ON T1.locationID = T2.locationID WHERE T2.locationcity = 'Miami'

Database: simpson_episodes
Question: What are the episodes Oscar Cervantes is credited with?
Evidence: is credited refers to credited = 'true';
SQL: SELECT episode_id FROM Credit WHERE person = 'Oscar Cervantes' AND credited = 'true';

Database: retails
Question: List the 5 orders with the highest total price, indicating the delivery date.
Evidence: order refers to o_orderkey; the highest total price refers to max(o_totalprice); delivery date refers to l_shipdate
SQL: SELECT T1.o_orderkey, T2.l_shipdate FROM orders AS T1 INNER JOIN lineitem AS T2 ON T1.o_orderkey = T2.l_orderkey ORDER BY T1.o_totalprice DESC LIMIT 5

Database: synthea
Question: How old was Mrs. Laronda Bernier at the time of her most recent medical encounter?
Evidence: how old = SUBTRACT(MIN(encounters.DATE), patients.birthdate); most recent medical encounter refers to MIN(encounters.DATE);
SQL: SELECT T2.DATE - T1.birthdate AS age FROM patients AS T1 INNER JOIN encounters AS T2 ON T1.patient = T2.PATIENT WHERE T1.first = 'Laronda' AND T1.last = 'Bernier' ORDER BY T2.DATE DESC LIMIT 1

Database: movie_3
Question: What is the email address of the staff Jon Stephens?
SQL: SELECT email FROM staff WHERE first_name = 'Jon' AND last_name = 'Stephens'

Database: language_corpus
Question: How many words are repeated on the Llista de conflictes armats page?
Evidence: title = 'Llista de conflictes armats'; How many repeated refers to occurrences;
SQL: SELECT occurrences FROM pages_words WHERE pid = ( SELECT pid FROM pages WHERE title = 'Llista de conflictes armats' )

Database: soccer_2016
Question: How many games were played in March 2010?
Evidence: were played in March 2010 refers to Match_Date = '2010-03%'
SQL: SELECT SUM(CASE WHEN Match_Date LIKE '2010-03%' THEN 1 ELSE 0 END) FROM `Match`

Database: simpson_episodes
Question: Among the episode that get more than 950 votes, how many of the episodes were nominated for the 'Outstanding Voice-Over Performance Award in 2009'? Find the percentage of the episodes.
Evidence: more than 950 votes refers to votes > 950; in 2009 refers to year = 2009; number of episode = Count(episode_id); nominated refers to result = 'Nominee'; percentage = Divide(Count(award = 'Outstanding Voice-Over Performance'), Count(episode_id)) * 100
SQL: SELECT CAST(SUM(CASE WHEN T1.award = 'Outstanding Voice-Over Performance' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T2.episode_id) FROM Award AS T1 INNER JOIN Episode AS T2 ON T1.episode_id = T2.episode_id WHERE T2.votes > 950 AND T1.year = 2009;

Database: bike_share_1
Question: How many trips in 2013 had durations longer than 1000 seconds?
Evidence: trips in 2013 refers to start_date like'%2013%'; duration>1000;
SQL: SELECT COUNT(duration) FROM trip WHERE start_date LIKE '%/%/2013%' AND duration > 1000

Database: legislator
Question: Which legislators do not have instagram account?
Evidence: do not have instagram account refers to instagram is null;
SQL: SELECT T1.first_name, T1.last_name FROM current AS T1 INNER JOIN `social-media` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T2.instagram IS NULL

Database: law_episode
Question: How many roles did Julia Roberts play in the series?
SQL: SELECT COUNT(T1.role) FROM Credit AS T1 INNER JOIN Person AS T2 ON T2.person_id = T1.person_id WHERE T2.name = 'Julia Roberts'

Database: retails
Question: What are the names of the parts that were ordered by customer 110942?
Evidence: name of the part refers to p_name; customer 110942 refers to o_custkey = 110942
SQL: SELECT T3.p_name FROM orders AS T1 INNER JOIN lineitem AS T2 ON T1.o_orderkey = T2.l_orderkey INNER JOIN part AS T3 ON T2.l_partkey = T3.p_partkey WHERE T1.o_custkey = 110942

Database: retail_complains
Question: List the top five cities in terms of the number of 5-star ratings in 2016 reviews, in descending order.
Evidence: 5-star rating refers to Stars = 5; in 2016 refers to Date like '2016%'; most reviews refers to max(count(city))
SQL: SELECT T2.city FROM reviews AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id WHERE T1.Stars = 5 AND T1.Date LIKE '2016%' ORDER BY T1.Date DESC LIMIT 5

Database: talkingdata
Question: How many users belong to the MOBA category?
SQL: SELECT COUNT(T2.app_id) FROM label_categories AS T1 INNER JOIN app_labels AS T2 ON T2.label_id = T1.label_id WHERE T1.category = 'MOBA'

Database: talkingdata
Question: Among the LG brand users, calculate the percentage of the Nexus 5 model user. What is the ratio of male and female users of it?
Evidence: LG brand refers to phone_brand = 'LG'; percentage = DIVIDE(MULTIPLY(CONCAT(COUNT(device_id WHERE device_model = 'Nexus 5'), 100), COUNT(device_id)),'%'); ratio = DIVIDE(COUNT(device_id WHERE device_model = 'Nexus 5' AND gender = 'M'), COUNT(device_id WHERE device_model = 'Nexus 5' AND gender = 'F')); Nexus 5 model refers to device_model = 'Nexus 5';
SQL: SELECT SUM(IIF(T1.device_model = 'Nexus 5', 1, 0)) * 100 / COUNT(T1.device_id) AS per , SUM(IIF(T1.device_model = 'Nexus 5' AND T2.gender = 'M', 1, 0)) / SUM(IIF(T1.device_model = 'Nexus 5' AND T2.gender = 'F', 1, 0)) AS r FROM phone_brand_device_model2 AS T1 INNER JOIN gender_age AS T2 ON T2.device_id = T1.device_id WHERE T1.phone_brand = 'LG'