Database: movie_platform
Question: Which year was the third movie directed by Quentin Tarantino released? Indicate the user ids of the user who gave it a rating score of 4.
Evidence: third movie refers to third movie that has oldest movie_release_year;
SQL: SELECT T2.movie_release_year, T1.user_id FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T1.movie_id = ( SELECT movie_id FROM movies WHERE director_name = 'Quentin Tarantino' ORDER BY movie_release_year ASC LIMIT 2, 1 ) AND T1.rating_score = 4

Database: talkingdata
Question: What is the ratio of male and female users in 27-28 age group?
Evidence: ratio = DIVIDE(COUNT(device_id WHERE gender = 'M' AND `group` = 'M27-28'), COUNT(device_id WHERE gender = 'F' AND `group` = 'F27-28')); 27-28 age group refers to `group` = 'F27-28';
SQL: SELECT SUM(IIF(gender = 'M' AND `group` = 'M27-28', 1, 0)) / SUM(IIF(gender = 'F' AND `group` = 'F27-28', 1, 0)) AS r FROM gender_age

Database: citeseer
Question: Among the papers under DB classification, which paper has the highest number of words cited?
Evidence: classification refers to class_label; class_label = 'DB';
SQL: SELECT T1.paper_id FROM paper AS T1 INNER JOIN content AS T2 ON T1.paper_id = T2.paper_id WHERE T1.class_label = 'DB' GROUP BY T1.paper_id ORDER BY COUNT(T2.word_cited_id) DESC LIMIT 1

Database: video_games
Question: In what platform does the game ID 178 available?
Evidence: platform refers to platform_name;
SQL: SELECT T3.platform_name FROM game_publisher AS T1 INNER JOIN game_platform AS T2 ON T1.id = T2.game_publisher_id INNER JOIN platform AS T3 ON T2.platform_id = T3.id WHERE T1.game_id = 178

Database: regional_sales
Question: State the order number where Qualitest ordered the highest product quantity.
Evidence: Qualitest ordered the highest product quantity refers to Customer Names where MAX(Order Quantity);
SQL: SELECT T1.OrderNumber FROM `Sales Orders` AS T1 INNER JOIN Customers AS T2 ON T2.CustomerID = T1._CustomerID WHERE T2.`Customer Names` = 'Qualitest ' ORDER BY T1.`Order Quantity` DESC LIMIT 1

Database: retail_complains
Question: In 2015, how many complaints about Billing disputes were sent by clients in Portland?
Evidence: in 2015 refers to Date received LIKE'2015%'; about Billing disputes refers to Issue = 'Billing disputes'; Portland refers to city = 'Portland'
SQL: SELECT COUNT(T1.client_id) FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T1.city = 'Portland' AND T2.`Date received` LIKE '2015%' AND T2.Issue = 'Billing disputes'

Database: retails
Question: Calculate the difference in the average retail price of parts shipped via ship and air.
Evidence: SUBTRACT(DIVIDE(SUM(p_retailprice where l_shipmode = 'SHIP'), COUNT(l_shipmode = 'SHIP')), DIVIDE(SUM(p_retailprice where l_shipmode = 'AIR'), COUNT(l_shipmode = 'AIR')));
SQL: SELECT (CAST(SUM(IIF(T3.l_shipmode = 'SHIP', T1.p_retailprice, 0)) AS REAL) / SUM(IIF(T3.l_shipmode = 'SHIP', 1, 0))) - (CAST(SUM(IIF(T3.l_shipmode = 'AIR', T1.p_retailprice, 0)) AS REAL) / SUM(IIF(T3.l_shipmode = 'AIR', 1, 0))) FROM part AS T1 INNER JOIN partsupp AS T2 ON T1.p_partkey = T2.ps_partkey INNER JOIN lineitem AS T3 ON T2.ps_suppkey = T3.l_suppkey

Database: world
Question: List down the country names of countries that have a GNP lower than 1000 and have Dutch as their language.
Evidence: GNP lower than 1000 refers to GNP < 1000; Dutch as their language refers to `Language` = 'Dutch';
SQL: SELECT T2.Name FROM CountryLanguage AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.Code WHERE T2.GNP < 1000 AND T1.IsOfficial = 'T' AND T1.Language = 'Dutch'

