Database: movies_4
Question: Calculate the average budget of the movies directed by Jaume Collet-Serra.
Evidence: directed by refers to job = 'Director'; average budget = AVG(budget)
SQL: SELECT CAST(SUM(T1.budget) AS REAL) / COUNT(T1.movie_id) FROM movie AS T1 INNER JOIN movie_crew AS T2 ON T1.movie_id = T2.movie_id INNER JOIN person AS T3 ON T2.person_id = T3.person_id WHERE T3.person_name = 'Jaume Collet-Serra' AND T2.job = 'Director'

Database: student_loan
Question: How many months did a student in the Air Force miss school the most?
Evidence: Air Force refers to organ = 'air_force'; number of months a student miss school the most refers to MAX(COUNT(month));
SQL: SELECT T1.month FROM longest_absense_from_school AS T1 INNER JOIN enlist AS T2 ON T1.name = T2.name ORDER BY T1.month DESC LIMIT 1

Database: video_games
Question: Which is the publisher for the game "Prism: Light the Way"?
Evidence: publisher refers to publisher_name; game "Prism: Light the Way" refers to game_name = 'Prism: Light the Way'
SQL: SELECT T1.publisher_name FROM publisher AS T1 INNER JOIN game_publisher AS T2 ON T1.id = T2.publisher_id INNER JOIN game AS T3 ON T2.game_id = T3.id WHERE T3.game_name = 'Prism: Light the Way'

Database: retail_complains
Question: List by their ID number the 3 longest complaints.
Evidence: ID number refers to "Complaint ID"; longest complaints refers to MAX(ser_time);
SQL: SELECT `Complaint ID` FROM callcenterlogs ORDER BY ser_time DESC LIMIT 3

Database: movies_4
Question: What was David Rubin's job in the movie "Days of Thunder"?
Evidence: "Days of Thunder" refers to title = 'Days of Thunder'
SQL: SELECT T2.job FROM movie AS T1 INNER JOIN movie_crew AS T2 ON T1.movie_id = T2.movie_id INNER JOIN person AS T3 ON T2.person_id = T3.person_id WHERE T3.person_name = 'David Rubin' AND T1.title = 'Days of Thunder'

Database: airline
Question: Among the flights on 2018/8/1, how many of them were scheduled to depart from John F. Kennedy International in New York?
Evidence: on 2018/8/1 refers to FL_DATE = '2018/8/1'; depart from refers to ORIGIN; John F. Kennedy International in New York refers to Description = 'New York, NY: John F. Kennedy International';
SQL: SELECT COUNT(T1.Code) FROM Airports AS T1 INNER JOIN Airlines AS T2 ON T1.Code = T2.ORIGIN WHERE T2.FL_DATE = '2018/8/1' AND T1.Description = 'New York, NY: John F. Kennedy International'

Database: retail_world
Question: What is the category of the product that has the highest number of discontinued products?
Evidence: discontinued products refers to Discontinued = 1; highest number of discontinued products refers to MAX(Discontinued = 1)
SQL: SELECT T2.CategoryName FROM Products AS T1 INNER JOIN Categories AS T2 ON T1.CategoryID = T2.CategoryID WHERE T1.Discontinued = 1 GROUP BY T2.CategoryName ORDER BY COUNT(T1.ProductID) DESC LIMIT 1

