Database: simpson_episodes
Question: In "Sex, Pies and Idiot Scrapes", how many percentage of votes did the 9 star score has?
Evidence: "Sex, Pies and Idiot Scrapes" is the title of episode; 9 star score refers to stars = 9; percentage refers to percent
SQL: SELECT T2.percent FROM Episode AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE T1.title = 'Sex, Pies and Idiot Scrapes' AND T2.stars = 9;

Database: cars
Question: Calculate the difference between the number of cars that has a horsepower of 130 with the model year 1970 and model year 1976
Evidence: a horsepower of 130 refers to horsepower = 130; difference = subtract(count(ID where model_year = 1970), count(ID where model_year = 1976)) where horsepower = 130
SQL: SELECT SUM(CASE WHEN T2.model_year = 1970 THEN 1 ELSE 0 END) - SUM(CASE WHEN T2.model_year = 1976 THEN 1 ELSE 0 END) FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID WHERE T1.horsepower = 130

Database: public_review_platform
Question: What is the average number of review received by each business given that the user is an elite?
Evidence: average review = Divide(Count(user_id), Count(business_id))
SQL: SELECT CAST(COUNT(T1.user_id) AS REAL) / COUNT(DISTINCT T1.business_id) FROM Reviews AS T1 INNER JOIN Elite AS T2 ON T1.user_id = T2.user_id

Database: movie_3
Question: How many films did a customer named Francis Sikes rent?
Evidence: 'Francis Sikes' is a full name of a customer; full name refers to first_name, last_name;
SQL: SELECT COUNT(T1.customer_id) FROM customer AS T1 INNER JOIN rental AS T2 ON T1.customer_id = T2.customer_id WHERE T1.first_name = 'FRANCIS' AND T1.last_name = 'SIKES'

Database: regional_sales
Question: List by ID all sales teams that have sold products at a 10% discount in store.
Evidence: ID refers to _SalesTeamID; 10% discount refers to Discount Applied = 0.1; 'In-Store' is the Sales Channel
SQL: SELECT DISTINCT T FROM ( SELECT CASE  WHEN `Discount Applied` = '0.1' AND `Sales Channel` = 'In-Store' THEN _SalesTeamID ELSE NULL END AS T FROM `Sales Orders` ) WHERE T IS NOT NULL

Database: public_review_platform
Question: What is the closing time of business id 4 on Sunday?
Evidence: on Sunday refers to day_of_week = 'Sunday'
SQL: SELECT T2.closing_time FROM Days AS T1 INNER JOIN Business_Hours AS T2 ON T1.day_id = T2.day_id WHERE T1.day_of_week = 'Sunday' AND T2.business_id = 4