Database: movie_3
Question: Which movie title has the lowest movie rental in the horror category?
Evidence: the lowest movie rental refers to min(rental_rate); the horror category refers to category.name = 'Horror'
SQL: SELECT T1.title FROM film AS T1 INNER JOIN film_category AS T2 ON T1.film_id = T2.film_id INNER JOIN category AS T3 ON T2.category_id = T3.category_id WHERE T3.`name` = 'Horror' ORDER BY T1.rental_rate LIMIT 1

Database: cars
Question: What is the average weight of Japanese cars with 4 cylinders that were produced from 1975 to 1980?
Evidence: Japanese car refers to country = 'Japan'; with 4 cylinders refers to cylinders = 4; produced from 1975 to 1980 refers to model_year BETWEEN 1975 AND 1980; average weight = avg(weight)
SQL: SELECT AVG(T1.weight) FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID INNER JOIN country AS T3 ON T3.origin = T2.country WHERE T2.model_year BETWEEN 1975 AND 1980 AND T1.cylinders = 4 AND T3.country = 'Japan'

Database: human_resources
Question: What is the average salary of the employees who work as a Trainee?
Evidence: average = DIVIDE( SUM(salary), COUNT(positiontitle) where positiontitle = 'Trainee'; Trainee is a position title
SQL: SELECT AVG(CAST(REPLACE(SUBSTR(T1.salary, 4), ',', '') AS REAL)) AS avg FROM employee AS T1  INNER JOIN position AS T2  ON T1.positionID = T2.positionID WHERE T2.positiontitle = 'Trainee'

Database: movie_3
Question: State the number of films that are 178 minutes long.
Evidence: 178 min long refers to length = '178'
SQL: SELECT COUNT(film_id) FROM film WHERE length = '178'

Database: donor
Question: Among the projects created by a teacher from New York, how many of them have a donor from the same city?
Evidence: New York is the donor city; donor from the same city refers to donor from New York in which teacher_ny_teaching_fellow = 't';
SQL: SELECT COUNT(T1.projectid) FROM projects AS T1 INNER JOIN donations AS T2 ON T1.projectid = T2.projectid WHERE T1.teacher_ny_teaching_fellow = 't' AND T2.donor_city = 'New York'

Database: student_loan
Question: Which students have absents the most?
Evidence: absents the most refers to MAX(month)
SQL: SELECT name FROM longest_absense_from_school WHERE month = ( SELECT MAX(month) FROM longest_absense_from_school )

Database: synthea
Question: What is the care plan description of the prevalent disease with the highest prevalence percentage?
Evidence: highest prevalence percentage refers to MAX(PREVALENCE PERCENTAGE);
SQL: SELECT T4.DESCRIPTION FROM all_prevalences AS T1 INNER JOIN conditions AS T2 ON T2.DESCRIPTION = T1.ITEM INNER JOIN encounters AS T3 ON T2.ENCOUNTER = T3.ID INNER JOIN careplans AS T4 ON T4.ENCOUNTER = T3.ID ORDER BY T1."PREVALENCE PERCENTAGE" DESC LIMIT 1

Database: cs_semester
Question: How many students took the hardest course?
Evidence: diff refers to difficulty; diff is higher means the course is more difficult in which hardest difficulty is expressed as diff = 5;
SQL: SELECT COUNT(T1.student_id) FROM registration AS T1 INNER JOIN course AS T2 ON T1.course_id = T2.course_id WHERE T2.diff = 5

Database: chicago_crime
Question: List the location descriptions and aldermen's full names of the arson by explosive.
Evidence: aldermen's full name refers to alderman_name_suffix, alderman_first_name, alderman_last_name; arson by explosive refers to primary_description = 'ARSON' AND secondary_description = 'BY EXPLOSIVE'
SQL: SELECT T2.location_description, T1.alderman_first_name, T1.alderman_last_name, T1.alderman_name_suffix FROM Ward AS T1 INNER JOIN Crime AS T2 ON T2.ward_no = T1.ward_no INNER JOIN IUCR AS T3 ON T3.iucr_no = T2.iucr_no WHERE T3.primary_description = 'ARSON' AND T3.secondary_description = 'BY EXPLOSIVE'

Database: movielens
Question: What is the favourite movie genre for audiences of age 18?
Evidence: The audience and users are the same meaning
SQL: SELECT T1.genre FROM movies2directors AS T1 INNER JOIN u2base AS T2 ON T1.movieid = T2.movieid INNER JOIN users AS T3 ON T2.userid = T3.userid WHERE T3.age = 18 GROUP BY T1.genre ORDER BY COUNT(T1.movieid) DESC LIMIT 1