Database: mental_health_survey
Question: What answer did user No. 2681 give to the question "Do you currently have a mental health disorder?"?
Evidence: question refers to questiontext; user No. 2681 refers to UserID = 2681


SQL: SELECT T1.AnswerText FROM Answer AS T1 INNER JOIN Question AS T2 ON T1.QuestionID = T2.questionid WHERE T2.questiontext = 'Do you currently have a mental health disorder?' AND T1.UserID = 2681

Database: bike_share_1
Question: How many trips made by a subscriber started in August, 2013 from a station that can hold more than 20 bikes?
Evidence: subscriber refers to subscription_type = 'Subscriber'; in August 2013 refers to start_date LIKE'8%' AND start_date LIKE'%2013%'; station that can hold more than 20 bikes refers to dock_count>20;
SQL: SELECT COUNT(T2.id) FROM station AS T1 INNER JOIN trip AS T2 ON T1.id = T2.start_station_id WHERE T2.subscription_type = 'Subscriber' AND T2.start_date LIKE '8/%/2013%' AND T1.dock_count > 20

Database: food_inspection
Question: In businesses that violates 103157 on May 27, 2016 , what is the name of the business that has an unscheduled inspection?
Evidence: businesses that violates 103157 refer to business_id where violation_type_id = 103157; date = '2016-05-27'; unscheduled inspection refers to type = 'Routine - Unscheduled';
SQL: SELECT DISTINCT T3.name FROM violations AS T1 INNER JOIN inspections AS T2 ON T1.business_id = T2.business_id INNER JOIN businesses AS T3 ON T2.business_id = T3.business_id WHERE T1.`date` = '2016-05-27' AND T1.violation_type_id = 103157 AND T2.type = 'Routine - Unscheduled'

Database: olympics
Question: Please list all competitors' names who participated in 1936 Summer.
Evidence: competitors' names refer to full_name; in 1936 Summer refers to games_name = '1936 Summer';
SQL: SELECT T3.full_name 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_name = '1936 Summer'

Database: image_and_language
Question: How many self-relations are there between the object samples in image no.5?
Evidence: self-relations refers to OBJ1_SAMPLE_ID = OBJ2_SAMPLE_ID; image no.5 refers to IMG_ID = 5
SQL: SELECT SUM(CASE WHEN IMG_ID = 5 THEN 1 ELSE 0 END) FROM IMG_REL WHERE OBJ1_SAMPLE_ID = OBJ2_SAMPLE_ID

Database: sales
Question: What is the last name of sales person for sales id 100?
SQL: SELECT T1.LastName FROM Employees AS T1 INNER JOIN Sales AS T2 ON T1.EmployeeID = T2.SalesPersonID WHERE T2.SalesID = 100

Database: student_loan
Question: Which organization has the highest number of male students? Calculate for the percentage of the male students in the said organization.
Evidence: organization refers to organ; highest number of male students refers to MAX(COUNT(male.name)); percentage = DIVIDE(COUNT(male.name), COUNT(person.name)), 1.0;
SQL: SELECT T.organ, T.per FROM ( SELECT T1.organ, CAST(COUNT(T3.name) AS REAL) / COUNT(T2.name) AS per , COUNT(T3.name) AS num FROM enlist AS T1 INNER JOIN person AS T2 ON T1.name = T2.name LEFT JOIN male AS T3 ON T2.name = T3.name GROUP BY T1.organ ) T ORDER BY T.num DESC LIMIT 1

Database: books
Question: How many customers use a Yahoo! Mail e-mail address?
Evidence: Yahoo! Mail e-mail address refers to email LIKE '%@yahoo.com'
SQL: SELECT COUNT(*) FROM customer WHERE email LIKE '%@yahoo.com'

Database: simpson_episodes
Question: In between the episode 5 and10 of season 2, how many of them are credited for casting?
Evidence: between the episode 5 and 10 of season 20 refers to episode_id IN('S20-E5', 'S20-E6', 'S20-E7', 'S20-E8', 'S20-E9', 'S20-E10'); credited refers to credited = 'true'; for casting refers to role = 'casting'
SQL: SELECT COUNT(credited) FROM Credit WHERE episode_id IN ( 'S20-E5',  'S20-E6',  'S20-E7',  'S20-E8',  'S20-E9',  'S20-E10' ) AND credited = 'true' AND role = 'casting';

