Database: synthea
Question: How many patients who are allergic to peanuts have asthma?
Evidence: allergic to peanuts refers to allergies.DESCRIPTION = 'Allergy to peanuts'; asthma refers to conditions.DESCRIPTION = 'Asthma';
SQL: SELECT COUNT(DISTINCT T2.patient) FROM conditions AS T1 INNER JOIN patients AS T2 ON T1.PATIENT = T2.patient INNER JOIN allergies AS T3 ON T2.patient = T3.PATIENT WHERE T1.DESCRIPTION = 'Asthma' AND T3.DESCRIPTION = 'Allergy to peanuts'

Database: public_review_platform
Question: What is the percentage for the Yelp businesses in "Pets" category of all businesses?
Evidence: businesses in "Pets" category refers to category_name = 'Pets'; percentage refers to DIVIDE(COUNT(category_name = 'Pets'), COUNT(business_id)) * 100%
SQL: SELECT CAST(SUM(CASE WHEN T2.category_name = 'Pets' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T2.category_name) FROM Business_Categories AS T1 INNER JOIN Categories AS T2 ON T1.category_id = T2.category_id

Database: shipping
Question: What is the ship ID of shipments shipped to the city with the largest area?
Evidence: city with largest area refers to Max(area)
SQL: SELECT T1.ship_id FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id ORDER BY T2.area DESC LIMIT 1

Database: regional_sales
Question: Calculate the order percentage by "Carlos Miller" sales team.
Evidence: DIVIDE(COUNT(OrderNumber where Sales Team = 'Carlos Miller'), COUNT(OrderNumber)) as percentage;
SQL: SELECT CAST(SUM(CASE WHEN T2.`Sales Team` = 'Carlos Miller' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.OrderNumber) FROM `Sales Orders` AS T1 INNER JOIN `Sales Team` AS T2 ON T2.SalesTeamID = T1._SalesTeamID

Database: food_inspection_2
Question: Among the establishments that failed in the inspection, what is the percentage of establishments with the highest risk level?
Evidence: failed in inspection refers to results = 'Fail'; the highest risk level refers to max(risk_level); percentage = divide(count(license_no where risk_level = max(risk_level)), count(license_no)) * 100% where results = 'Fail'
SQL: SELECT CAST(COUNT(CASE WHEN T1.risk_level = 3 THEN T1.license_no END) AS REAL) * 100 / COUNT(T1.risk_level) FROM establishment AS T1 INNER JOIN inspection AS T2 ON T1.license_no = T2.license_no WHERE T2.results = 'Fail'

Database: mental_health_survey
Question: Tell the question ID for "Would you bring up a physical health issue with a potential employer in an interview?".
SQL: SELECT questionid FROM Question WHERE questiontext LIKE 'Would you bring up a physical health issue with a potential employer in an interview?'

Database: movies_4
Question: What is the average revenue of American movies in 2006?
Evidence: American movies refers to country_name = 'United States of America'; in 2006 refers to release_date LIKE '2006%'; average revenue = AVG(revenue)
SQL: SELECT AVG(T1.revenue) FROM movie AS T1 INNER JOIN production_COUNTry AS T2 ON T1.movie_id = T2.movie_id INNER JOIN COUNTry AS T3 ON T2.COUNTry_id = T3.COUNTry_id WHERE T3.COUNTry_name = 'United States of America' AND CAST(STRFTIME('%Y', T1.release_date) AS INT) = 2006

Database: movie_3
Question: Identify the full name of the customer, who has the following email address: SHEILA.WELLS@sakilacustomer.org.
Evidence: full name refers to first_name, last_name
SQL: SELECT first_name, last_name FROM customer WHERE email = 'SHEILA.WELLS@sakilacustomer.org'

Database: beer_factory
Question: How many canned A&W were purchased in 2016?
Evidence: canned refers to ContainerType = 'Can'; A&W refers to BrandName = 'A&W'; in 2016 refers to PurchaseDate > = '2016-01-01' AND PurchaseDate < = '2016-12-31';
SQL: SELECT COUNT(T1.BrandID) FROM rootbeer AS T1 INNER JOIN rootbeerbrand AS T2 ON T1.BrandID = T2.BrandID WHERE T1.ContainerType = 'Can' AND T2.BrandName = 'A&W' AND T1.PurchaseDate LIKE '2016%'

Database: simpson_episodes
Question: Which episode of The simpson 20s: Season 20 has received the most nominations? Indicate the title.
Evidence: received the most nomination refers to MAX(COUNT(episode_id))
SQL: SELECT T2.title FROM Award AS T1 INNER JOIN Episode AS T2 ON T1.episode_id = T2.episode_id GROUP BY T1.episode_id ORDER BY COUNT(*) DESC LIMIT 1;

Database: regional_sales
Question: What is the type of store located in the city with the highest amount of water area?
Evidence: type of store in City refers to Type = 'City'; highest amount of water area refers to Max(Water Area)
SQL: SELECT CASE WHEN MAX(`Water Area`) THEN Type END FROM `Store Locations`

Database: retails
Question: Please list the phone numbers of all the customers in the household segment and are in Brazil.
Evidence: phone numbers refer to c_phone; Brazil is the name of the nation which refers to n_name = 'BRAZIL'; household segment refers to c_mktsegment = 'HOUSEHOLD';
SQL: SELECT T1.c_phone FROM customer AS T1 INNER JOIN nation AS T2 ON T1.c_nationkey = T2.n_nationkey WHERE T1.c_mktsegment = 'HOUSEHOLD' AND T2.n_name = 'BRAZIL'

Database: movie_3
Question: Among the customers with customer ID of 100 and below, how many of them have Thomas as their last name?
Evidence: customer ID of 100 and below refers to customer_id < 100
SQL: SELECT COUNT(customer_id) FROM customer WHERE last_name = 'Thomas' AND customer_id < 100

Database: video_games
Question: Give the genre of the games released from 2000 to 2002.
Evidence: genre refers to genre_name; released from 2000 to 2002 refers to release_year BETWEEN 2000 AND 2002
SQL: SELECT DISTINCT T4.genre_name FROM game_platform AS T1 INNER JOIN game_publisher AS T2 ON T1.game_publisher_id = T2.id INNER JOIN game AS T3 ON T2.game_id = T3.id INNER JOIN genre AS T4 ON T3.genre_id = T4.id WHERE T1.release_year BETWEEN 2000 AND 2002

Database: retail_world
Question: The sales of how many territories is Nancy Davolio in charge of?
SQL: SELECT COUNT(T2.TerritoryID) FROM Employees AS T1 INNER JOIN EmployeeTerritories AS T2 ON T1.EmployeeID = T2.EmployeeID WHERE T1.FirstName = 'Nancy' AND T1.LastName = 'Davolio'

Database: sales
Question: In sales with a quantity of 60, how many of them have a price not greater than 500?
SQL: SELECT COUNT(T1.ProductID) FROM Products AS T1 INNER JOIN Sales AS T2 ON T1.ProductID = T2.ProductID WHERE T2.quantity = 60 AND T1.Price <= 500

Database: retail_world
Question: List the territory IDs, description and region description under the in-charge of Mrs. Margaret Peacock.
SQL: SELECT T3.TerritoryID, T3.TerritoryDescription, T4.RegionDescription FROM Employees AS T1 INNER JOIN EmployeeTerritories AS T2 ON T1.EmployeeID = T2.EmployeeID INNER JOIN Territories AS T3 ON T2.TerritoryID = T3.TerritoryID INNER JOIN Region AS T4 ON T3.RegionID = T4.RegionID WHERE T1.TitleOfCourtesy = 'Mrs.' AND T1.LastName = 'Peacock' AND T1.FirstName = 'Margaret'

Database: video_games
Question: State the name of the platforms for games released in 2000.
Evidence: name of the platforms refers to platform_name; released in 2000 refers to release_year = 2000;
SQL: SELECT DISTINCT T2.platform_name FROM game_platform AS T1 INNER JOIN platform AS T2 ON T1.platform_id = T2.id WHERE T1.release_year = 2000

Database: movie
Question: What is the genre of PG rated movie starred by the actor with highest net worth?
Evidence: PG rated refers to MPAA Rating = 'PG';  highest net worth refers to max(NetWorth)
SQL: SELECT T1.Genre FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID INNER JOIN actor AS T3 ON T3.ActorID = T2.ActorID WHERE T1.`MPAA Rating` = 'PG' ORDER BY CAST(REPLACE(REPLACE(T3.NetWorth, ',', ''), '$', '') AS REAL) DESC LIMIT 1

Database: movie_3
Question: How many rental IDs belong to Eleanor Hunt?
Evidence: 'Eleanor Hunt' is the full name of a customer; full name refers to first_name, last_name
SQL: SELECT COUNT(T1.rental_id) FROM rental AS T1 INNER JOIN customer AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = 'Eleanor' AND T2.last_name = 'Hunt'