Database: legislator
Question: What is the official full name of the current legislator whose current official Facebook presence is "senjoniernst"?
Evidence: current official Facebook presence is "senjoniernst" refers to facebook = 'senjoniernst';
SQL: SELECT T1.official_full_name FROM current AS T1 INNER JOIN `social-media` AS T2 ON T1.bioguide_id = T2.bioguide WHERE T2.facebook = 'senjoniernst'

Database: disney
Question: Which movies had the main character named Donald Duck and who directed them?
Evidence: Donald Duck is the main character of the movie which refers to hero = 'Donald Duck'; movies refer to movie_title; who directed refers director;
SQL: SELECT T1.movie_title, T2.director FROM characters AS T1 INNER JOIN director AS T2 ON T1.movie_title = T2.name WHERE T1.hero = 'Donald Duck'

Database: airline
Question: Please list the dates of the flights that were cancelled due to the most serious reason.
Evidence: dates of the flights refers to FL_DATE; cancelled refers to CANCELLED = 1; most serious reason refers to CANCELLATION_CODE = 'A';
SQL: SELECT FL_DATE FROM Airlines WHERE CANCELLATION_CODE = 'A' GROUP BY FL_DATE

Database: movies_4
Question: How many main actors are there in the movie Pirates of the Caribbean: At World's End?
Evidence: main actors refers to gender = 'male' and min(cast_order); Pirates of the Caribbean: At World's End refers to title = 'Pirates of the Caribbean: At World''s End'
SQL: SELECT COUNT(T2.cast_order) FROM movie AS T1 INNER JOIN movie_cast AS T2 ON T1.movie_id = T2.movie_id INNER JOIN gender AS T3 ON T3.gender_id = T2.gender_id WHERE T3.gender = 'Male' OR T3.gender = 'Female' AND T1.title = 'Pirates of the Caribbean: At World''s End' AND T2.cast_order = ( SELECT MIN(T2.cast_order) FROM movie AS T1 INNER JOIN movie_cast AS T2 ON T1.movie_id = T2.movie_id INNER JOIN gender AS T3 ON T3.gender_id = T2.gender_id WHERE T3.gender = 'Male' OR T3.gender = 'Female' AND T1.title = 'Pirates of the Caribbean: At World''s End' )

