Database: public_review_platform
Question: Among the businesses in Scottsdale, list the attribute of the business with a high review count.
Evidence: "Scottsdale" is the name of city; high review count refers to review_count = 'High'; attribute of the business refers to attribute_name
SQL: SELECT T3.attribute_name FROM Business AS T1 INNER JOIN Business_Attributes AS T2 ON T1.business_id = T2.business_id INNER JOIN Attributes AS T3 ON T2.attribute_id = T3.attribute_id WHERE T1.review_count LIKE 'High' AND T1.city LIKE 'Scottsdale' GROUP BY T3.attribute_name

Database: legislator
Question: How many female legislators become representatives for California in 2015?
Evidence: female legislators refers to gender_bio = 'F'; representatives refers to type = 'rep'; for California refers to state = 'CA'; in 2015 refers to the year of start date is '2015';
SQL: SELECT COUNT(*) FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE STRFTIME('%Y', T2.start) = '2015' AND T2.state = 'CA' AND T1.gender_bio = 'F'

Database: regional_sales
Question: In which regions are the stores that have shipped products through the WARE-UHY1004 warehouse?
Evidence: "WARE-UHY1004" is the WarehouseCode
SQL: SELECT T FROM ( SELECT DISTINCT CASE  WHEN T3.WarehouseCode = 'WARE-UHY1004' THEN T1.Region END AS T FROM Regions T1 INNER JOIN `Store Locations` T2 ON T2.StateCode = T1.StateCode INNER JOIN `Sales Orders` T3 ON T3._StoreID = T2.StoreID ) WHERE T IS NOT NULL

Database: college_completion
Question: In the state with the highest state appropriations to higher education in fiscal year 2011 per resident, which institution has the lowest number of undergraduates in 2010?
Evidence: highest state appropriations to higher education in fiscal year 2011 per resident refers to MAX(state_appr_value); lowest number of undergraduates refers to MIN(student_count); in 2010 refers to year = 2010;
SQL: SELECT T1.chronname FROM institution_details AS T1 INNER JOIN state_sector_details AS T2 ON T2.state = T1.state INNER JOIN institution_grads AS T3 ON T3.unitid = T1.unitid WHERE T1.student_count = ( SELECT MIN(T1.student_count) FROM institution_details AS T1 INNER JOIN state_sector_details AS T2 ON T2.state = T1.state INNER JOIN institution_grads AS T3 ON T3.unitid = T1.unitid WHERE T3.year = 2010 ) AND T3.year = 2010 GROUP BY T1.state ORDER BY SUM(T2.state_appr_value) DESC LIMIT 1

Database: coinmarketcap
Question: Name the coin that have higher than average percentage price changed from the previous 24 hours for transaction on 2013/6/22.
Evidence: average percentage price changed from the previous 24 hours refers to AVG(percent_change_24h); on 15/5/2013 refers to DATE = '2013-04-15'
SQL: SELECT T1.name FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T2.date = '2020-06-22' GROUP BY T1.name HAVING AVG(T2.percent_change_24h) > T2.PRICE

Database: book_publishing_company
Question: What is the average level employees working as Managing Editor are at? How many levels are there between the average level and the highest level?
Evidence: Managing Editor is a job description which refers to job_desc; job level refers to job_lvl; highest level job refers to max_lvl; levels between the average level and the highest level = SUBTRACT(max_lvl; AVG(job_lvl))
SQL: SELECT AVG(T2.job_lvl), T1.max_lvl - AVG(T2.job_lvl) FROM jobs AS T1 INNER JOIN employee AS T2 ON T1.job_id = T2.job_id WHERE T1.job_desc = 'Managing Editor' GROUP BY T2.job_id, T1.max_lvl

Database: sales_in_weather
Question: In weather station 17, which store sold the highest quantity of item 45 in October 2012?
Evidence: weather station 17 refers to station_nbr = 17; item 45 refers to item_nbr = 45; in October 2012 refers to SUBSTR(date, 1, 7) = '2012-10': highest quantity refers to Max(Sum(units)); store refers to store_nbr
SQL: SELECT T1.store_nbr FROM sales_in_weather AS T1 INNER JOIN relation AS T2 ON T1.store_nbr = T2.store_nbr WHERE T1.item_nbr = 45 AND T2.station_nbr = 17 AND T1.`date` LIKE '%2012-10%' GROUP BY T1.store_nbr ORDER BY SUM(T1.units) DESC LIMIT 1

