Database: movie_platform
Question: How many users, who were not a a trialist when they rated the movie, gave the movie "The South" a rating score of not more than 2?
Evidence: not a trialist refer to user_trialist = 0; rating score of not more than 2 refer to rating_score <2; The South refers to movie_title

SQL: SELECT COUNT(T2.user_id) FROM movies AS T1 INNER JOIN ratings AS T2 ON T1.movie_id = T2.movie_id WHERE T2.user_trialist = 0 AND T2.rating_score <= 2 AND T1.movie_title = 'The South'

Database: shakespeare
Question: What is the title of the first ever work of William Shakespeare?
Evidence: first ever work refers to min(Date)
SQL: SELECT Title FROM works WHERE Date = ( SELECT MIN(Date) FROM works )

Database: student_loan
Question: Give the number of students who have payment due.
Evidence: who have payment due refers to bool = 'pos';
SQL: SELECT COUNT(name) FROM no_payment_due WHERE bool = 'pos'

Database: public_review_platform
Question: How many businesses with music_karaoke attribute are closed?
Evidence: music_karaoke attribute refers to attribute_name = 'music_karaoke' AND attribute_value = 'true'; businesses are closed refers to active = 'false'
SQL: SELECT COUNT(T2.business_id) FROM Attributes AS T1 INNER JOIN Business_Attributes AS T2 ON T1.attribute_id = T2.attribute_id INNER JOIN Business AS T3 ON T2.business_id = T3.business_id WHERE T1.attribute_name = 'music_karaoke' AND T3.active = 'false' AND T2.attribute_value IN ('none', 'no', 'false')