Database: software_company
Question: Among the customers with an average income per inhabitant above 3000, what percentage are in their eighties?
Evidence: average income per inhabitant above 3000 refers to INCOME_K > 3000; eighties refer to age BETWEEN 80 AND 89; DIVIDE(COUNT(INCOME_K > 3000 and age BETWEEN 80 AND 89), COUNT(INCOME_K > 3000 )) as percentage;
SQL: SELECT CAST(SUM(CASE WHEN T1.age BETWEEN 80 AND 89 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.ID) FROM Customers AS T1 INNER JOIN Demog AS T2 ON T1.GEOID = T2.GEOID WHERE T2.INCOME_K > 3000

Database: chicago_crime
Question: Among the crimes reported to the ward located at 1958 N. Milwaukee Ave., list down the report number of the crimes happened inside the apartment.
Evidence: 1958 N. Milwaukee Ave. refers to ward_office_address = '1958 N. Milwaukee Ave.'; report number refers to case_number; inside the apartment refers to location_description = 'APARTMENT'
SQL: SELECT T1.case_number FROM Crime AS T1 INNER JOIN Ward AS T2 ON T2.ward_no = T1.ward_no WHERE T1.location_description = 'APARTMENT' AND T2.ward_office_address = '1958 N. Milwaukee Ave.'

Database: movie_3
Question: How many rentals were returned on 5/27/2005?
Evidence: return on 5/27/2005 refers to return_date = '2005-05-27'; rental refers to rental_id
SQL: SELECT COUNT(rental_id) FROM rental WHERE rental_date = '2005-05-27'

Database: superstore
Question: List 5 customers in the West region who had their item shipped 'Second Class.'
Evidence: shipped 'Second Class.' refers to "Ship Mode" = 'Second Class'; customers refers to "Customer Name"; Region = 'West'
SQL: SELECT DISTINCT T2.`Customer Name` FROM west_superstore AS T1 INNER JOIN people AS T2 ON T1.`Customer ID` = T2.`Customer ID` WHERE T1.Region = 'West' AND T1.`Ship Mode` = 'Second Class' LIMIT 5

Database: synthea
Question: How many patients are allergic to eggs?
Evidence: allergic to eggs refer to DESCRIPTION = 'Allergy to eggs' from allergies;
SQL: SELECT COUNT(PATIENT) FROM allergies WHERE DESCRIPTION = 'Allergy to eggs'

Database: retail_world
Question: Mention the first name of employee who took care the order id 10250.
SQL: SELECT T1.FirstName, T1.LastName FROM Employees AS T1 INNER JOIN Orders AS T2 ON T1.EmployeeID = T2.EmployeeID WHERE T2.OrderID = 10250

Database: authors
Question: Write down the author name, affiliation, jounal short name and full name of the paper "Decreased Saliva Secretion and Down-Regulation of AQP5 in Submandibular Gland in Irradiated Rats".
Evidence: "Decreased Saliva Secretion and Down-Regulation of AQP5 in Submandibular Gland in Irradiated Rats" is the Title of paper
SQL: SELECT T2.Name, T2.Affiliation, T3.ShortName, T3.FullName FROM Paper AS T1 INNER JOIN PaperAuthor AS T2 ON T1.Id = T2.PaperId INNER JOIN Journal AS T3 ON T1.JournalId = T3.Id WHERE T1.Title = 'Decreased Saliva Secretion and Down-Regulation of AQP5 in Submandibular Gland in Irradiated Rats'

Database: language_corpus
Question: How many biwords pairs are there whose second word is "grec"?
Evidence: grec refers to word = 'grec'; wid where word = 'grec' AS w2nd
SQL: SELECT COUNT(T2.w1st) FROM words AS T1 INNER JOIN biwords AS T2 ON T1.wid = T2.w2nd WHERE T1.word = 'grec'

Database: video_games
Question: Which region has the highest number of games sold on all platforms?
Evidence: which region refers to region_name; highest number of games sold on all platforms refers to MAX(SUM(num_sales));
SQL: SELECT T.region_name FROM ( SELECT T2.region_name, SUM(T1.num_sales) FROM region_sales AS T1 INNER JOIN region AS T2 ON T1.region_id = T2.id INNER JOIN game_platform AS T3 ON T1.game_platform_id = T3.id INNER JOIN platform AS T4 ON T3.platform_id = T4.id GROUP BY T4.platform_name ORDER BY SUM(T1.num_sales) DESC LIMIT 1 ) t

Database: olympics
Question: What is the percentage of female competitors whose heights are over 170 that participated in the game in 1988?
Evidence: DIVIDE(COUNT(person_id where gender = 'F' and height > 170), COUNT(person_id)) as percentage where games_year = 1988;
SQL: SELECT CAST(COUNT(CASE WHEN T3.gender = 'F' AND T3.height > 170 THEN 1 END) AS REAL) * 100 / COUNT(T2.person_id) FROM games AS T1 INNER JOIN games_competitor AS T2 ON T1.id = T2.games_id INNER JOIN person AS T3 ON T2.person_id = T3.id WHERE T1.games_year = 1988

Database: professional_basketball
Question: What is the number of NBA titles that Ray Allen has won throughout his NBA career?
Evidence: NBA refers to lgID = 'NBA'
SQL: SELECT COUNT(T1.playerID) FROM player_allstar AS T1 INNER JOIN awards_players AS T2 ON T1.playerID = T2.playerID WHERE first_name = 'Ray' AND last_name = 'Allen'

Database: human_resources
Question: Calculate the monthly average salary of the employee with highest salary. Mention his name, position title and location city.
Evidence: highest salary refers to MAX(salary); name = firstname, lastname; calculation = DIVIDE(MAX(salary), 12)
SQL: SELECT SUM(CAST(REPLACE(SUBSTR(T1.salary, 4), ',', '') AS REAL)) / 12 AS avg, T1.firstname, T1.lastname , T2.positiontitle, T3.locationcity FROM employee AS T1  INNER JOIN position AS T2  ON T1.positionID = T2.positionID INNER JOIN location AS T3  ON T1.locationID = T3.locationID WHERE CAST(REPLACE(SUBSTR(T1.salary, 4), ',', '') AS REAL) = ( SELECT MAX(CAST(REPLACE(SUBSTR(T1.salary, 4), ',', '') AS REAL)) FROM employee AS T1  INNER JOIN position AS T2  ON T1.positionID = T2.positionID INNER JOIN location AS T3  ON T1.locationID = T3.locationID )

Database: books
Question: List the ISBN of the book published in Spanish.
Evidence: "Spanish" is the language_name; ISBN refers to isbn13
SQL: SELECT T1.isbn13 FROM book AS T1 INNER JOIN book_language AS T2 ON T1.language_id = T2.language_id WHERE T2.language_name = 'Spanish'