Database: bike_share_1
Question: What is the average duration of trips that ended on a foggy day?
Evidence: ended on a foggy day refers to end_date where events = 'fog'; average duration = DIVIDE(SUM(duration), COUNT(duration));
SQL: SELECT AVG(T1.duration) FROM trip AS T1 INNER JOIN weather AS T2 ON T2.zip_code = T1.zip_code WHERE T2.events = 'Fog'

Database: university
Question: In years 2011 to 2013, what is the total number of female students in university ID 40?
Evidence: total number of female students refers to SUM(DIVIDE(MULTIPLY(pct_female_students, num_students), 100)); In years 2011 to 2013 refers to year BETWEEN 2011 AND 2013
SQL: SELECT SUM(CAST(num_students * pct_female_students AS REAL) / 100) FROM university_year WHERE year BETWEEN 2011 AND 2013 AND university_id = 40

Database: menu
Question: What is the event sponsored by the Republican House?
Evidence: sponsored by the Republican House refers to sponsor = 'REPUBLICAN HOUSE';
SQL: SELECT event FROM Menu WHERE sponsor = 'REPUBLICAN HOUSE'

Database: sales
Question: How many "Mountain-100 Silver, 38" were sold by Stearns MacFeather?
Evidence: Mountain-100 Silver, 38' is name of product;
SQL: SELECT SUM(T2.Quantity) FROM Employees AS T1 INNER JOIN Sales AS T2 ON T1.EmployeeID = T2.SalesPersonID INNER JOIN Products AS T3 ON T2.ProductID = T3.ProductID WHERE T1.FirstName = 'Stearns' AND T1.LastName = 'MacFeather' AND T3.Name = 'Mountain-100 Silver, 38'

Database: music_platform_2
Question: What is the average rating of all the podcasts in category art?
Evidence: category art refers to category = 'arts'; average rating = Divide (Sum (rating), Count (podcast_id))
SQL: SELECT AVG(T2.rating) FROM categories AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id WHERE T1.category = 'arts'

Database: synthea
Question: What kind of condition did Keven Kuhn have from 2016/9/24 to 2016/10/10? Describe the condition.
Evidence: kind of condition refers to DESCRIPTION from conditions; from 2016/9/24 to 2016/10/10 refers to START = '2016-09-24' and STOP = '2016-10-10';
SQL: SELECT T2.description FROM patients AS T1 INNER JOIN conditions AS T2 ON T1.patient = T2.PATIENT WHERE T1.first = 'Keven' AND T1.last = 'Kuhn' AND T2.start = '2016-09-24' AND T2.stop = '2016-10-10'

Database: college_completion
Question: Name the state with the most number of graduate cohort in 2012 from private institute for profit? List all such institutes in the mentioned state.
Evidence: most number of graduate cohort refers to MAX(SUM(grad_cohort)); in 2012 refers to year = 2012; private institute for profit refers to control = 'Private for-profit'; institutes refers to chronname;
SQL: SELECT T1.state, T1.chronname FROM institution_details AS T1 INNER JOIN state_sector_grads AS T2 ON T1.state = T2.state WHERE T2.year = 2012 AND T1.control = 'Private for-profit' GROUP BY T2.grad_cohort ORDER BY COUNT(T2.grad_cohort) DESC LIMIT 1

Database: restaurant
Question: What is the county of the Sankee restaurant?
Evidence: Sankee restaurant refers to label = 'sankee'
SQL: SELECT T2.county FROM generalinfo AS T1 INNER JOIN geographic AS T2 ON T1.city = T2.city WHERE T1.label = 'sankee'

