Database: olympics
Question: In what year and season did Sohail Abbas compete?
Evidence: year refers to games_year;
SQL: SELECT T1.games_year, T1.season 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 T3.full_name = 'Sohail Abbas'

Database: movielens
Question: For different directors who direct well, how many of them have directed an action film?
Evidence: direct well means the quality of directing is good, which means d_quality = 4.
SQL: SELECT COUNT(DISTINCT T2.directorid) FROM movies2directors AS T2 INNER JOIN directors AS T3 ON T2.directorid = T3.directorid WHERE T2.genre = 'Action' AND T3.d_quality = 4

Database: codebase_comments
Question: Among the solutions that contain files within the repository needing the longest processed time to download, how many of them doesn't need to be
compiled if user wants to implement it?
Evidence: longest processed time refers to max(Solution.ProcessedTime); needs to be compiled if user wants to implement it refers to WasCompiled = 0；
SQL: SELECT COUNT(T2.RepoId) FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T1.ProcessedTime = ( SELECT MAX(ProcessedTime) FROM Repo ) AND T2.WasCompiled = 1

Database: student_loan
Question: Which department has the most disabled students?
Evidence: department refers to organ; most disabled students refers to MAX(disabled.name)
SQL: SELECT T2.organ, COUNT(T1.name) FROM disabled AS T1 INNER JOIN enlist AS T2 ON T1.`name` = T2.`name` GROUP BY T2.organ ORDER BY COUNT(T1.name) DESC LIMIT 1

Database: talkingdata
Question: Which gender logged in the most to an event in the first 10 days of May 2016?
Evidence: gender that logged in the most refers to MAX(COUNT(gender)); first 10 days of May 2016 refers to timestamp BETWEEN '2016-05-01 00:00:00' AND '2016-05-10 23:59:59';
SQL: SELECT T.gender FROM ( SELECT T1.gender, COUNT(T1.device_id) AS num FROM gender_age AS T1 INNER JOIN events_relevant AS T2 ON T1.device_id = T2.device_id WHERE date(T2.timestamp) BETWEEN '2016-05-01' AND '2016-05-10' GROUP BY T1.gender ) AS T ORDER BY T.num DESC LIMIT 1

Database: donor
Question: Which school requested the highest amount of resources from Amazon? State the school's ID.
Evidence: highest amount of resources refers to max(count(schoolid)); Amazon refers to vendor_name = 'Amazon'
SQL: SELECT T2.schoolid FROM resources AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T1.vendor_name LIKE 'Amazon' GROUP BY T2.schoolid ORDER BY COUNT(T1.vendor_name) DESC LIMIT 1

Database: movie_3
Question: What is the biggest amount of payment for a rental made by Mary Smith?
Evidence: the biggest amount refers to max(amount)
SQL: SELECT T1.amount FROM payment AS T1 INNER JOIN customer AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = 'MARY' AND T2.last_name = 'SMITH' ORDER BY T1.amount DESC LIMIT 1

Database: bike_share_1
Question: What are the average maximum and minimum temperatures in May 2015 when the mean humidity is between 65 and 75?
Evidence: average maximum temperature = DIVIDE(SUM(max_temperature_f), COUNT(date)); average minimum temperature = DIVIDE(SUM(min_temperature_f), COUNT(date)); May 2015 refers to date BETWEEN '5/1/2015'AND '5/31/2015';
SQL: SELECT AVG(max_temperature_f), AVG(min_temperature_f) FROM weather WHERE date LIKE '5/%/2015' AND mean_humidity BETWEEN 65 AND 75

Database: student_loan
Question: Provide the students' names and schools who enrolled for 15 months.
Evidence: enrolled for 15 months refers to month = 15;
SQL: SELECT name, school FROM enrolled WHERE month = 15

Database: movielens
Question: What is the percentage of female audiences who viewed movies with rating 2?
Evidence: The audience and users are the same meaning; Female users refers to u_gender = 'F'; Percentage of female users = count(female users) / count(all users); count(all users) = count(female users) + count(male users)
SQL: SELECT CAST(SUM(IIF(T2.u_gender = 'F', 1, 0)) AS REAL) * 100 / COUNT(T2.userid) FROM u2base AS T1 INNER JOIN users AS T2 ON T1.userid = T2.userid WHERE T1.rating = 2

