Chinastark/bird_dataset huggingface dataset:
Database: music_platform_2
Note: "really interesting" is the title of review;  created on 2018-04-24 at 12:05:16 refers to created_at = '2018-04-24T12:05:16-07:00';
Question: What is the content of the review under the title "really interesting!" and is created on 2018-04-24 at 12:05:16?
SQL: SELECT content FROM reviews WHERE title = 'really interesting!' AND created_at = '2018-04-24T12:05:16-07:00'
Database: music_platform_2
Note: "Scaling Global" is the title of podcast;
Question: Which category is the podcast "Scaling Global" under?
SQL: SELECT category FROM categories WHERE podcast_id IN ( SELECT podcast_id FROM podcasts WHERE title = 'Scaling Global' )
Database: music_platform_2
Note: category 'arts-performing-arts' refers to category = 'arts-performing-arts';
Question: Please list the titles of all the podcasts under the category "arts-performing-arts".
SQL: SELECT DISTINCT podcasts.title FROM categories INNER JOIN podcasts ON podcasts.podcast_id = categories.podcast_id WHERE categories.category = 'arts-performing-arts'
Database: music_platform_2
Note: "Scaling Global" is the title of podcast;
Question: How many reviews are created for the podcast "Scaling Global" under?
SQL: SELECT count(reviews.content) FROM podcasts INNER JOIN reviews ON reviews.podcast_id = podcasts.podcast_id WHERE podcasts.title = 'Scaling Global'
Database: music_platform_2
Note: "Please Excuse My Dead Aunt Sally" is the title of podcast; made in the year 2019 refers to created_at like '2019%';
Question: Among the reviews for the podcast "Please Excuse My Dead Aunt Sally", how many of them are made in the year 2019?
SQL: SELECT count(reviews.created_at) FROM podcasts INNER JOIN reviews ON reviews.podcast_id = podcasts.podcast_id WHERE podcasts.title = 'Please Excuse My Dead Aunt Sally' AND reviews.created_at LIKE '2019-%'
Database: music_platform_2
Note: author whose ID is F7E5A318989779D refers to author_id = 'F7E5A318989779D';
Question: Please list the titles of the podcasts for which the author whose ID is F7E5A318989779D has written a review.
SQL: SELECT reviews.title FROM podcasts INNER JOIN reviews ON reviews.podcast_id = podcasts.podcast_id WHERE reviews.author_id = 'F7E5A318989779D'
Database: music_platform_2
Note: rating of 5 refers to rating = 5; 'Please Excuse My Dead Aunt Sally' is the title of podcast;
Question: How many ratings of 5 have been given to the podcast "Please Excuse My Dead Aunt Sally"?
SQL: SELECT count(reviews.rating) FROM podcasts INNER JOIN reviews ON reviews.podcast_id = podcasts.podcast_id WHERE podcasts.title = 'Please Excuse My Dead Aunt Sally' AND reviews.rating = 5
Database: music_platform_2
Note: "Please Excuse My Dead Aunty Sally" is the title of podcast; Average rating = Divide (Sum(rating), Count(rating));
Question: What is the average rating of the podcast "Please Excuse My Dead Aunt Sally"?
SQL: SELECT avg(reviews.rating) FROM podcasts INNER JOIN reviews ON reviews.podcast_id = podcasts.podcast_id WHERE podcasts.title = 'Please Excuse My Dead Aunt Sally'
Database: university
Note: have at least 80,000 students refers to num_students > 8000; year = 2011;
Question: How many universities have at least 80,000 students in the year 2011?
SQL: SELECT count(*) FROM university_year WHERE num_students > 80000 AND YEAR = 2011
Database: university
Note: award criteria refers to criteria_name = 'Award';
Question: What is the ranking system ID of the award criteria?
SQL: SELECT ranking_system_id FROM ranking_criteria WHERE criteria_name = 'Award'
Database: university
Note: state universities refers to university_name LIKE '%State%';
Question: How many state universities are there?
SQL: SELECT count(*) FROM university WHERE university_name LIKE '%State%'
Database: university
Note: highest student staff ratio refers to max(student_staff_ratio);
Question: What is the student staff ratio of the university with the highest student staff ratio of all time?
SQL: SELECT max(student_staff_ratio) FROM university_year WHERE student_staff_ratio = ( SELECT max(student_staff_ratio) FROM university_year )
Database: university
Question: How many criteria belong to ranking system ID 3?
SQL: SELECT count(id) FROM ranking_criteria WHERE ranking_system_id = 3
Database: university
Note: has only 1% of international students refers to pct_international_students = 1; between 2011 to 2015 refers to year BETWEEN 2011 AND 2015; id of university refers to university_id;
Question: What is the ID of the university that has only 1% of international students between 2011 to 2015?
SQL: SELECT university_id FROM university_year WHERE pct_international_students = 1 AND YEAR BETWEEN 2011 AND 2015
Database: university
Note: has the most universities refers to MAX(COUNT(id)); name of the country refers to country_name;
Question: Give the name of the country that has the most universities.
SQL: SELECT country.country_name FROM university INNER JOIN country ON university.country_id = country.id GROUP BY country.country_name ORDER BY count(university.university_name) DESC LIMIT 1
Database: university
Note: had the highest number of international students refers to max(pct_international_students); for 6 consecutive years refers to count(SUBTRACT(year, rm)) >= 6; name of university refers to university_name;
Question: What is the name of the university that had the highest number of international students for 6 consecutive years?
SQL: SELECT university.university_name FROM university_year INNER JOIN university ON university_year.university_id = university.id ORDER BY university_year.pct_international_students DESC LIMIT 1
Database: university
Note: In 2014 refers to year = 2014; leader refers to MAX(score); in the publications rank refers to criteria_name = 'Publications Rank'; name of university refers to university_name;
Question: In 2014, what is the name of the university which was considered a leader in the publications rank?
SQL: SELECT university.university_name FROM ranking_criteria INNER JOIN university_ranking_year ON ranking_criteria.id = university_ranking_year.ranking_criteria_id INNER JOIN university ON university.id = university_ranking_year.university_id WHERE ranking_criteria.criteria_name = 'Publications Rank' AND university_ranking_year.year = 2014 AND ranking_criteria.id = 17 ORDER BY university_ranking_year.score DESC LIMIT 1
Database: university
Note: has the lowest number of students refers to min(num_students); name of the university refers to university_name;
Question: What is the name of the university that has the lowest number of students of all time?
SQL: SELECT university.university_name FROM university_year INNER JOIN university ON university_year.university_id = university.id ORDER BY university_year.num_students LIMIT 1
Database: university
Note: in the United States of America refers to country_name = 'United States of America';
Question: How many universities are there in the United States of America?
SQL: SELECT count(*) FROM university INNER JOIN country ON university.country_id = country.id WHERE country.country_name = 'United States of America'
Database: university
Note: In 2016 refers to year = 2016; name of the university refers to university_name; in Australia refers to country_name = 'Australia'; in Citations criteria refers to criteria_name = 'Citations'; highest score refers to MAX(score);
Question: In 2016, what is the name of the university in Australia with the highest score in Citations criteria?
SQL: SELECT university.university_name FROM ranking_criteria INNER JOIN university_ranking_year ON ranking_criteria.id = university_ranking_year.ranking_criteria_id INNER JOIN university ON university.id = university_ranking_year.university_id INNER JOIN country ON country.id = university.country_id WHERE ranking_criteria.criteria_name = 'Citations' AND university_ranking_year.year = 2016 AND ranking_criteria.id = 4 AND country.country_name = 'Australia' ORDER BY university_ranking_year.score DESC LIMIT 1
Database: university
Note: between 2005 to 2015 refers to year BETWEEN 2005 AND 2015; scored 0 refers to score = 0; in Awards refers to criteria_name = 'Award';
Question: How many universities scored 0 in Awards between 2005 to 2015?
SQL: SELECT count(*) FROM ranking_criteria INNER JOIN university_ranking_year ON ranking_criteria.id = university_ranking_year.ranking_criteria_id WHERE ranking_criteria.criteria_name = 'Award' AND university_ranking_year.year BETWEEN 2005 AND 2015 AND university_ranking_year.score = 0
Database: university
Note: university of Oxford refers to university_name = 'university of Oxford'; which country refers to country_name;
Question: Which country is the University of Oxford located?
SQL: SELECT country.country_name FROM university INNER JOIN country ON university.country_id = country.id WHERE university_name = 'University of Oxford'
Database: university
Note: Yale university refers to university_name = 'Yale university'; a score of no less than 10 refers to score >= 10; in the Quality of Education Rank refers to criteria_name = 'Quality of Education Rank';
Question: How many times did the Yale University achieve a score of no less than 10 in the Quality of Education Rank?
SQL: SELECT count(*) FROM ranking_criteria INNER JOIN university_ranking_year ON ranking_criteria.id = university_ranking_year.ranking_criteria_id INNER JOIN university ON university.id = university_ranking_year.university_id WHERE university.university_name = 'Yale University' AND university_ranking_year.score >= 10 AND ranking_criteria.criteria_name = 'Quality of Education Rank'
Database: university
Note: names of the criteria refers to criteria_name; under Center for World university Rankings refers to system_name = 'Center for World university Rankings';
Question: What are the names of the criteria under Center for World University Rankings?
SQL: SELECT ranking_criteria.criteria_name FROM ranking_system INNER JOIN ranking_criteria ON ranking_system.id = ranking_criteria.ranking_system_id WHERE ranking_system.system_name = 'Center for World University Rankings'
Database: university
Note: have no less than 50,000 students refers to num_students > 50000; name of university refers to university_name;
Question: List the names of all the universities that have no less than 50,000 students in the year 2012.
SQL: SELECT university.university_name FROM university_year INNER JOIN university ON university_year.university_id = university.id WHERE university_year.num_students > 50000 AND university_year.year = 2012
Database: university
Note: Between 2011 to 2016 refers to year BETWEEN 2011 AND 2016; at least 50% of its students are international students refers to pct_international_students > 50; which country refers to country_name;
Question: Between 2011 to 2016, in which countries can you find the universities where at least 50% of its students are international students?
SQL: SELECT DISTINCT country.country_name FROM university INNER JOIN university_year ON university.id = university_year.university_id INNER JOIN country ON country.id = university.country_id WHERE university_year.pct_international_students > 50 AND university_year.year BETWEEN 2011 AND 2016
Database: university
Note: have no less than 20,000 female students refers to DIVidE(MULTIPLY(pct_female_students, num_students), 100) > 20000; in 2016 refers to year = 2016; located in the United States of America refers to country_name = 'United States of America';
Question: How many universities have no less than 20,000 female students in 2016? Identify how many of the said universities are located in the United States of America.
SQL: SELECT count(*) , sum(CASE WHEN country.country_name = 'United States of America' THEN 1 ELSE 0 END) AS nums_in_usa FROM university INNER JOIN university_year ON university.id = university_year.university_id INNER JOIN country ON country.id = university.country_id WHERE university_year.year = 2016 AND university_year.num_students * university_year.pct_female_students / 100 > 20000
Database: university
Note: highest number of international students refers to MAX(DIVidE(MULTIPLY(num_students, pct_international_students), 100)); name of university refers to university_name;
Question: What are the names of the top 5 universities with the highest number of international students?
SQL: SELECT DISTINCT university.university_name FROM university_year INNER JOIN university ON university_year.university_id = university.id ORDER BY (cast(university_year.num_students * university_year.pct_international_students AS REAL) / 100) DESC LIMIT 5
Database: university
Note: the largest student staff ratio refers to max(student_staff_ratio);
Question: What is the university ID of the university with the largest student staff ratio?
SQL: SELECT university_id FROM university_year ORDER BY student_staff_ratio DESC LIMIT 1
Database: university
Note: had the lowest number of students refers to MIN(num_students);
Question: Give the year where a university had the lowest number of students.
SQL: SELECT YEAR FROM university_year ORDER BY num_students ASC LIMIT 1
Database: university
Note: average percentage of female students refers to avg(pct_female_students);
Question: Compute the average percentage of female students.
SQL: SELECT avg(pct_female_students) FROM university_year
Database: university
Note: number of international students refers to DIVidE(MULTIPLY(pct_international_students, num_students), 100); in 2013 refers to year = 2013;
Question: Provide the number of international students and number of students in 2013 in university ID 20.
SQL: SELECT pct_international_students * num_students, num_students FROM university_year WHERE YEAR = 2013 AND university_id = 20
Database: university
Note: of Harvard university refers to university_name = 'Harvard university';
Question: What is the university ID of Harvard University?
SQL: SELECT id FROM university WHERE university_name = 'Harvard University'
Database: university
Note: in 2011 refers to year = 2011; score = 100;
Question: List the university ID of the university that scored 100 in 2011.
SQL: SELECT university_id FROM university_ranking_year WHERE score = 100 AND YEAR = 2011
Database: university
Note: criteria named Quality of Education Rank refers to criteria_name = 'Quality of Education Rank'; ranking system refers to system_name;
Question: Provide the ranking system of the ranking criteria named Quality of Education Rank.
SQL: SELECT ranking_system.system_name FROM ranking_system INNER JOIN ranking_criteria ON ranking_system.id = ranking_criteria.ranking_system_id WHERE ranking_criteria.criteria_name = 'Quality of Education Rank'
Database: university
Note: Harvard university refers to university_name = 'Harvard university'; in 2012 refers to year = 2012;
Question: What is the student staff ratio of Harvard University in 2012?
SQL: SELECT university_year.student_staff_ratio FROM university_year INNER JOIN university ON university_year.university_id = university.id WHERE university.university_name = 'Harvard University' AND university_year.year = 2012
Database: university
Note: location refers to country_name;
Question: Give the location of the university ID 112.
SQL: SELECT country.country_name FROM university INNER JOIN country ON university.country_id = country.id WHERE university.id = 112
Database: university
Note: located in Sweden refers to country_name = 'Sweden'; number of students refers to num_students;
Question: Calculate the total number of students in universities located in Sweden.
SQL: SELECT sum(university_year.num_students) FROM university INNER JOIN university_year ON university.id = university_year.university_id INNER JOIN country ON country.id = university.country_id WHERE country.country_name = 'Sweden'
Database: university
Note: Brown university refers to university_name = 'Brown university'; in 2014 refers to year = 2014;
Question: What is the ranking criteria ID of Brown University in 2014?
SQL: SELECT university_ranking_year.ranking_criteria_id FROM university_ranking_year INNER JOIN university ON university_ranking_year.university_id = university.id WHERE university.university_name = 'Brown University' AND university_ranking_year.year = 2014
Database: university
Note: name of universities refers to university_name; located in Spain refers to country_name = 'Spain';
Question: List the name of universities located in Spain.
SQL: SELECT university.university_name FROM university INNER JOIN country ON university.country_id = country.id WHERE country.country_name = 'Spain'
Database: university
Note: in 2015 refers to year = 2015;
Question: What is the criteria name of the university ID 32 in 2015?
SQL: SELECT ranking_criteria.criteria_name FROM ranking_criteria INNER JOIN university_ranking_year ON ranking_criteria.id = university_ranking_year.ranking_criteria_id WHERE university_ranking_year.university_id = 32 AND university_ranking_year.year = 2015
Database: university
Note: average score refers to avg(score); located in Brazil refers to country_name = 'Brazil';
Question: Compute the average score of the university located in Brazil.
SQL: SELECT avg(university_ranking_year.score) FROM university INNER JOIN university_ranking_year ON university.id = university_ranking_year.university_id INNER JOIN country ON country.id = university.country_id WHERE country.country_name = 'Brazil'
Database: university
Note: the most populated university refers to max(num_students); in 2014 refers to year = 2014;
Question: In which country does the most populated university in 2014 located ?
SQL: SELECT university.country_id FROM university_year INNER JOIN university ON university_year.university_id = university.id WHERE university_year.year = 2014 ORDER BY university_year.num_students DESC LIMIT 1
Database: university
Note: number of international students refers to DIVidE(MULTIPLY(num_students, pct_international_students), 100); in 2015 refers to year = 2015;
Question: Give the score and number of international students in university ID 100 in 2015.
SQL: SELECT cast(university_year.num_students * university_year.pct_international_students AS REAL) / 100, university_ranking_year.score FROM university_year INNER JOIN university_ranking_year ON university_year.university_id = university_ranking_year.university_id WHERE university_ranking_year.year = 2015 AND university_year.university_id = 100
Database: university
Note: student population refers to num_students; in 2013 refers to year = 2013;
Question: What is the student population of the university that scored 98 in 2013?
SQL: SELECT sum(university_year.num_students) FROM university_year INNER JOIN university_ranking_year ON university_year.university_id = university_ranking_year.university_id WHERE university_ranking_year.score = 98 AND university_year.year = 2013
Database: university
Note: ranking system called Center for World university Ranking refers to system_name = 'Center for World university Rankings';
Question: List the criteria names under the ranking system called Center for World University Ranking.
SQL: SELECT ranking_criteria.criteria_name FROM ranking_system INNER JOIN ranking_criteria ON ranking_system.id = ranking_criteria.ranking_system_id WHERE ranking_system.system_name = 'Center for World University Rankings'
Database: university
Note: number of students greater than 98% of the average student population of all universities refers to num_students >  MULTPLY(num_students, 0.98); in 2013 refers to year = 2013;
Question: Provide the country name of universities with the number of students greater than 98% of the average student population of all universities in 2013.
SQL: SELECT DISTINCT country.country_name FROM university INNER JOIN university_year ON university.id = university_year.university_id INNER JOIN country ON country.id = university.country_id WHERE university_year.year = 2013 AND university_year.num_students * 100 > ( SELECT avg(num_students) FROM university_year ) * 98
Database: university
Note: score below 80 refers to score < 80; in 2015 refers to year 2015; percentage of international students refers to DIVidE(SUM(DIVidE(MULTIPLY(num_students, pct_international_students), 100)), SUM(num_students));
Question: Among universities that score below 80 in 2015, what is the percentage of international students?
SQL: SELECT sum(cast(university_year.num_students * university_year.pct_international_students AS REAL) / 100) / count(*) * 100 FROM university_year INNER JOIN university_ranking_year ON university_year.university_id = university_ranking_year.university_id WHERE university_ranking_year.score < 80 AND university_year.year = 2015
Database: university
Note: in 2011 refers to year = 2011;
Question: How many students attended universities were there in 2011?
SQL: SELECT sum(num_students) FROM university_year WHERE YEAR = 2011
Database: university
Note: in 2011 refers to year = 2011; female students refers to SUM(DIVidE(MULTIPLY(num_students, pct_female_students), 100));
Question: Among all universities, how many female students were there in 2011?
SQL: SELECT sum(cast(num_students * pct_female_students AS REAL) / 100) FROM university_year WHERE YEAR = 2011
Database: university
Note: greatest student staff ratio of all time refers to max(student_staff_ratio);
Question: What is the student staff ratio at the university with the greatest student staff ratio of all time?
SQL: SELECT max(student_staff_ratio) FROM university_year ORDER BY student_staff_ratio DESC LIMIT 1
Database: university
Note: most students refers to MAX(num_students), in 2011 refers to year = 2011;
Question: What is the university ID with the most students in 2011?
SQL: SELECT university_id FROM university_year WHERE YEAR = 2011 ORDER BY num_students DESC LIMIT 1
Database: university
Note: institutions with over 50,000 students refers to num_students > 50000; in 2011 refers to year = 2011; percentage of oversea students of more than 10% refers to pct_international_students > 10;
Question: How many institutions with over 50,000 students in 2011 had a percentage of oversea students of more than 10%?
SQL: SELECT count(*) FROM university_year WHERE YEAR = 2011 AND num_students > 50000 AND pct_international_students > 10
Database: university
Note: in 2012 refers to year = 2012; highest percentage of female students  refers to MAX(pct_female_students); id of the university refers to university_id;
Question: Provide the ID of the university with the highest percentage of female students in 2012.
SQL: SELECT university_id FROM university_year WHERE YEAR = 2012 ORDER BY pct_female_students DESC LIMIT 1
Database: university
Note: had the highest reputation refers to MAX(score), in 2012 refers to year = 2012; which university refers to university_name;
Question: Which university had the highest reputation in 2012?
SQL: SELECT university.university_name FROM university_ranking_year INNER JOIN university ON university_ranking_year.university_id = university.id WHERE university_ranking_year.year = 2012 ORDER BY university_ranking_year.score DESC LIMIT 1
Database: university
Note: in 2011 refers to year = 2011; had the most students refers to MAX(num_students); name of university refers to university_name;
Question: Name the university that had the most students in 2011.
SQL: SELECT university.university_name FROM university_year INNER JOIN university ON university_year.university_id = university.id WHERE university_year.year = 2011 ORDER BY university_year.num_students DESC LIMIT 1
Database: university
Note: university's name refers to university_name; highest ranking score refers to MAX(score); in Teaching refers to criteria_name = 'Teaching';
Question: Indicate the university's name with the highest ranking score in Teaching.
SQL: SELECT university.university_name FROM university INNER JOIN university_ranking_year ON university.id = university_ranking_year.university_id INNER JOIN ranking_criteria ON ranking_criteria.id = university_ranking_year.ranking_criteria_id WHERE ranking_criteria.criteria_name = 'Teaching' ORDER BY university_ranking_year.score DESC LIMIT 1