Database: student_loan
Question: What is the percentage difference between month 0 absence and month 9 absence?
Evidence: percentage difference = CONCAT(DIVIDE(MULTIPLY(SUBTRACT(COUNT(name WHERE month = 0), COUNT(name WHERE month = 9)), 100), COUNT(name WHERE month = 0)),'%');
SQL: SELECT CAST(((SUM(IIF(month = 0, 1, 0)) - SUM(IIF(month = 9, 1, 0)))) AS REAL) * 100 / SUM(IIF(month = 0, 1, 0)) FROM longest_absense_from_school

Database: disney
Question: Which director has made the most movies?
Evidence: the most movies refers to MAX(COUNT(name));
SQL: SELECT director, COUNT(name) FROM director GROUP BY director ORDER BY COUNT(name) DESC LIMIT 1

Database: video_games
Question: What are the platform IDs of records released in 2006?
Evidence: released in 1990 refers to release_year = 1990; 2000 refers to release_year = 2000;
SQL: SELECT DISTINCT T.platform_id FROM game_platform AS T WHERE T.release_year = 2006

Database: movie_3
Question: List the top 5 most-rented films.
Evidence: film refers to title; most rented refers to MAX(inventory_id)
SQL: SELECT T.title FROM ( SELECT T3.title, COUNT(T2.inventory_id) AS num FROM rental AS T1 INNER JOIN inventory AS T2 ON T1.inventory_id = T2.inventory_id INNER JOIN film AS T3 ON T2.film_id = T3.film_id GROUP BY T3.title ) AS T ORDER BY T.num DESC LIMIT 5

Database: public_review_platform
Question: Please list the business IDs of the Yelp_Business that have a business time of longer than 12 hours on Sundays.
Evidence: business time of longer than 12 hours refers to subtract(closing_time, opening_time) > 12; on Sundays refers to day_of_week = 'Sunday'
SQL: SELECT T1.business_id FROM Business_Hours AS T1 INNER JOIN Days AS T2 ON T1.day_id = T2.day_id INNER JOIN Business AS T3 ON T1.business_id = T3.business_id WHERE T1.closing_time + 12 - T1.opening_time > 12 AND T2.day_of_week LIKE 'Sunday' GROUP BY T1.business_id

Database: sales
Question: Please provide sales ID for products named Hex Nut with a price greater than 100.
Evidence: price greater than 100 refers to price > 100;
SQL: SELECT T2.SalesID FROM Products AS T1 INNER JOIN Sales AS T2 ON T1.ProductID = T2.ProductID WHERE T1.Name LIKE 'Hex Nut%' AND T1.Price > 100

Database: books
Question: How much time does it take to update the status of order "2398"?
Evidence: "2398" is the order_id; time =   Subtract(strftime('%Y', status_date), strftime('%Y', order_date)) AS "year" , Subtract(strftime('%m', status_date), strftime('%m', order_date)) AS "month", Subtract (strftime('%d', status_date), strftime('%d', order_date)) AS "day"
SQL: SELECT strftime('%J', T2.status_date) - strftime('%J', T1.order_date) FROM cust_order AS T1 INNER JOIN order_history AS T2 ON T1.order_id = T2.order_id WHERE T1.order_id = 2398

Database: language_corpus
Question: Please list the top three most frequently occurring words and their ids.
Evidence: most frequently occurring words refer to MAX(occurrences); id refers to wid;
SQL: SELECT word, wid FROM words ORDER BY occurrences DESC LIMIT 3

Database: retail_world
Question: What was the total amount of sales handled by Nancy Davolio in December 1996, excluding discounts?
Evidence: in December 1996 refers to year(OrderDate) = 1996 AND month(OrderDate) = 12; excluding discounts refers to Discount = 0; total amount of sales refers to MULTIPLY((UnitPrice, Quantity))
SQL: SELECT SUM(T3.UnitPrice * T3.Quantity) FROM Employees AS T1 INNER JOIN Orders AS T2 ON T1.EmployeeID = T2.EmployeeID INNER JOIN `Order Details` AS T3 ON T2.OrderID = T3.OrderID WHERE T1.FirstName = 'Nancy' AND T1.LastName = 'Davolio' AND T2.OrderDate LIKE '1996-12%' AND T3.Discount = 0

Database: shakespeare
Question: Who is the character that said "This is Illyria, lady."?
Evidence: character refers to CharName; "This is Illyria, lady." refers to PlainText = 'This is Illyria, lady.'
SQL: SELECT T1.CharName FROM characters AS T1 INNER JOIN paragraphs AS T2 ON T1.id = T2.character_id WHERE T2.PlainText = 'This is Illyria, lady.'