Database: donor
Question: What is the essay title of the project that have the highest total price excluding optional support and who is the biggest donor? Identify the donor and calculate how many percent did he/she donated in the project.
Evidence: highest total price excluding optional support refers to max(total_price_excluding_optional_support); who refers to donor_acctid; percent = divide(donation_to_project, total_price_excluding_optional_support)*100%
SQL: SELECT T1.title, T3.donor_acctid, CAST(T3.donation_to_project AS REAL) / T2.total_price_excluding_optional_support FROM essays AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid INNER JOIN donations AS T3 ON T2.projectid = T3.projectid ORDER BY T3.donation_to_project DESC LIMIT 1

Database: movie_platform
Question: Please list the names of the movies that received more than 20 likes?
Evidence: received more than 20 likes refers to critic_likes>20;
SQL: SELECT T2.movie_title FROM ratings AS T1 INNER JOIN movies AS T2 ON T1.movie_id = T2.movie_id WHERE T1.critic_likes > 20

Database: synthea
Question: List out 5 most common conditions for underweight patient.
Evidence: most common condition refers to MAX(COUNT(conditions.DESCRIPTION)); underweight patient refers to MIN(observations.VALUE WHERE observations.DESCRIPTION = 'Body Mass Index');
SQL: SELECT DISTINCT T2.DESCRIPTION, T2.VALUE, T2.UNITS FROM patients AS T1 INNER JOIN observations AS T2 ON T1.patient = T2.PATIENT WHERE T2.DESCRIPTION = 'Body Mass Index' GROUP BY T2.VALUE ORDER BY COUNT(T2.VALUE) LIMIT 5

Database: address
Question: Indicate the country name of the city Las Marias.
SQL: SELECT T1.county FROM country AS T1 INNER JOIN zip_data AS T2 ON T1.zip_code = T2.zip_code WHERE T2.city = 'Las Marias'

Database: menu
Question: How many menus with the name "Waldorf Astoria" have 4 pages?
Evidence: 4 pages refers to page_count = 4;
SQL: SELECT COUNT(*) FROM Menu WHERE name = 'Waldorf Astoria' AND page_count = 4

Database: cs_semester
Question: Which professor advised Willie Rechert to work as a research assistant? Please give his or her full name.
Evidence: research assistant refers to the student who serves for research where the abbreviation is RA; prof_id refers to professor’s ID; full name refers to f_name and l_name;
SQL: SELECT T1.first_name, T1.last_name FROM prof AS T1 INNER JOIN RA AS T2 ON T1.prof_id = T2.prof_id INNER JOIN student AS T3 ON T2.student_id = T3.student_id WHERE T3.f_name = 'Willie' AND T3.l_name = 'Rechert'

Database: superstore
Question: Please list the names of all the customers who had ordered the product "Telescoping Adjustable Floor Lamp".
Evidence: "Telescoping Adjustable Floor Lamp" is a product name; names of all the customers refers to "Customer Name"
SQL: SELECT DISTINCT T1.`Customer Name` FROM people AS T1 INNER JOIN central_superstore AS T2 ON T1.`Customer ID` = T2.`Customer ID` INNER JOIN product AS T3 ON T3.`Product ID` = T2.`Product ID` WHERE T3.`Product Name` = 'Telescoping Adjustable Floor Lamp'

Database: legislator
Question: When was the last serving date of Matt Salmon?
Evidence: Matt Salmon is an official_full_name
SQL: SELECT T1.END FROM `historical-terms` AS T1 INNER JOIN historical AS T2 ON T2.bioguide_id = T1.bioguide WHERE T2.official_full_name = 'Matt Salmon'

Database: public_review_platform
Question: Which business in fashion category has the most review?
Evidence: 'Fashion' is the category_name; most review refers to Max(Count(user_id))
SQL: SELECT T3.business_id FROM Categories AS T1 INNER JOIN Business_Categories AS T2 ON T1.category_id = T2.category_id INNER JOIN Business AS T3 ON T2.business_id = T3.business_id INNER JOIN Reviews AS T4 ON T3.business_id = T4.business_id WHERE T1.category_name LIKE 'Fashion' AND T1.category_id = 7 GROUP BY T3.business_id ORDER BY COUNT(T4.user_id) DESC LIMIT 1

Database: coinmarketcap
Question: What's the descripition of BitBar?
SQL: SELECT description FROM coins WHERE name = 'BitBar'