Database: public_review_platform
Question: How many businesses in Arizona having an average review less than 3 stars?
Evidence: businesses in Arizona refer to business_id where state = 'Arizona'; average review less than 3 stars refers to AVG(review_stars) < 3.0;
SQL: SELECT COUNT(business_id) FROM Business WHERE business_id IN ( SELECT DISTINCT T1.business_id FROM Business AS T1 INNER JOIN Reviews AS T2 ON T1.business_id = T2.business_id WHERE T1.state = 'AZ' GROUP BY T1.business_id HAVING SUM(T2.review_stars) / COUNT(T2.user_id) < 3 )

Database: cs_semester
Question: Give the student's ID of students with 2.5 GPA and enrolled in C for Programmers.
SQL: SELECT T2.student_id FROM student AS T1 INNER JOIN registration AS T2 ON T1.student_id = T2.student_id INNER JOIN course AS T3 ON T2.course_id = T3.course_id WHERE T3.name = 'C for Programmers' AND T1.gpa = 2.5

Database: simpson_episodes
Question: Which episode has the highest number of vote of the star score?
Evidence: highest number of vote of the star score refers to max(votes)
SQL: SELECT episode_id FROM Vote ORDER BY votes DESC LIMIT 1;

Database: law_episode
Question: Who was the actor who was portraying "Alex Brown" and has been credited?
Evidence: who refers to name; portraying "Alex Brown" refers to role = 'Alex Brown'; has been credited refers to credited = 'true'
SQL: SELECT T1.name FROM Person AS T1 INNER JOIN Credit AS T2 ON T1.person_id = T2.person_id WHERE T2.role = 'Alex Brown' AND T2.credited = 'true'

Database: student_loan
Question: How many disabled students have been absent for 3 months from school?
Evidence: have been absent for 3 months from school refers to month = 3
SQL: SELECT COUNT(T1.name) FROM longest_absense_from_school AS T1 INNER JOIN disabled AS T2 ON T1.name = T2.name WHERE T1.month = 3

Database: public_review_platform
Question: What is the average year for a user to be upgraded to elite user?
Evidence: AVG(user_yelping_since_year) where user_id from Elite;
SQL: SELECT CAST(SUM(T2.year_id - T1.user_yelping_since_year) AS REAL) / COUNT(T1.user_id) FROM Users AS T1 INNER JOIN Elite AS T2 ON T1.user_id = T2.user_id

Database: legislator
Question: What is the current official Youtube username of Chris Van Hollen?
Evidence: Youtube username refers to youtube; Chris Van Hollen is an official_full_name
SQL: SELECT T2.youtube FROM current AS T1 INNER JOIN `social-media` AS T2 ON T2.bioguide = T1.bioguide_id WHERE T1.official_full_name = 'Chris Van Hollen'

Database: regional_sales
Question: What is the average unit price of a Cookware product?
Evidence: AVG(Unit Price where Product Name = 'Cookware');
SQL: SELECT AVG(REPLACE(T1.`Unit Price`, ',', '')) FROM `Sales Orders` AS T1 INNER JOIN Products AS T2 ON T2.ProductID = T1._ProductID WHERE T2.`Product Name` = 'Cookware'

Database: video_games
Question: Calculate how many percent of sales in North America is higher than the average sale per region for platform ID 9577.
Evidence: in North America refers to region_name = 'North America'; platform ID 9577 refers to game_platform_id = 9577; percent = divide(subtract(num_sales where region_name = 'North America' and game_platform_id = 9577, avg(num_sales)), avg(num_sales)) * 100%
SQL: SELECT (SUM(CASE WHEN T2.region_name = 'North America' THEN T1.num_sales ELSE 0 END) - AVG(T1.num_sales)) * 100.0 / AVG(T1.num_sales) FROM region_sales AS T1 INNER JOIN region AS T2 ON T1.region_id = T2.id WHERE T1.game_platform_id = 9577

Database: synthea
Question: When did Mrs. Ira Deckow have the standard pregnancy test?
Evidence: standard pregnancy test refers to DESCRIPTION = 'Standard pregnancy test' from procedures;
SQL: SELECT T2.date FROM patients AS T1 INNER JOIN procedures AS T2 ON T1.patient = T2.PATIENT WHERE T1.prefix = 'Mrs.' AND T1.first = 'Ira' AND T1.last = 'Deckow' AND T2.description = 'Standard pregnancy test'

