Chinastark/bird_dataset huggingface dataset:
Database: university
Note: Harvard university's refers to university_name = 'Harvard university'; in 2011 refers to year = 2011; percentage of Harvard university's international students refers to pct_international_students;
Question: What is the percentage of Harvard university's international students in 2011?
SQL: SELECT university_year.pct_international_students FROM university_year INNER JOIN university ON university_year.university_id = university.id WHERE university_year.year = 2011 AND university.university_name = 'Harvard University'
Database: university
Note: in 2011 refers to year 2011; female students refers to DIVidE(MULTIPLY(pct_female_students, num_students), 100); Stanford university refers to university_name = 'Stanford university';
Question: How many female students were there at Stanford University in 2011?
SQL: SELECT cast(university_year.num_students * university_year.pct_female_students AS REAL) / 100 FROM university_year INNER JOIN university ON university_year.university_id = university.id WHERE university_year.year = 2011 AND university.university_name = 'Stanford University'
Database: university
Note: Harvard university refers to university_name = 'Harvard university'; nation refers to country_name;
Question: In which nation is Harvard University located?
SQL: SELECT country.country_name FROM university INNER JOIN country ON university.country_id = country.id WHERE university.university_name = 'Harvard University'
Database: university
Note: Teaching criteria refers to criteria_name = 'Teaching'; name of the ranking system refers to system_name;
Question: What is the name of the ranking system for Teaching criteria?
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 = 'Teaching'
Database: university
Note: in Argentina refers to country_name = 'Argentina';  most famous refers to MAX(SUM(score));
Question: Name the most famous university in Argentina.
SQL: SELECT university.university_name 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 = 'Argentina' GROUP BY university.university_name ORDER BY sum(university_ranking_year.score) DESC LIMIT 1
Database: university
Note: In Argentina refers to country_name = 'Argentina';
Question: In Argentina, how many universities are there?
SQL: SELECT count(*) FROM university INNER JOIN country ON university.country_id = country.id WHERE country.country_name = 'Argentina'
Database: university
Note: in 2011 refers to year 2011; more than 100,000 students refers to num_students > 100000; which university refers to university_name;
Question: Which universities have more than 100,000 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 AND university_year.num_students > 100000
Database: university
Note: ranking system Center for World university Rankings refers to system_name = 'Center for World university Rankings';
Question: How many criteria are associated with ranking system Center for World University Rankings?
SQL: SELECT count(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: in 2011 refers to year 2011; earned a score of 90 refers to score = 90;
Question: How many students at the university earned a score of 90 in 2011?
SQL: SELECT count(*) FROM university_year INNER JOIN university_ranking_year ON university_year.university_id = university_ranking_year.university_id WHERE university_ranking_year.score = 90 AND university_year.year = 2011
Database: university
Note: most international students refers to MAX(SUM(DIVidE(MULTIPLE(pct_international_students, num_students), 100))); name of university refers to university_name;
Question: What are the top three universities with the most international students?
SQL: SELECT DISTINCT university.university_name FROM university_year INNER JOIN university ON university_year.university_id = university.id GROUP BY university.university_name ORDER BY sum(university_year.num_students * university_year.pct_international_students / 100) DESC LIMIT 3
Database: university
Note: Harvard university refers to university_name = 'Harvard university'; difference in overall student enrollment and international student refers to SUBTRACT(SUM(num_students), SUM(DIVidE(MULTIPLY(pct_international_students, num_students), 100))); from 2011 to 2012 refers to year BETWEEN 2011 AND 2012;
Question: What is the difference in overall student enrollment and international student enrollment at the Harvard university from 2011 to 2012?
SQL: SELECT sum(university_year.num_students) - sum(cast(university_year.num_students * university_year.pct_international_students AS REAL) / 100) FROM university_year INNER JOIN university ON university_year.university_id = university.id WHERE university.university_name = 'Harvard University' AND university_year.year BETWEEN 2011 AND 2012
Database: university
Note: in 2011 refers to year 2011; had over 30000 students refers to num_students > 30000;
Question: How many universities had over 30000 students in 2011?
SQL: SELECT count(*) FROM university_year WHERE YEAR = 2011 AND num_students > 30000
Database: university
Note: university of Tokyo refers to university_name = 'university of Tokyo';
Question: What is the country ID of the University of Tokyo?
SQL: SELECT country_id FROM university WHERE university_name = 'University of Tokyo'
Database: university
Note: the Center for World university Rankings refers to system_name = 'Center for World university Rankings';
Question: Provide the ranking system ID of the Center for World University Rankings.
SQL: SELECT id FROM ranking_system WHERE system_name = 'Center for World University Rankings'
Database: university
Note: Publications Rank criteria refers to criteria_name = 'Publications Rank';
Question: What is the ID of the Publications Rank criteria?
SQL: SELECT id FROM ranking_criteria WHERE criteria_name = 'Publications Rank'
Database: university
Note: had above 30% of international students refers to pct_international_students > 30; in 2013 refers to year = 2013;
Question: How many universities had above 30% of international students in 2013?
SQL: SELECT count(*) FROM university_year WHERE pct_international_students > 30 AND YEAR = 2013
Database: university
Note: in 2011 refers to year 2011; less than 50 scores refers to score < 50;
Question: How many universities got less than 50 scores under ranking criteria ID 6 in 2011?
SQL: SELECT count(*) FROM university_ranking_year WHERE ranking_criteria_id = 6 AND YEAR = 2011 AND score < 50
Database: university
Note: number of students refers to num_students; Yale university refers to university_name = 'Yale university'; in 2016 refers to year = 2016;
Question: Provide the number of students at Yale University in 2016.
SQL: SELECT university_year.num_students FROM university_year INNER JOIN university ON university_year.university_id = university.id WHERE university.university_name = 'Yale University' AND university_year.year = 2016
Database: university
Note: in Denmark refers to country_name = 'Denmark'; name of university refers to university_name;
Question: List the universities in Denmark.
SQL: SELECT university.university_name FROM university INNER JOIN country ON university.country_id = country.id WHERE country.country_name = 'Denmark'
Database: university
Note: university of Auckland refers to university_name = 'university of Auckland'; in 2015 refers to year = 2015; number of staff refers to DIVidE(num_students, student_staff_ratio);
Question: Provide the number of staff at the University of Auckland in 2015.
SQL: SELECT cast(sum(university_year.num_students) AS REAL) / sum(university_year.student_staff_ratio) FROM university_year INNER JOIN university ON university_year.university_id = university.id WHERE university.university_name = 'University of Auckland' AND university_year.year = 2015
Database: university
Note: the university of SÃ£o Paulo refers to university_name = 'university of São Paulo'; which country refers to country_name;
Question: Which country has the University of SÃ£o Paulo?
SQL: SELECT country.country_name FROM university INNER JOIN country ON university.country_id = country.id WHERE university.university_name = 'University of São Paulo'
Database: university
Note: Harvard university refers to university_name = 'Harvard university'; international students refers to DIVidE(MULTIPLY(num_students, pct_international_students), 100); in 2012 refers to year = 2012;
Question: How many international students attended Harvard University in 2012?
SQL: SELECT cast(university_year.num_students * university_year.pct_international_students AS REAL) / 100 FROM university INNER JOIN university_year ON university.id = university_year.university_id WHERE university.university_name = 'Harvard University' AND university_year.year = 2012
Database: university
Note: female students refers to DIVidE(MULTIPLY(pct_female_students, num_students), 100); at Arizona State university refers to university_name = 'Arizona State university'; in 2014 refers to year = 2014;
Question: Calculate the number of female students at Arizona State University in 2014.
SQL: SELECT cast(university_year.num_students * university_year.pct_female_students AS REAL) / 100 FROM university INNER JOIN university_year ON university.id = university_year.university_id WHERE university.university_name = 'Arizona State University' AND university_year.year = 2014
Database: university
Note: got the highest scores refers to MAX(SUM(score));
Question: Provide the universities which got the highest scores.
SQL: SELECT university.university_name FROM university INNER JOIN university_ranking_year ON university.id = university_ranking_year.university_id GROUP BY university.university_name ORDER BY sum(university_ranking_year.score) DESC LIMIT 1
Database: university
Note: Shanghai Ranking system refers to system_name = 'Shanghai Ranking'; ranking criteria refers to criteria_name;
Question: List the ranking criteria under the Shanghai Ranking system.
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 = 'Shanghai Ranking'
Database: university
Note: in 2011 refers to year 2011; got the lowest score refers to MIN(score), teaching criteria refers to criteria_name = 'Teaching';
Question: In 2011, which university got the lowest score in teaching 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 WHERE ranking_criteria.criteria_name = 'Teaching' AND university_ranking_year.year = 2011 ORDER BY university_ranking_year.score ASC LIMIT 1
Database: university
Note: the "Quality of Education Rank" criteria refers to criteria_name = 'Quality of Education Rank'; ranking system refers to system_name;
Question: Provide the ranking system name for the "Quality of Education Rank" criteria.
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: got a score above 80 refers to score > 80; under International criteria refers to criteria_name = 'International'; in 2016 refers to year = 2016; highest score refers to MAX(score);
Question: How many percent of universities got a score above 80 under International criteria in 2016? Among them, name the university which got the highest score.
SQL: SELECT cast(sum(CASE WHEN university_ranking_year.score > 80 THEN 1 ELSE 0 END) AS REAL) / count(*), ( 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 = 'International' AND university_ranking_year.year = 2016 AND university_ranking_year.score > 80 ORDER BY university_ranking_year.score DESC LIMIT 1 ) AS MAX 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 = 'International' AND university_ranking_year.year = 2016
Database: university
Note: Harvard university refers to university_name = 'Harvard university'; in 2005 refers to year = 2005; ranking criteria refers to criteria_name;
Question: Provide the ranking criteria and scores in 2005 that were received by Harvard University.
SQL: SELECT ranking_criteria.criteria_name, university_ranking_year.score 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 = 'Harvard University' AND university_ranking_year.year = 2005
Database: university
Note: under Alumni criteria refers to criteria_name = 'Alumni'; in 2008 refers to year = 2008; average score refers to DIVidE(SUM(score), COUNT(university_id));
Question: Calculate the average score per university under Alumni criteria in 2008.
SQL: SELECT avg(university_ranking_year.score) FROM ranking_criteria INNER JOIN university_ranking_year ON ranking_criteria.id = university_ranking_year.ranking_criteria_id WHERE ranking_criteria.criteria_name = 'Alumni' AND university_ranking_year.year = 2008
Database: university
Note: highest number of international students refers to MAX(DIVidE(MULTIPLY(num_students, pct_international_students), 100)); in 2015 refers to year = 2015; name of university refers to university_name;
Question: Name the university and country which had the highest number of international students in 2015.
SQL: SELECT university.university_name, 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 = 2015 ORDER BY university_year.num_students DESC LIMIT 1
Database: university
Note: in 2011 refers to year 2011;
Question: How many students were there in university ID 1 in 2011?
SQL: SELECT num_students FROM university_year WHERE YEAR = 2011 AND university_id = 1
Database: university
Note: in 2011 refers to year 2011; with the most students refers to MAX(num_students); id of the university refers to university_id;
Question: What is the ID of the university 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: in 2011 refers to year 2011; student staff ratio of over 15 refers to student_staff_ratio > 15; id of the university refers to university_id;
Question: Please list the IDs of the universities with a student staff ratio of over 15 in 2011.
SQL: SELECT university_id FROM university_year WHERE YEAR = 2011 AND student_staff_ratio > 15
Database: university
Note: in 2011 refers to year 2011; with over 20000 students refers to num_students > 20000; international students percentage of over 25% refers to pct_international_students > 25;
Question: Among the universities with over 20000 students in 2011, how many of them have an international students percentage of over 25% in the same year?
SQL: SELECT count(*) FROM university_year WHERE YEAR = 2011 AND pct_international_students > 25 AND num_students > 20000
Database: university
Note: in 2011 refers to year 2011; top 3 female students percentage refers to MAX(pct_female_students) LIMIT 3; id of the university refers to university_id;
Question: Please list the IDs of the universities with the top 3 female students percentage in 2011.
SQL: SELECT university_id FROM university_year WHERE YEAR = 2011 ORDER BY pct_female_students DESC LIMIT 3
Database: university
Note: have the most students refers to MAX(num_students);
Question: In which year did university ID 1 have the most students?
SQL: SELECT YEAR FROM university_year WHERE university_id = 1 ORDER BY num_students DESC LIMIT 1
Database: university
Note: in 2011 refers to year 2011; Harvard university refers to university_name = 'Harvard university';
Question: How many students did Harvard University have in 2011?
SQL: SELECT university_year.num_students FROM university_year INNER JOIN university ON university_year.university_id = university.id WHERE university.university_name = 'Harvard University' AND university_year.year = 2011
Database: university
Note: in 2011 refers to year 2011; the most international students refers to MAX(DIVidE(MULTIPLY(num_students,  pct_international_students), 100)); name of university refers to university_id;
Question: What is the name of the university with the most international 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.pct_international_students DESC LIMIT 1
Database: university
Note: in Australia refers to country_name = 'Australia'; name of university refers to university_name;
Question: Please list the names of all the universities in Australia.
SQL: SELECT university.university_name FROM university INNER JOIN country ON university.country_id = country.id WHERE country.country_name = 'Australia'
Database: university
Note: in 2011 refers to year 2011; have more than 15000 students refers to num_students > 15000; in Australia refers to country_name = 'Australia';
Question: Among the universities in Australia, how many of them have more than 15000 students in 2011?
SQL: SELECT count(*) 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 = 'Australia' AND university_year.year = 2011 AND university_year.num_students > 15000
Database: university
Note: Harvard university refers to university_name = 'Harvard university'; which country refers to country_name;
Question: Which country is Harvard University in?
SQL: SELECT country.country_name FROM university INNER JOIN country ON university.country_id = country.id WHERE university.university_name = 'Harvard University'
Database: university
Note: with the highest score refers to MAX(score); in teaching refers to criteria_name = 'Teaching'; name of university refers to university_name;
Question: What is the name of the university with the highest score in teaching in the year 2011?
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 = 'Teaching' AND university_ranking_year.year = 2011 ORDER BY university_ranking_year.score DESC LIMIT 1
Database: university
Note: in 2011 refers to year 2011; in teaching refers to  criteria_name = 'Teaching'; score in teaching of over 90 refers to score > 90; name of university refers to university_name;
Question: Please list the names of the universities with a score in teaching of over 90 in 2011.
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 = 'Teaching' AND university_ranking_year.year = 2011 AND university_ranking_year.score > 90
Database: university
Note: in 2011 refers to year 2011; in teaching refers to  criteria_name = 'Teaching'; score in teaching of over 90 refers to score > 90; in the United States of America refers to country_name = 'United States of America';
Question: Among the universities with a score in teaching of over 90 in 2011, how many of them are in the United States of America?
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 ranking_criteria.criteria_name = 'Teaching' AND university_ranking_year.year = 2011 AND university_ranking_year.score > 90
Database: university
Note: in 2011 refers to year 2011; Harvard university refers to university_name = 'Harvard university'; names of all the ranking criteria refers to criteria_name;
Question: Please list the names of all the ranking criteria of Harvard University in 2011.
SQL: SELECT ranking_criteria.criteria_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 university.university_name = 'Harvard University' AND university_ranking_year.year = 2011
Database: university
Note: in 2011 refers to year 2011; that got 98 refers to score = 98; in teaching refers to criteria_name = 'Teaching'; name of university refers to university_name;
Question: What are the names of the universities that got 98 in teaching in 2011?
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 = 'Teaching' AND university_ranking_year.year = 2011 AND university_ranking_year.score = 98
Database: university
Note: scored under 60 refers to score < 60; in 2011 refers to year 2011; in teaching refers to criteria_name = 'Teaching'; in the United States of America refers to country_name = 'United States of America';
Question: Please list the names of all the universities that scored under 60 in teaching in 2011 and are in the United States of America.
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 country.country_name = 'United States of America' AND university_ranking_year.year = 2011 AND university_ranking_year.score < 60 AND ranking_criteria.criteria_name = 'Teaching'
Database: university
Note: in 2011 refers to year 2011; in Australia refers to country_name = 'Australia'; student staff ratio of over 15 refers to student_staff_ratio > 15;
Question: Among the universities in Australia, how many of them have a student staff ratio of over 15 in 2011?
SQL: SELECT count(*) 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 = 'Australia' AND university_year.student_staff_ratio > 15 AND university_year.year = 2011
Database: university
Note: in 2011 refers to year 2011; female students refers to DIVidE(MULTIPLY(pct_female_students, num_students), 100); Stanford university refers to university_name = 'Stanford university';
Question: How many female students did Stanford University have in 2011?
SQL: SELECT cast(university_year.num_students * university_year.pct_female_students AS REAL) / 100 FROM university_year INNER JOIN university ON university_year.university_id = university.id WHERE university_year.year = 2011 AND university.university_name = 'Stanford University'