Database: olympics
Question: Calculate the percentage of women who have participated in Equestrianism Mixed Three-Day Event, Individual.
Evidence: DIVIDE(COUNT(person_id where gender = 'F), COUNT(person_id)) as percentage where event_name = 'Equestrianism Mixed Three-Day Event, Individual';
SQL: SELECT CAST(COUNT(CASE WHEN T1.gender = 'F' THEN 1 ELSE NULL END) AS REAL) * 100 / COUNT(T1.id) FROM person AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.person_id INNER JOIN competitor_event AS T3 ON T2.id = T3.competitor_id INNER JOIN event AS T4 ON T3.event_id = T4.id WHERE T4.event_name = 'Equestrianism Mixed Three-Day Event, Individual'

Database: food_inspection_2
Question: Calculate the average salary for employees who did inspection on License Re-Inspection.
Evidence: inspection on License Re-Inspection refers to inspection_type = 'License Re-Inspection'; average salary = avg(salary)
SQL: SELECT AVG(T2.salary) FROM inspection AS T1 INNER JOIN employee AS T2 ON T1.employee_id = T2.employee_id WHERE T1.inspection_type = 'License Re-Inspection'

Database: movie_platform
Question: How many users were trialists when they rated the movie "A Way of Life"?
Evidence: A Way of Life' refers to movie_title; the user was a trialist when he rated the movie refers to user_trialist = 1;
SQL: SELECT COUNT(T1.user_id) 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' AND T1.user_trialist = 1

Database: retail_world
Question: Provide the contact person name, title and supplied products by "Escargots Nouveaux" company.
Evidence: "Escargots Nouveaux" company refers to CompanyName = 'Escargots Nouveaux';
SQL: SELECT T2.ContactName, T2.ContactTitle, T1.ProductName FROM Products AS T1 INNER JOIN Suppliers AS T2 ON T1.SupplierID = T2.SupplierID WHERE T2.CompanyName = 'Escargots Nouveaux'

Database: video_games
Question: Which publisher has published the game 'Pachi-Slot Kanzen Kouryaku 3: Universal Koushiki Gaido Volume 3'?
Evidence: which publisher refers to publisher_name; 'Pachi-Slot Kanzen Kouryaku 3: Universal Koushiki Gaido Volume 3' refers to game_name = 'Pachi-Slot Kanzen Kouryaku 3: Universal Koushiki Gaido Volume 3';
SQL: SELECT T1.publisher_name FROM publisher AS T1 INNER JOIN game_publisher AS T2 ON T1.id = T2.publisher_id INNER JOIN game AS T3 ON T2.game_id = T3.id WHERE T3.game_name = 'Pachi-Slot Kanzen Kouryaku 3: Universal Koushiki Gaido Volume 3'

Database: image_and_language
Question: How many images have at least 25 attributes?
Evidence: images refers to IMG_ID; have at least 25 attributes refers to count(ATT_CLASS_ID) > = 25
SQL: SELECT COUNT(*) FROM ( SELECT IMG_ID FROM IMG_OBJ_att GROUP BY IMG_ID HAVING COUNT(ATT_CLASS_ID) > 25 ) T1

Database: movie_platform
Question: Who is the director that directed the highest number of movies in the 70s? If there are multiple directors with the same amount of movies, list all of their names and indicate the highest rating score that those movies got from the users.
Evidence: highest number of movies COUNT(T1.movie_id); in the 70s refers to movie_release_year between 1970 and 1979
SQL: SELECT T2.director_name, T1.rating_score FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T2.movie_release_year BETWEEN 1970 AND 1979 GROUP BY T2.director_id ORDER BY COUNT(T2.movie_id) DESC LIMIT 1

Database: computer_student
Question: Mention the person ID of faculty professor who taught course ID 104 and the course level.
Evidence: person ID refers to person.p_id; faculty professor refers to professor = 1 and hasPosition ! = 0
SQL: SELECT T1.p_id, T3.courseLevel FROM person AS T1 INNER JOIN taughtBy AS T2 ON T1.p_id = T2.p_id INNER JOIN course AS T3 ON T3.course_id = T2.course_id WHERE T3.course_id = 104 AND T1.hasPosition <> 0

Database: soccer_2016
Question: List the names of players who play by the left hand.
Evidence: play by the left hand refers to Batting_hand =   'Left-hand bat'
SQL: SELECT T1.Player_Name FROM Player AS T1 INNER JOIN Batting_Style AS T2 ON T1.Batting_hand = T2.Batting_Id WHERE T2.Batting_hand = 'Left-hand bat'

Database: food_inspection_2
Question: Please list the assumed name of all the facilities inspected by Joshua Rosa.
Evidence: assumed name refers to dba_name
SQL: SELECT DISTINCT T3.dba_name FROM employee AS T1 INNER JOIN inspection AS T2 ON T1.employee_id = T2.employee_id INNER JOIN establishment AS T3 ON T2.license_no = T3.license_no WHERE T1.first_name = 'Joshua' AND T1.last_name = 'Rosa'

Database: movie_3
Question: List down the actor IDs of film titled "BOUND CHEAPER".
SQL: SELECT T2.actor_id FROM film AS T1 INNER JOIN film_actor AS T2 ON T1.film_id = T2.film_id WHERE T1.title = 'BOUND CHEAPER'