Database: soccer_2016
Question: What is the percentage of matches that are won by runs?
Evidence: won by runs refers to win_type = 1; percentage refers to DIVIDE(COUNT(win_type = 1), COUNT(Win_Type)) * 100
SQL: SELECT CAST(SUM(CASE WHEN T1.win_type = 1 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.Win_Type) FROM Match AS T1 INNER JOIN Win_By AS T2 ON T1.Win_Type = T2.Win_Id

Database: simpson_episodes
Question: What's the nickname for Dan Castellaneta?
Evidence: "Dan Castellaneta" is the name of Person
SQL: SELECT nickname FROM Person WHERE name = 'Dan Castellaneta';

Database: synthea
Question: Provide the allergen of the Dominican patient named Dirk Languish.
Evidence: allergen refers to allergies.DESCRIPTION;
SQL: SELECT T1.DESCRIPTION FROM allergies AS T1 INNER JOIN patients AS T2 ON T1.PATIENT = T2.patient WHERE T2.first = 'Dirk' AND T2.last = 'Langosh' AND T2.ethnicity = 'dominican'

Database: trains
Question: How many trains running west have double sided cars in 3rd position?
Evidence: west is a direction; double sided cars refers to sides = 'double'; 3rd position refers to position = 3
SQL: SELECT COUNT(T.train_id) FROM (SELECT T1.train_id FROM cars AS T1 INNER JOIN trains AS T2 ON T1.train_id = T2.id WHERE T1.position = 3 AND T2.direction = 'west' AND T1.sides = 'double' GROUP BY T1.train_id)as T

Database: computer_student
Question: Please list the IDs of the top 3 professors that teaches the most courses.
Evidence: IDs of the professors refers to taughtBy.p_id and professor = 1; teaches the most courses refers to max(count(course_id))
SQL: SELECT T1.p_id FROM taughtBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id WHERE T2.professor = 1 GROUP BY T1.p_id ORDER BY COUNT(*) DESC LIMIT 3

Database: books
Question: What is the percentage of books that cost greater than $10 and were ordered by customer Ruthanne Vatini?
Evidence: cost greater than $10 refers to price > 10; percentage = Divide (Count(book_id where price >10), Count(book_id)) * 100; full name refers to the composition of first name, lastname
SQL: SELECT CAST(SUM(CASE WHEN T1.price > 10 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM order_line AS T1 INNER JOIN cust_order AS T2 ON T2.order_id = T1.order_id INNER JOIN customer AS T3 ON T3.customer_id = T2.customer_id WHERE T3.first_name = 'Ruthanne' AND T3.last_name = 'Vatini'

Database: retails
Question: What percentage of customers engaged in the household segment are from Iran?
Evidence: the household segment refers to c_mktsegment = 'HOUSEHOLD'; Iran is nation name which refers to n_name = 'IRAN'; percentage = divide(count(c_custkey where n_name = 'IRAN'), count(c_custkey)) where c_mktsegment = 'HOUSEHOLD' * 100%
SQL: SELECT CAST(SUM(IIF(T2.n_name = 'IRAN', 1, 0)) AS REAL) * 100 / COUNT(T2.n_name) FROM customer AS T1 INNER JOIN nation AS T2 ON T1.c_nationkey = T2.n_nationkey WHERE T1.c_mktsegment = 'HOUSEHOLD'

Database: synthea
Question: How many patients sought medical attention due to a second-degree burn? Describe the care plan recommended to them.
Evidence: second-degree burn refers to encounters.REASONDESCRIPTION = 'Second degree burn'; ;
SQL: SELECT COUNT(DISTINCT T2.PATIENT), T2.DESCRIPTION FROM encounters AS T1 INNER JOIN careplans AS T2 ON T1.PATIENT = T2.PATIENT WHERE T2.REASONDESCRIPTION = 'Second degree burn'

Database: synthea
Question: What are the medical encounter ids of patients who were born in Pembroke MA US?
Evidence: medical encounter ids careplans.ID; born in Pembroke MA US refers to birthplace = 'Pembroke MA US';
SQL: SELECT DISTINCT T1.ENCOUNTER FROM careplans AS T1 INNER JOIN patients AS T2 ON T1.PATIENT = T2.patient WHERE T2.birthplace = 'Pembroke MA US'

Database: retail_complains
Question: Find and list the names of districts which has below-average stars for Eagle Capital.
Evidence: below average = AVG(stars) < Stars; Eagle Capital refers to Product = 'Eagle Capital';
SQL: SELECT T2.division FROM reviews AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id WHERE T1.Product = 'Eagle Capital' AND T1.Stars > ( SELECT AVG(Stars) FROM reviews AS T1 INNER JOIN district AS T2 ON T1.district_id = T2.district_id )

Database: sales_in_weather
Question: What is the total units of products sold on the day with the highest max temperature in store no.3 in 2012?
Evidence: highest max temperature refers to Max(tmax); store no.3 refers to store_nbr = 3; in 2012 refers to substring (date, 1, 4) = '2012'; total units refers to sum(units)
SQL: SELECT SUM(units) FROM sales_in_weather AS T1 INNER JOIN relation AS T2 ON T1.store_nbr = T2.store_nbr INNER JOIN weather AS T3 ON T2.station_nbr = T3.station_nbr WHERE T2.store_nbr = 3 AND T1.`date` LIKE '%2012%' GROUP BY T3.tmax ORDER BY T3.tmax DESC LIMIT 1