Database: software_company
Question: List the marital status and response of female customers with an level of education of 8 and above.
Evidence: female customers with an level of education of 8 and above refer to SEX = 'Female' where EDUCATIONNUM ≥ 8;
SQL: SELECT DISTINCT T1.MARITAL_STATUS, T2.RESPONSE FROM Customers AS T1 INNER JOIN Mailings1_2 AS T2 ON T1.ID = T2.REFID WHERE T1.EDUCATIONNUM > 8 AND T1.SEX = 'Female'

Database: food_inspection_2
Question: List all inspection IDs where the employee named "Rosemary Kennedy" was involved.
SQL: SELECT DISTINCT T2.inspection_id FROM employee AS T1 INNER JOIN inspection AS T2 ON T1.employee_id = T2.employee_id WHERE T1.first_name = 'Rosemary' AND T1.last_name = 'Kennedy'

Database: movie_3
Question: List all the films that are rated as PG-13.
Evidence: film refers to title; rated as PG-13 refers to rating = 'PG-13'
SQL: SELECT title FROM film WHERE rating = 'PG-13'

Database: coinmarketcap
Question: When is the highest closed price of CHNCoin?
Evidence: the highest closed price refers to max(close)
SQL: SELECT T2.date FROM coins AS T1 INNER JOIN historical AS T2 ON T1.id = T2.coin_id WHERE T1.name = 'CHNCoin' ORDER BY T2.close DESC LIMIT 1

Database: book_publishing_company
Question: Find the difference between the average royalty of titles published by US and non US publishers?
Evidence: US publisher refers publisher in the US where country = 'USA'; non-US publishers refers publisher not in the US where country! = 'USA'; difference = SUBTRACT(AVG(royalty) where country = 'USA', AVG(royalty) where country! = 'USA'))
SQL: SELECT (CAST(SUM(CASE WHEN T2.country = 'USA' THEN T1.royalty ELSE 0 END) AS REAL) / SUM(CASE WHEN T2.country = 'USA' THEN 1 ELSE 0 END)) - (CAST(SUM(CASE WHEN T2.country != 'USA' THEN T1.royalty ELSE 0 END) AS REAL) / SUM(CASE WHEN T2.country != 'USA' THEN 1 ELSE 0 END)) FROM titles AS T1 INNER JOIN publishers AS T2 ON T1.pub_id = T2.pub_id INNER JOIN roysched AS T3 ON T1.title_id = T3.title_id

Database: movie_platform
Question: Which film rated by user 59988436 that received 21 comments?
Evidence: user 59988436 refers to user_id = 59988436; received 21 comments refers to critic_comments = 21; film refers to movie;
SQL: SELECT T2.movie_title FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T1.user_id = 59988436 AND T1.critic_comments = 21

Database: regional_sales
Question: What is the name of the customer who purchased the product with the highest net profiit?
Evidence: highest net profit = Max(Subtract (Unit Price, Unit Cost)); name of customer refers to Customer Names
SQL: SELECT `Customer Names` FROM ( SELECT T1.`Customer Names`, T2.`Unit Price` - T2.`Unit Cost` AS "net profit" FROM Customers T1 INNER JOIN `Sales Orders` T2 ON T2._CustomerID = T1.CustomerID ) ORDER BY `net profit` DESC LIMIT 1

Database: movies_4
Question: Which department has the most people?
Evidence: department refers to department_name; most people refers to max(count(department_id))
SQL: SELECT T1.department_name FROM department AS T1 INNER JOIN movie_crew AS T2 ON T1.department_id = T2.department_id GROUP BY T1.department_id ORDER BY COUNT(T2.department_id) DESC LIMIT 1

Database: books
Question: Other than zero, what is the lowest price paid by a customer for an order?
Evidence: other than 0 refers to price ! = 0; lowest price paid refers to Min(price)
SQL: SELECT MIN(price) FROM order_line WHERE price <> 0

Database: olympics
Question: When did Roma host the Olympic Games?
Evidence: Roma refers to city_name = 'Roma'; When host refers to games_year;
SQL: SELECT T3.games_year FROM games_city AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.id INNER JOIN games AS T3 ON T1.games_id = T3.id WHERE T2.city_name = 'Roma'