Database: simpson_episodes
Question: Name the title of the episode that received the highest star score and the highest number of votes.
Evidence: received the highest star score refers to MAX(stars); the highest number of votes refers to MAX(votes)
SQL: SELECT T1.title FROM Episode AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id ORDER BY T2.stars DESC, T2.votes DESC LIMIT 1;

Database: talkingdata
Question: What is the age and gender of the person who uses the device number 29182687948017100 on event number 1?
Evidence: device number refers to device_id; device_id = 29182687948017100; event number refers to event_id; and event_id = 1;
SQL: SELECT T1.age, T1.gender FROM gender_age AS T1 INNER JOIN events_relevant AS T2 ON T1.device_id = T2.device_id WHERE T1.device_id = 29182687948017100 AND T2.event_id = 1

Database: university
Question: Compute the average percentage of female students.
Evidence: average percentage of female students refers to avg(pct_female_students)
SQL: SELECT AVG(pct_female_students) FROM university_year

Database: chicago_crime
Question: Among the crimes in the ward with the most population, how many of them are cases of domestic violence?
Evidence: most population refers to Max(Population); domestic violence refers to domestic = 'TRUE'
SQL: SELECT COUNT(T1.ward_no) AS num FROM Ward AS T1 INNER JOIN Crime AS T2 ON T1.ward_no = T2.ward_no WHERE T2.domestic = 'TRUE' ORDER BY T1.Population = ( SELECT Population FROM Ward ORDER BY Population DESC LIMIT 1 )

Database: law_episode
Question: How many people were not credited at the end of the "Admissions" episode?
Evidence: not credited refers to credited = ''; the "Admissions" episode refers to title = 'Admissions'
SQL: SELECT COUNT(T2.person_id) FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id WHERE T1.title = 'Admissions' AND T2.credited = 'false'

Database: talkingdata
Question: What is the device id of the oldest user?
Evidence: oldest user refers to MAX(age);
SQL: SELECT device_id FROM gender_age WHERE age = ( SELECT MAX(age) FROM gender_age )

Database: books
Question: What is the name of the publisher who published Agatha Christie's first book?
Evidence: "Agatha Christie" is the author_name; name of publisher refers to publisher_name; first book refers to Min(publication_date)
SQL: SELECT T4.publisher_name FROM book AS T1 INNER JOIN book_author AS T2 ON T1.book_id = T2.book_id INNER JOIN author AS T3 ON T3.author_id = T2.author_id INNER JOIN publisher AS T4 ON T4.publisher_id = T1.publisher_id WHERE T3.author_name = 'Agatha Christie' ORDER BY T1.publication_date ASC LIMIT 1

Database: chicago_crime
Question: Please list the case numbers of all the crimes with no arrest made in Central Chicago.
Evidence: no arrest made refers to arrest = 'FALSE'; Central Chicago refers to district_name = 'Central'
SQL: SELECT COUNT(*) FROM Crime AS T1 INNER JOIN District AS T2 ON T1.district_no = T2.district_no WHERE T2.district_name = 'Central' AND T1.arrest = 'FALSE'

Database: restaurant
Question: Indicate the address of the restaurant with the most popular reviews.
Evidence: address refers to street_num, street_name; the most popular review refers to max(review)
SQL: SELECT T2.street_num, T2.street_name FROM generalinfo AS T1 INNER JOIN location AS T2 ON T1.id_restaurant = T2.id_restaurant ORDER BY T1.review DESC LIMIT 1

Database: professional_basketball
Question: For the 2001 rebounds leader in the league, when was his birthday?
Evidence: 2001 refers to year = 2001; rebounds leader refers to max(rebounds); birthday refers to birthDate
SQL: SELECT birthDate FROM players WHERE playerID = ( SELECT playerID FROM players_teams WHERE year = 2001 GROUP BY playerID ORDER BY SUM(rebounds + dRebounds) DESC LIMIT 1 )