Database: movie_platform
Question: What's the percentage of the users who have rated "1" on the movie "When Will I Be Loved"?
Evidence: When Will I Be Loved' is movie_title; rated 1 refers to rating_score = 1; percentage = Divide(Count(rating_id where rating_score = 1),Count(rating_id)) *100;
SQL: SELECT CAST(SUM(CASE WHEN T1.rating_score = 1 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T2.movie_title = 'When Will I Be Loved'

Database: legislator
Question: What is the username of the current official Facebook presence of current legislator Todd Young?
Evidence: Todd Young is an official_full_name; username of current official Facebook presences refers to facebook;
SQL: SELECT T1.facebook FROM `social-media` AS T1 INNER JOIN current AS T2 ON T2.bioguide_id = T1.bioguide WHERE T2.official_full_name = 'Todd Young'

Database: soccer_2016
Question: Who is the youngest player and which city did he/she come from?
Evidence: youngest player refers to MIN(DOB); city refers to City_Name
SQL: SELECT T3.City_Name FROM Player AS T1 INNER JOIN Country AS T2 ON T1.Country_Name = T2.Country_Id INNER JOIN City AS T3 ON T2.Country_Id = T3.Country_Id ORDER BY T1.DOB LIMIT 1

Database: mental_health_survey
Question: What is the average result of the question "What is your age?" in 2014's survey?
Evidence: average result refers to avg(AnswerText(SurveyID = 2014& QuestionID = 1))
SQL: SELECT CAST(SUM(T2.AnswerText) AS REAL) / COUNT(T2.UserID) AS "avg" FROM Question AS T1 INNER JOIN Answer AS T2 ON T1.questionid = T2.QuestionID WHERE T2.SurveyID = 2014 AND T1.questiontext LIKE 'What is your age?'

Database: menu
Question: What is the highest price of dishes with menu item ID 1 to 5?
Evidence: highest price refers to MAX(price); menu item ID 1 to 5 refers to MenuItem.id BETWEEN 1 AND 5;
SQL: SELECT T2.price FROM Dish AS T1 INNER JOIN MenuItem AS T2 ON T1.id = T2.dish_id WHERE T2.id BETWEEN 1 AND 5 ORDER BY T2.price DESC LIMIT 1

Database: image_and_language
Question: Write 10 coordinates with the object class "pizza."
Evidence: coordinates for the object refer to X, Y, W and H coordinates of the bounding box; object class "pizza" refers to OBJ_CLASS = 'pizza';
SQL: SELECT T1.IMG_ID, T1.X, T1.Y FROM IMG_OBJ AS T1 INNER JOIN OBJ_CLASSES AS T2 ON T1.OBJ_CLASS_ID = T2.OBJ_CLASS_ID WHERE T2.OBJ_CLASS = 'pizza' LIMIT 10

Database: professional_basketball
Question: List the full name of players who are born outside USA.
Evidence: full name refers to firstName, middleName, lastName; born outside USA refers to birthCountry ! = 'USA'
SQL: SELECT firstName, middleName, lastName FROM players WHERE birthCountry != 'USA'

Database: retail_world
Question: What is the full name of the employee who handled the highest amount of orders?
Evidence: full name refers to FirstName LastName; highest amount of orders refers to max(count(OrderID))
SQL: SELECT T1.FirstName, T1.LastName FROM Employees AS T1 INNER JOIN Orders AS T2 ON T1.EmployeeID = T2.EmployeeID GROUP BY T1.FirstName, T1.LastName ORDER BY COUNT(*) DESC LIMIT 1

Database: human_resources
Question: Please list the zip codes of the offices where all the male employees with a good job performance work at.
Evidence: male employees refers to gender = 'M'; good job performance refers to performance = 'Good'
SQL: SELECT T2.zipcode FROM employee AS T1  INNER JOIN location AS T2  ON T1.locationID = T2.locationID WHERE T1.gender = 'M' AND T1.performance = 'Good'

Database: books
Question: How many orders have been cancelled in 2022?
Evidence: cancelled refers to status_value = 'Cancelled'; in 2022 refers to SUBSTR(status_date, 1, 4) = '2022'
SQL: SELECT COUNT(*) FROM order_status AS T1 INNER JOIN order_history AS T2 ON T1.status_id = T2.status_id WHERE T1.status_value = 'Cancelled' AND STRFTIME('%Y', T2.status_date) = '2022'

Database: authors
Question: What percentage of papers were preprinted after the year 2000?
Evidence: after the year 2000 refers to Year > 2000; preprinted refers to ConferenceId = 0 AND JournalId = 0; percentage refers to DIVIDE(COUNT(ConferenceId = 0 AND JournalId = 0 AND Year > 2000), COUNT(Id))
SQL: SELECT CAST(SUM(CASE WHEN Year > 2000 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(Id) FROM Paper

Database: retail_world
Question: What is the family name of the employee who shipped the order 10521 to CACTU?
Evidence: order 10521 refers to OrderID = 10521; CustomerID = 'CACTU'; family name refers to LastName;
SQL: SELECT T1.LastName FROM Employees AS T1 INNER JOIN Orders AS T2 ON T1.EmployeeID = T2.EmployeeID WHERE T2.OrderID = 10521 AND T2.CustomerID = 'CACTU'

Database: student_loan
Question: Mention the name of unemployed students who have never been absent from school.
Evidence: have never been absent from school refers to month = 0
SQL: SELECT T1.name FROM longest_absense_from_school AS T1 INNER JOIN unemployed AS T2 ON T1.name = T2.name WHERE T1.month = 0

Database: books
Question: What is the language of the book titled Zorro?
Evidence: "Zorro" is the title of the book; langauge refers to language_name
SQL: SELECT T2.language_name FROM book AS T1 INNER JOIN book_language AS T2 ON T1.language_id = T2.language_id WHERE T1.title = 'Zorro'

Database: talkingdata
Question: How many events have happened on device no.29182687948017100 in 2016?
Evidence: device no. refers to device_id; device_id = 29182687948017100; in 2016 refers to `timestamp` LIKE '2016%';
SQL: SELECT COUNT(event_id) FROM `events` WHERE SUBSTR(`timestamp`, 1, 4) = '2016' AND device_id = 29182687948017100