Database: computer_student
Question: Find the ID of advisor of student ID 80 and state the level of courses taught by him/her.
Evidence: ID of advisor refers to p_id_dummy; student ID 80 refers to advisedBy.p_id = 80; level of courses refers to courseLevel
SQL: SELECT T1.p_id_dummy, T2.courseLevel FROM advisedBy AS T1 INNER JOIN course AS T2 ON T1.p_id = T2.course_id INNER JOIN taughtBy AS T3 ON T2.course_id = T3.course_id WHERE T1.p_id = 80

Database: olympics
Question: Provide hockey's sport id.
Evidence: hockey's sport refers to sport_name = 'hockey';
SQL: SELECT id FROM sport WHERE sport_name = 'Hockey'

Database: retail_world
Question: How many orders did "Laughing Bacchus Wine Cellars" make?
Evidence: "Laughing Bacchus Wine Cellars" is the name of the company; orders refer to OrderID;
SQL: SELECT COUNT(T2.OrderID) FROM Customers AS T1 INNER JOIN Orders AS T2 ON T1.CustomerID = T2.CustomerID WHERE T1.CompanyName = 'Laughing Bacchus Wine Cellars'

Database: cs_semester
Question: Name the professor who got graduation from the University of Boston.
Evidence: Name the professor refers to full name which includes f_name and l_name;
SQL: SELECT first_name, last_name FROM prof WHERE graduate_from = 'University of Boston'

Database: app_store
Question: What are the top 5 installed free apps?
Evidence: free app refers to price = 0; most installed app refers to MAX(Installs);
SQL: SELECT App FROM playstore WHERE Price = 0 ORDER BY CAST(REPLACE(REPLACE(Installs, ',', ''), '+', '') AS INTEGER) DESC LIMIT 5

Database: movie_3
Question: Please provide the address of the customer whose first name is SUSAN with the postal code 77948.
SQL: SELECT T1.address FROM address AS T1 INNER JOIN customer AS T2 ON T1.address_id = T2.address_id WHERE T2.first_name = 'SUSAN' AND T1.postal_code = 77948

Database: synthea
Question: What is the percentage of Hispanic patients who stopped their care plan in 2011?
Evidence: Hispanic patients refers to ethnicity = 'hispanic'; percentage = MULTIPLY(DIVIDE(COUNT(careplans.PATIENT WHERE ethnicity = 'hispanic'), COUNT(careplans.PATIENT)), 1.0); stopped their care plan in 2011 refers to substr(careplans.stop, 1, 4) = '2011';
SQL: SELECT CAST(SUM(CASE WHEN T2.race = 'hispanic' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.PATIENT) FROM careplans AS T1 INNER JOIN patients AS T2 ON T1.PATIENT = T2.patient WHERE strftime('%Y', T1.stop) = '2011'

Database: food_inspection
Question: How many owners have 5 or more establishments?
Evidence: 5 or more establishments COUNT(business_id) > = 5;
SQL: SELECT COUNT(T1.owner_name) FROM ( SELECT owner_name FROM businesses GROUP BY owner_name HAVING COUNT(owner_name) > 5 ) T1

Database: software_company
Question: List the occupation and income of male customers with an level of education of 4 to 6.
Evidence: male customers with an level of education of 4 to 6 refer to SEX = 'Male' where EDUCATIONNUM BETWEEN 4 AND 6; income refers to INCOME_K;
SQL: SELECT T1.OCCUPATION, T2.INCOME_K FROM Customers AS T1 INNER JOIN Demog AS T2 ON T1.GEOID = T2.GEOID WHERE T1.EDUCATIONNUM >= 4 AND T1.EDUCATIONNUM <= 6 AND T1.SEX = 'Male'

Database: legislator
Question: What is the ratio between male and female legislators?
Evidence: ratio = DIVIDE(SUM(gender_bio = 'M'),  SUM(gender_bio = 'F')); male refers to gender_bio = 'M'; female refers to gender_bio = 'F'
SQL: SELECT CAST(SUM(CASE WHEN gender_bio = 'M' THEN 1 ELSE 0 END) AS REAL) / SUM(CASE WHEN gender_bio = 'F' THEN 1 ELSE 0 END) FROM historical

Database: retail_world
Question: What is the full name of the employee with the highest salary?
Evidence: full name refers to FirstName LastName; highest salary refers to max(Salary)
SQL: SELECT FirstName, LastName FROM Employees WHERE Salary = ( SELECT MAX(Salary) FROM Employees )

Database: shakespeare
Question: Please name any three comedic works.
Evidence: comedic works refers to GenreType = 'comedy'
SQL: SELECT Title FROM works WHERE GenreType = 'comedy' LIMIT 3