Database: public_review_platform
Question: Find out which hotel and travel business having the most review? Calculate the standard deviation of the review star for this business.
Evidence: "Hotel & Travel" is the category_name; most review refers to Max(Count(category_id)); Average star per user = Divide (Sum (review_stars), Count(user_id))
SQL: SELECT T2.category_id FROM Business_Categories AS T1 INNER JOIN Categories AS T2 ON T1.category_id = T2.category_id INNER JOIN Reviews AS T3 ON T3.business_id = T1.business_id WHERE T2.category_name = 'Hotels & Travel' GROUP BY T2.category_id ORDER BY COUNT(T2.category_id) DESC LIMIT 1

Database: shakespeare
Question: How many of the works of Shakespeare are Tragedy?
Evidence: Tragedy refers to GenreType = 'Tragedy'
SQL: SELECT COUNT(id) FROM works WHERE GenreType = 'Tragedy'

Database: chicago_crime
Question: List down the neighborhood areas of Douglas.
Evidence: neighborhood area refers to neighborhood_name; Douglas refers to community_area_name = 'Douglas'
SQL: SELECT T2.neighborhood_name FROM Community_Area AS T1 INNER JOIN Neighborhood AS T2 ON T2.community_area_no = T1.community_area_no WHERE T1.community_area_name = 'Douglas'

Database: language_corpus
Question: Which word has the most appearances in the Wikipedia page revision ID No. 28278070? Give the word ID.
Evidence: the most appearances refers to MAX(occurrences); revision ID No. 28278070 refers to revision = 28278070; word ID refers to wid
SQL: SELECT pid FROM pages_words WHERE pid = ( SELECT pid FROM pages WHERE revision = 28278070 ) ORDER BY occurrences DESC LIMIT 1

Database: talkingdata
Question: How many devices belong to model "A51"?
Evidence: model refers to device_model; device_model = 'A51';
SQL: SELECT COUNT(device_id) FROM phone_brand_device_model2 WHERE device_model = 'A51'

Database: trains
Question: Please list the directions in which the trains with at least one empty-loaded car run.
Evidence: at least one empty-loaded car run refers to load_num = 0
SQL: SELECT T2.direction FROM cars AS T1 INNER JOIN trains AS T2 ON T1.train_id = T2.id WHERE T1.load_num = 0

Database: movielens
Question: What is the most popular genre of film directed by directors?
Evidence: Most popular genre indicates that the genre has the most number of movies
SQL: SELECT genre FROM movies2directors GROUP BY genre ORDER BY COUNT(movieid) DESC LIMIT 1

Database: movie_3
Question: How many films are categorized as horror?
Evidence: "Horror" is the name of category
SQL: SELECT COUNT(T1.film_id) FROM film_category AS T1 INNER JOIN category AS T2 ON T1.category_id = T2.category_id WHERE T2.name = 'Horror'

Database: sales_in_weather
Question: What percentage was the total unit sales of store no.10 to the total sales of its weather station on 2014/10/31?
Evidence: store no.10 refers to store_nbr = 10; on 2014/10/31 refers to date = '2014-10-31'; percentage = Divide (Sum(units where store_nbr = 10), Sum(units)) * 100
SQL: SELECT CAST(SUM(CASE WHEN T2.store_nbr = 10 THEN units * 1 ELSE 0 END) AS REAL) * 100 / SUM(units) FROM sales_in_weather AS T1 INNER JOIN relation AS T2 ON T1.store_nbr = T2.store_nbr WHERE T1.`date` = '2014-10-31'

Database: authors
Question: State the name and affiliation of author for the 'Education, democracy and growth' paper?
Evidence: Education, democracy and growth' refer to title of paper

SQL: SELECT T2.Name, T2.Affiliation FROM Paper AS T1 INNER JOIN PaperAuthor AS T2 ON T1.Id = T2.PaperId WHERE T1.Title = 'Education, democracy and growth'

Database: trains
Question: Which direction does the majority of the trains that have 3 cars are running?
Evidence: 3 cars refers to carsNum = 3
SQL: SELECT T1.direction FROM trains AS T1 INNER JOIN ( SELECT train_id, COUNT(id) AS carsNum FROM cars GROUP BY train_id HAVING carsNum = 3 ) AS T2 ON T1.id = T2.train_id GROUP BY T1.direction