Database: student_loan
Question: How many disabled students have never been absent from school?
Evidence: never been absent from school refers to month = 0
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` = 0

Database: car_retails
Question: Where's Foon Yue Tseng's office located at? Give the detailed address.
Evidence: Detailed address comprises addressLine1 and addressLine2;
SQL: SELECT T1.addressLine1, T1.addressLine2 FROM offices AS T1 INNER JOIN employees AS T2 ON T1.officeCode = T2.officeCode WHERE T2.firstName = 'Foon Yue' AND T2.lastName = 'Tseng'

Database: synthea
Question: Among the male patients, who has the earliest starting date of the care plan?
Evidence: male patients refers to gender = 'M'; earliest starting date of the care plan refers to MIN(careplans.START);
SQL: SELECT T2.first, T2.last FROM careplans AS T1 INNER JOIN patients AS T2 ON T1.PATIENT = T2.patient WHERE T2.gender = 'M' ORDER BY T1.START LIMIT 1

Database: sales
Question: What is the best selling colour for HL Mountain Frame, 42?
Evidence: best selling colour refers to name of product with higher total sales; SUM(SalesID WHERE Name = 'HL Mountain Frame - Silver, 42') > SUM(Name = 'HL Mountain Frame - Black, 42') means Silver is the best selling colour, otherwise Black is the best seling colour;
SQL: SELECT IIF(SUM(IIF(T1.Name = 'HL Mountain Frame - Silver, 42', T2.SalesID, 0)) - SUM(IIF(T1.Name = 'HL Mountain Frame - Black, 42', T2.SalesID, 0)) > 0, 'Silver', 'Black') FROM Products AS T1 INNER JOIN Sales AS T2 ON T1.ProductID = T2.ProductID

Database: sales
Question: Calculate the total quantity of products purchased by customer called Adrian.
SQL: SELECT SUM(T2.Quantity) FROM Customers AS T1 INNER JOIN Sales AS T2 ON T1.CustomerID = T2.CustomerID WHERE T1.FirstName = 'Adam'

Database: ice_hockey_draft
Question: Calculate the percentage of penalty minutes of Swedish players in OHL league among all players.
Evidence: percentage = MULTIPLY(DIVIDE(SUM(PIM WHERE nation = 'Sweden'), COUNT(ELITEID) WHERE LEAGUE = 'OHL'), 100); Swedish refers to nation = 'Sweden'; players refers to PlayerName; OHL league refers to LEAGUE = 'OHL';
SQL: SELECT CAST(COUNT(CASE WHEN T1.nation = 'Sweden' THEN T2.PIM ELSE NULL END) AS REAL) * 100 / COUNT(*) FROM PlayerInfo AS T1 INNER JOIN SeasonStatus AS T2 ON T1.ELITEID = T2.ELITEID WHERE T2.LEAGUE = 'OHL'

Database: car_retails
Question: What's the postal code of the office the VP Sales is at?
Evidence: VP Sales refers to jobTitle
SQL: SELECT t2.postalCode FROM employees AS t1 INNER JOIN offices AS t2 ON t1.officeCode = t2.officeCode WHERE t1.jobTitle = 'VP Sales'

Database: superstore
Question: What is the percentage of furniture orders that were shipped through first class in 2013 at the Central superstore?
Evidence: furniture refers to Category = 'Furniture'; shipped through first class in 2013 refers to ship mode = 'first class' and "Ship Date" = '2013%'; percentage = divide(sum(Order ID) when Category = 'Furniture' and "Ship Date" = '2013%', sum(Order ID)) as percentage
SQL: SELECT CAST(SUM(CASE  WHEN T1.`Ship Mode` = 'First Class' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM central_superstore AS T1 INNER JOIN product AS T2 ON T1.`Product ID` = T2.`Product ID` WHERE T2.Category = 'Furniture' AND STRFTIME('%Y', T1.`Ship Date`) = '2013'

Database: world
Question: Among the countries that officially use the English language, what country has the highest capital?
Evidence: officially use the English language refers to `Language` = 'English' AND IsOfficial = 'T'; highest capital refers to MAX(Capital);
SQL: SELECT T1.Code FROM Country AS T1 INNER JOIN CountryLanguage AS T2 ON T1.Code = T2.CountryCode WHERE T2.Language = 'English' AND T2.IsOfficial = 'T' ORDER BY T1.Capital DESC LIMIT 1

Database: menu
Question: List down the name of dishes that were positioned on the left upper corner.
Evidence: positioned on the left upper corner refers to xpos < 0.25 AND ypos < 0.25;
SQL: SELECT T1.name FROM Dish AS T1 INNER JOIN MenuItem AS T2 ON T1.id = T2.dish_id WHERE T2.xpos < 0.25 AND T2.ypos < 0.25

Database: cs_semester
Question: List the course's name where students acquired a grade of D.
SQL: SELECT T1.name FROM course AS T1 INNER JOIN registration AS T2 ON T1.course_id = T2.course_id WHERE T2.grade = 'D'

Database: movie_3
Question: Find and list the full name of customers who rented more than five types of movies.
Evidence: full name refers to first_name, last_name; types of movies means category of movies; 
rented more than five types of movies refers to COUNT(film_category) > 5
SQL: SELECT T.first_name, T.last_name FROM ( SELECT T1.first_name, T1.last_name, COUNT(T1.customer_id) AS num FROM customer AS T1 INNER JOIN rental AS T2 ON T1.customer_id = T2.customer_id INNER JOIN inventory AS T3 ON T2.inventory_id = T3.inventory_id INNER JOIN film AS T4 ON T3.film_id = T4.film_id INNER JOIN film_category AS T5 ON T4.film_id = T5.film_id GROUP BY T1.first_name, T1.last_name ) AS T WHERE T.num > 5

Database: software_company
Question: In male customers ages from 30 to 50, how many of them has an income ranges from 2000 to 2300?
Evidence: male customers ages from 30 to 50 refer to SEX = 'Male' where age BETWEEN 30 AND 50; income ranges from 2000 to 2300 refers to INCOME_K BETWEEN 2000 AND 3000;
SQL: SELECT COUNT(T1.ID) FROM Customers AS T1 INNER JOIN Demog AS T2 ON T1.GEOID = T2.GEOID WHERE T1.SEX = 'Male' AND T1.age >= 30 AND T1.age <= 50 AND T2.INCOME_K >= 2000 AND T2.INCOME_K <= 2300

Database: retail_complains
Question: Calculate the difference in the average age of elderly and middle-aged clients in the Northeast region.
Evidence: difference in the average = SUBTRACT(AVG(age BETWEEN 35 AND 55), AVG( age > 65)); elderly refers to age > 65; middle-aged refers to age BETWEEN 35 AND 55;
SQL: SELECT (CAST(SUM(CASE WHEN T1.age BETWEEN 35 AND 55 THEN T1.age ELSE 0 END) AS REAL) / SUM(CASE WHEN T1.age BETWEEN 35 AND 55 THEN 1 ELSE 0 END)) - (CAST(SUM(CASE WHEN T1.age > 65 THEN T1.age ELSE 0 END) AS REAL) / SUM(CASE WHEN T1.age > 65 THEN 1 ELSE 0 END)) AS difference FROM client AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id INNER JOIN state AS T3 ON T2.state_abbrev = T3.StateCode WHERE T3.Region = 'Northeast'