Database: university
Question: Give the year where a university had the lowest number of students.
Evidence: had the lowest number of students refers to MIN(num_students)
SQL: SELECT year FROM university_year ORDER BY num_students ASC LIMIT 1

Database: cookbook
Question: How much fat does the Raspberry Chiffon Pie have?
Evidence: Raspberry Chiffon Pie refers to title
SQL: SELECT T2.total_fat FROM Recipe AS T1 INNER JOIN Nutrition AS T2 ON T1.recipe_id = T2.recipe_id WHERE T1.title = 'Raspberry Chiffon Pie'

Database: social_media
Question: Among all the tweets with a positive sentiment, what is the percentage of those posted by a male user?
Evidence: positive sentiment refers to Sentiment > 0; male user refers to Gender = 'Male'; percentage = Divide (Count(TweetID where Gender = 'Male'), Count (TweetID)) * 100
SQL: SELECT SUM(CASE WHEN T2.Gender = 'Male' THEN 1.0 ELSE 0 END) / COUNT(T1.TweetID) AS per FROM twitter AS T1 INNER JOIN user AS T2 ON T1.UserID = T2.UserID WHERE T1.Sentiment > 0

Database: social_media
Question: How many unique users have seen tweet with text `Happy New Year to all those AWS instances of ours!`?
Evidence: "Happy New Year to all those AWS instances of ours!" is the text; seen unique users refers to Reach
SQL: SELECT Reach FROM twitter WHERE text = 'Happy New Year to all those AWS instances of ours!'

Database: retails
Question: Please give the name of the customer who has made the single order with the highest total price.
Evidence: name of the customer refers to c_name; single order with the highest total price refers to MAX(o_totalprice) LIMIT 1;
SQL: SELECT T2.c_name FROM orders AS T1 INNER JOIN customer AS T2 ON T1.o_custkey = T2.c_custkey ORDER BY T1.o_totalprice DESC LIMIT 1

Database: synthea
Question: How many patients have diabetes that started in 1988?
Evidence: diabetes that started in 1988 refers to DESCRIPTION = 'Diabetes' from conditions and START like '1988%';
SQL: SELECT COUNT(PATIENT) FROM conditions WHERE DESCRIPTION = 'Diabetes' AND strftime('%Y', START) = '1988'

Database: movie_3
Question: List down all of the film titles that are rated for general audiences.
Evidence: rated for general audiences means rating = 'G'
SQL: SELECT title FROM film WHERE rating = 'G'

Database: olympics
Question: How many times was Larysa Semenivna Latynina (Diriy-) declared as champion in Gymnastics Women's Individual All-Around?
Evidence: Gymnastics Women's Individual All-Around refers to event_name = 'Gymnastics Women''s Individual All-Around'; declared as champion refers to medal_name = 'Gold' or medal_id = 1;
SQL: SELECT COUNT(T1.id) FROM event AS T1 INNER JOIN competitor_event AS T2 ON T1.id = T2.event_id INNER JOIN games_competitor AS T3 ON T2.competitor_id = T3.id INNER JOIN person AS T4 ON T3.person_id = T4.id WHERE T4.full_name = 'Larysa Semenivna Latynina (Diriy-)' AND T1.event_name LIKE 'Gymnastics Women%s Individual All-Around' AND T2.medal_id = 1

Database: car_retails
Question: How do I contact the President of the company?
Evidence: President refers to the jobTitle;
SQL: SELECT t.email FROM employees t WHERE t.jobTitle = 'President'

Database: cs_semester
Question: In students with a grade of B, how many of them have an intellegence level of 3?
SQL: SELECT COUNT(T1.student_id) FROM registration AS T1 INNER JOIN student AS T2 ON T1.student_id = T2.student_id WHERE T1.grade = 'B' AND T2.intelligence = 3

Database: cs_semester
Question: How many students, who have a GPA between 3 to 4, failed a course?
Evidence: GPA is an abbreviated name of Grade Point Average where GPA between 3 to 4 refers to gpa BETWEEN 3 AND 4; If grade is null or empty, it means that this student fails to pass this course;
SQL: SELECT COUNT(T2.student_id) FROM student AS T1 INNER JOIN registration AS T2 ON T1.student_id = T2.student_id WHERE T2.grade IS NULL AND T1.gpa BETWEEN 3 AND 4