Database: book_publishing_company
Question: Name the Chief Executive Officer and when he/she was hired.
Evidence: Chief Financial Offer is a job description which refers to job_desc
SQL: SELECT T1.fname, T1.lname, T1.hire_date FROM employee AS T1 INNER JOIN jobs AS T2 ON T1.job_id = T2.job_id WHERE T2.job_desc = 'Chief Financial Officier'

Database: professional_basketball
Question: How many games did team of the scoring champion win in 2001 NBA season?
Evidence: the scoring champion refers to max(won); 2001 refers to year = 2001; NBA refers to lgID = 'NBA'
SQL: SELECT T2.W FROM teams AS T1 INNER JOIN series_post AS T2 ON T1.tmID = T2.tmIDLoser AND T1.year = T2.year WHERE T2.year = 2001 ORDER BY T1.o_fgm DESC LIMIT 1

Database: shooting
Question: Who are the officers involved in cases that are voted as 'No Bill'. List their last name and gender.
Evidence: voted as 'No Bill' refers to grand_jury_disposition = 'No Bill'
SQL: SELECT T2.last_name, T2.gender FROM incidents AS T1 INNER JOIN officers AS T2 ON T1.case_number = T2.case_number WHERE T1.grand_jury_disposition = 'No Bill'

Database: books
Question: How many customers ordered the oldest book?
Evidence: oldest book refers to Min(publiation_date)
SQL: SELECT COUNT(*) FROM book AS T1 INNER JOIN order_line AS T2 ON T1.book_id = T2.book_id GROUP BY T1.publication_date ORDER BY T1.publication_date ASC LIMIT 1

Database: legislator
Question: Provide the google entity ID of the senators in New York.
Evidence: google entity ID refers to google_entity_id_id; senators refers to type = 'sen'; New York refers to state = 'NY';
SQL: SELECT T1.google_entity_id_id FROM historical AS T1 INNER JOIN `historical-terms` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T2.type = 'sen' AND T2.state = 'NY'

Database: university
Question: How many students were there in university ID 1 in 2011?
Evidence: in 2011 refers to year 2011;
SQL: SELECT num_students FROM university_year WHERE year = 2011 AND university_id = 1

Database: music_tracker
Question: Provide the title, release year and the tag associated with the live album that has the highest number of downloads?
Evidence: release year refers to groupYear; title of live album refers to groupName where releaseType = 'live album'; the highest number of downloads refers to MAX(totalSnatched);
SQL: SELECT T1.groupName, T1.groupYear, T2.tag FROM torrents AS T1 INNER JOIN tags AS T2 ON T1.id = T2.id WHERE T1.releaseType = 'live album' ORDER BY T1.totalSnatched DESC LIMIT 1

Database: retail_complains
Question: Which is the city where most of the 1 star reviews come from?
Evidence: most refers to max(count(state_abbrev)); 1 star review refers to Stars = 1
SQL: SELECT T2.city FROM reviews AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id WHERE T1.Stars = 1 GROUP BY T2.city ORDER BY COUNT(T2.city) DESC LIMIT 1

Database: student_loan
Question: State name of female students who filed for bankruptcy.
Evidence: female students refers to filed_for_bankrupcy.name who are NOT in male.name;
SQL: SELECT T1.name FROM person AS T1 INNER JOIN filed_for_bankrupcy AS T2 ON T1.name = T2.name LEFT JOIN male AS T3 ON T1.name = T3.name WHERE T3.name IS NULL

Database: books
Question: Provide the publisher name of the book with ISBN 76092025986.
Evidence: "76092025986" is the isbn13
SQL: SELECT T2.publisher_name FROM book AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.publisher_id WHERE T1.isbn13 = 76092025986

Database: social_media
Question: State the number of positive tweets from Ha Noi.
Evidence: positive tweet refers to Sentiment > 0; 'Ha Noi' is the State
SQL: SELECT COUNT(T1.TweetID) FROM twitter AS T1 INNER JOIN location AS T2 ON T2.LocationID = T1.LocationID WHERE T1.Sentiment > 0 AND T2.State = 'Ha Noi'