Chinastark/bird_dataset huggingface dataset:
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'; percentage refers to DIVidE(COUNT(country_name = 'United States of America'), COUNT(id));
Question: Among the universities with a score in teaching of over 90 in 2011, what is the percentage of those in the United States of America?
SQL: SELECT cast(sum(CASE WHEN country.country_name = 'United States of America' THEN 1 ELSE 0 END) AS REAL) * 100 / count(*) AS per 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 = 'Teaching' AND university_ranking_year.year = 2011 AND university_ranking_year.score > 90
Database: university
Note: "Center for World university Rankings" refers to system_name = 'Center for World university Rankings';
Question: Give the id of "Center for World University Rankings".
SQL: SELECT id FROM ranking_system WHERE system_name = 'Center for World University Rankings'
Database: university
Note: university of Veterinary Medicine Vienna refers to university_name = 'university of Veterinary Medicine Vienna';
Question: Which country is University of Veterinary Medicine Vienna located in? Give its country id.
SQL: SELECT country_id FROM university WHERE university_name = 'University of Veterinary Medicine Vienna'
Database: university
Note: criteria "Citations Rank" refers to criteria_name = 'Citations Rank';
Question: What is the id of the criteria "Citations Rank"?
SQL: SELECT id FROM ranking_criteria WHERE criteria_name = 'Citations Rank'
Database: university
Note: university of Orléans refers to university_name = 'university of Orléans';
Question: Show the id of University of Orléans.
SQL: SELECT id FROM university WHERE university_name = 'University of Orléans'
Database: university
Note: number of students refers to num_students; in 2013 refers to year = 2013;
Question: For the university id 268, show its number of students in 2013.
SQL: SELECT num_students FROM university_year WHERE university_id = 268 AND YEAR = 2013
Database: university
Note: name of country refers to country_name;
Question: Show the name of country id 66.
SQL: SELECT country_name FROM country WHERE id = 66
Database: university
Note: McMaster university refers to university_name = 'McMaster university'; which country refers to country_name;
Question: Which country is McMaster University located in?
SQL: SELECT country.country_name FROM university INNER JOIN country ON university.country_id = country.id WHERE university.university_name = 'McMaster University'
Database: university
Note: Turkish universities refers to country_name = 'Turkey';
Question: How many Turkish universities are there in the database?
SQL: SELECT count(*) FROM university INNER JOIN country ON university.country_id = country.id WHERE country.country_name = 'Turkey'
Database: university
Note: in 2011 refers to year 2011; the most students refers to MAX(num_students); which university refers to university_name;
Question: Which university had the most students in 2011? Show its name.
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: in 2011 refers to year 2011; in university of Michigan refers to university_name = 'university of Michigan';
Question: How many students were there in University of Michigan in 2011?
SQL: SELECT count(*) FROM university INNER JOIN university_year ON university.id = university_year.university_id WHERE university.university_name = 'University of Michigan' AND university_year.year = 2011
Database: university
Note: Chosun university refers to university_name = 'Chosun university'; in 2015 refers to year = 2015; on "Influence Rank" refers to criteria_name = 'Influence Rank';
Question: For Chosun University, what was its score on "Influence Rank" in 2015?
SQL: SELECT 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 = 'Chosun University' AND ranking_criteria.criteria_name = 'Influence Rank' AND university_ranking_year.year = 2015
Database: university
Note: percentage of the international students refers to pct_international_students; in 2015 refers to year = 2015; in university of Oslo refers to university_name = 'university of Oslo';
Question: What is the percentage of the international students in University of Oslo in 2015?
SQL: SELECT university_year.pct_international_students FROM university INNER JOIN university_year ON university.id = university_year.university_id WHERE university.university_name = 'University of Oslo' AND university_year.year = 2015
Database: university
Note: university of Southampton refers to university_name = 'university of Southampton'; in 2015 refers to year = 2015; score the best refers to MAX(score); which criteria refers to criteria_name;
Question: For the University of Southampton in 2015, on which criteria did it score the best?
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 = 'University of Southampton' AND university_ranking_year.year = 2015 ORDER BY university_ranking_year.score DESC LIMIT 1
Database: university
Note: criteria "Total Shanghai" refers to criteria_name = 'Total Shanghai'; which ranking system refers to system_name;
Question: Which ranking system is criteria "Total Shanghai" in?
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 = 'Total Shanghai'
Database: university
Note: female students refers to DIVidE(MULTIPLY(pct_female_students, num_students), 100); in Pierre and Marie Curie university refers to university_name = 'Pierre and Marie Curie university'; in 2015 refers to year = 2015;
Question: How many female students were there in Pierre and Marie Curie University in 2015?
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 = 2015 AND university.university_name = 'Pierre and Marie Curie University'
Database: university
Note: university of Florida refers to university_name = 'university of Florida'; in 2014 refers to year = 2014; in "N and S" refers to criteria_name = 'N and S';
Question: What was the score for University of Florida in "N and S" in 2014?
SQL: SELECT 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 = 'University of Florida' AND university_ranking_year.year = 2014 AND ranking_criteria.criteria_name = 'N and S'
Database: university
Note: international students refers to DIVidE(MULTIPLY(num_students, pct_international_students), 100); university of Wisconsin-Madison refers to university_name = 'university of Wisconsin-Madison'; in 2013 refers to year = 2013;
Question: Calculate the number of international students of University of Wisconsin-Madison in 2013.
SQL: SELECT 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_year.year = 2013 AND university.university_name = 'University of Wisconsin-Madison'
Database: university
Note: lowest number of students refers to MIN(num_students); in 2015 refers to year = 2015; name of university refers to university_name;
Question: Show the name of the university with the lowest number of students in 2015.
SQL: SELECT university.university_name FROM university_year INNER JOIN university ON university_year.university_id = university.id WHERE university_year.year = 2015 ORDER BY university_year.num_students ASC LIMIT 1
Database: university
Note: Joseph Fourier university refers to university_name = 'Joseph Fourier university'; university of Ottawa refers to university_name = 'university of Ottawa'; in 2013 refers to year = 2013; how many times more refers to DIVidE(SUM(num_students where university_name = 'university of Ottawa'), SUM(num_students where university_name = 'Joseph Fourier university'));
Question: How many times more was the number of students of University of Ottawa than Joseph Fourier University in 2013?
SQL: SELECT cast(sum(CASE WHEN university.university_name = 'University of Ottawa' THEN university_year.num_students ELSE 0 END) AS REAL) / sum(CASE WHEN university.university_name = 'Joseph Fourier University' THEN university_year.num_students ELSE 0 END) FROM university_year INNER JOIN university ON university_year.university_id = university.id WHERE university_year.year = 2013
Database: university
Note: average number of criterias refers to DIVidE(SUM(id), 3); "Times Higher Education World university Ranking", "Shanghai Ranking" and "Center for World university Rankings" refers to system_name IN ('Times Higher Education World university Ranking', 'Shanghai Ranking', 'Center for World university Rankings');
Question: Calculate the average number of criterias among "Times Higher Education World University Ranking","Shanghai Ranking" and "Center for World University Rankings".
SQL: SELECT (sum(CASE WHEN ranking_system.system_name = 'Center for World University Rankings' THEN 1 ELSE 0 END) + sum(CASE WHEN ranking_system.system_name = 'Shanghai Ranking' THEN 1 ELSE 0 END) + sum(CASE WHEN ranking_system.system_name = 'Times Higher Education World University Ranking' THEN 1 ELSE 0 END)) / 3 FROM ranking_system INNER JOIN ranking_criteria ON ranking_system.id = ranking_criteria.ranking_system_id
Database: university
Note: average number of students refers to avg(num_students); in 2012 refers to year = 2012;
Question: Calculate the average number of students of all universities in 2012.
SQL: SELECT avg(num_students) FROM university_year WHERE YEAR = 2012
Database: university
Note: in 2015 refers to year = 2015;
Question: What is the score of university ID 68 in 2015?
SQL: SELECT score FROM university_ranking_year WHERE YEAR = 2015 AND university_id = 68
Database: university
Note: Cyprus refers to country_name = 'Cyprus';
Question: Provide the country ID of Cyprus.
SQL: SELECT id FROM country WHERE country_name = 'Cyprus'
Database: university
Note: largest percentage of international students refers to MAX(pct_international_students); id of university refers to university_id;
Question: What is the ID of university with the largest percentage of international students?
SQL: SELECT university_id FROM university_year ORDER BY pct_international_students DESC LIMIT 1
Database: university
Question: Provide the criteria name of the ranking criteria ID 13.
SQL: SELECT criteria_name FROM ranking_criteria WHERE id = 13
Database: university
Note: average score refers to avg(score); in 2012 refers to year = 2012;
Question: What is the average score of all universities in 2012?
SQL: SELECT avg(score) FROM university_ranking_year WHERE YEAR = 2012
Database: university
Note: 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;
Question: In years 2011 to 2013, what is the total number of female students in university ID 40?
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: university
Note: average score refers to avg(score); between year 2013 to 2015 refers to year BETWEEN 2013 AND 2015;
Question: Calculate the average score of university ID 79 between year 2013 to 2015.
SQL: SELECT avg(score) FROM university_ranking_year WHERE YEAR BETWEEN 2013 AND 2015 AND university_id = 79
Database: university
Question: Give the student staff ratio of university ID 35.
SQL: SELECT student_staff_ratio FROM university_year WHERE university_id = 35
Database: university
Note: most populated university refers to MAX(num_students); in 2011 refers to year = 2011;
Question: Provide the score of the most populated university in 2011.
SQL: SELECT university_ranking_year.score FROM university_year INNER JOIN university_ranking_year ON university_year.university_id = university_ranking_year.university_id WHERE university_year.year = 2011 ORDER BY university_year.num_students DESC LIMIT 1
Database: university
Note: Harvard university refers to university_name = 'Harvard university'; scored 100 refers to score = 100;
Question: Give the criteria name where Harvard University scored 100.
SQL: SELECT DISTINCT ranking_criteria.criteria_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 university.university_name = 'Harvard University' AND university_ranking_year.score = 100
Database: university
Note: found in Turkey refers to country_name = 'Turkey';
Question: Provide the university name and ID of the university found in Turkey.
SQL: SELECT university.university_name, university.id FROM university INNER JOIN country ON university.country_id = country.id WHERE country.country_name = 'Turkey'
Database: university
Note: ranking system called Shanghai Ranking refers to system_name = 'Shanghai Ranking';
Question: What is the total number of ranking criteria under the ranking system called Shanghai Ranking?
SQL: SELECT count(*) 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: name of university refers to university_name;
Question: Give the name and score of the university ID 124.
SQL: SELECT university.university_name, university_ranking_year.score FROM university_ranking_year INNER JOIN university ON university_ranking_year.university_id = university.id WHERE university.id = 124
Database: university
Note: in 2011 refers to year 2011; female students refers to DIVidE(MULTIPLY(num_students, pct_female_students), 100); university of Pennsylvania refers to a university name;
Question: How many female students are there in University of Pennsylvania 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 = 'University of Pennsylvania'
Database: university
Note: scored below 50 refers to score < 50; all universities refers to university_name;
Question: List down all universities that scored below 50.
SQL: SELECT DISTINCT university.university_name FROM university_ranking_year INNER JOIN university ON university_ranking_year.university_id = university.id WHERE university_ranking_year.score < 50
Database: university
Note: located in Japan refers to country_name = 'Japan';
Question: How many universities are located in Japan?
SQL: SELECT count(*) FROM university INNER JOIN country ON university.country_id = country.id WHERE country.country_name = 'Japan'
Database: university
Note: highest number of female students refers to MAX(SUBTRACT(num_students, DIVidE(MULTIPLY(num_students, pct_female_students), 100))); name of university refers to university_name;
Question: Provide the name of the university with the highest number of male students.
SQL: SELECT university.university_name FROM university_year INNER JOIN university ON university_year.university_id = university.id ORDER BY university_year.num_students * university_year.pct_female_students / 100 - university_year.num_students DESC LIMIT 1
Database: university
Note: scored 70 and below refers to score < 70; in 2016 refers to year = 2016;
Question: List the countries of universities that scored 70 and below in 2016.
SQL: SELECT DISTINCT country.country_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 university_ranking_year.score < 70 AND university_ranking_year.year = 2016
Database: university
Note: in 2011 refers to year 2011; number of male students refers to SUBTRACT(num_students, DIVidE(MULTIPLY(num_students, pct_male_students), 100)); in Emory university refers to university_name = 'Emory university';
Question: Calculate number of male students in Emory University in 2011.
SQL: SELECT cast((university_year.num_students - (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.university_name = 'Emory University' AND university_year.year = 2011
Database: university
Note: Johns Hopkins university refers to university_name = 'Johns Hopkins university'; which country refers to country_name;
Question: In which country does Johns Hopkins University located?
SQL: SELECT country.country_name FROM university INNER JOIN country ON university.country_id = country.id WHERE university.university_name = 'Johns Hopkins University'
Database: university
Note: number of students ranges from 400 to 1000 refers to num_students BETWEEN 400 AND 1000; name of university refers to university_name;
Question: Give the names of universities with number of students ranges from 400 to 1000.
SQL: SELECT DISTINCT university.university_name FROM university_year INNER JOIN university ON university_year.university_id = university.id WHERE university_year.num_students BETWEEN 400 AND 1000
Database: university
Note: Brown university refers to university_name = 'Brown university'; score the highest refers to MAX(score);
Question: In what year does the Brown University score the highest?
SQL: SELECT university_ranking_year.year FROM university_ranking_year INNER JOIN university ON university_ranking_year.university_id = university.id WHERE university.university_name = 'Brown University' ORDER BY university_ranking_year.score DESC LIMIT 1
Database: university
Note: average score refers to avg(score); Emory university refers to university_name = 'Emory university'; from 2011 to 2016 refers to year BETWEEN 2011 AND 2016;
Question: Calculate the average score of Emory University from 2011 to 2016.
SQL: SELECT avg(university_ranking_year.score) FROM university_ranking_year INNER JOIN university ON university_ranking_year.university_id = university.id WHERE university.university_name = 'Emory University' AND university_ranking_year.year BETWEEN 2011 AND 2016
Database: university
Note: most number of students refers to MAX(num_students); in 2015 refers to year = 2015; name of university refers to university_name;
Question: Give the name of the university with the most number of students in 2015.
SQL: SELECT university.university_name FROM university_year INNER JOIN university ON university_year.university_id = university.id WHERE university_year.year = 2015 ORDER BY university_year.num_students DESC LIMIT 1
Database: university
Note: in 2011 refers to year 2011; female students refers to DIVidE(MULTIPLY(num_students, pct_female_students), 100); location refers to country_name;
Question: What is the location and number of female students in university ID 23 in 2011?
SQL: SELECT country.country_name, 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 INNER JOIN country ON country.id = university.country_id WHERE university_year.year = 2011 AND university.id = 23
Database: university
Note: scored 40 refers to score = 40; in teaching refers to criteria_name = 'Teaching';
Question: How many universities scored 40 in teaching criteria?
SQL: SELECT count(*) FROM ranking_criteria INNER JOIN university_ranking_year ON ranking_criteria.id = university_ranking_year.ranking_criteria_id WHERE university_ranking_year.score = 40 AND ranking_criteria.criteria_name = 'Teaching' AND university_ranking_year.score = 40
Database: university
Note: female students refers to DIVidE(MULTIPLY(num_students, pct_female_students), 100); in United States of America refers to country_name = 'United States of America'; percentage refers to DIVidE(SUM(DIVidE(MULTIPLY(num_students, pct_female_students), 100)), SUM(num_students));
Question: Among the universities in United States of America, what is the percentage of female students in year 2016?
SQL: SELECT sum(cast(university_year.pct_female_students * university_year.num_students AS REAL) / 100) * 100 / 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 = 'United States of America' AND university_year.year = 2016
Database: university
Note: international students refers to DIVidE(MULTIPLY(num_students, pct_international_students), 100); difference refers to SUBTRACT(SUM(num_students), SUM(DIVidE(MULTIPLY(num_students, pct_international_students), 100))); in university of Tokyo refers to university_name = 'university of Tokyo'; from 2011 to 2014 refers to year BETWEEN 2011 AND 2014;
Question: Calculate the difference between the total number of students and the number of international international students in Univeristy of Tokyo from 2011 to 2014.
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_year.year BETWEEN 2011 AND 2014 AND university.university_name = 'University of Tokyo'
Database: university
Note: in 2015 refers to year = 2015; score less than 28% refers to score < MULTIPLY(avg(score), 0.28) where year = 2015; names of universities refers to university_name;
Question: List the names of universities with a score less than 28% of the average score of all universities in 2015.
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 = 2015 AND university_ranking_year.score * 100 < ( SELECT avg(score) * 28 FROM university_ranking_year WHERE YEAR = 2015 )
Database: sales_in_weather
Note: store no. 1 refers to store_nbr = 1; item no. 9 refers to item_nbr = 9; on 2012/1/1 refers to date = '2012-01-01';
Question: How many units of item no.9 were sold in store no.1 on 2012/1/1?
SQL: SELECT units FROM sales_in_weather WHERE `date` = '2012-01-01' AND store_nbr = 1 AND item_nbr = 9
Database: sales_in_weather
Note: store no. 1 refers to store_nbr = 1; item no. 9 refers to item_nbr = 9; in January refers to SUBSTR(date, 1, 4) = '2012' and SUBSTR(date, 6, 2) = '01';
Question: How many units of item no.9 were sold in store no.1 in total in January, 2012?
SQL: SELECT sum(units) FROM sales_in_weather WHERE substr(`date`, 6, 2) = '01' AND substr(`date`, 1, 4) = '2012' AND item_nbr = 9 AND store_nbr = 1
Database: sales_in_weather
Note: sold on 2012/1/1 refers to date = '2012-01-01'; in store no.1 refers to store_nbr = 1; item sold the best refers to Max(units);
Question: What is the ID of the item that sold the best on 2012/1/1 in store no.1?
SQL: SELECT item_nbr FROM sales_in_weather WHERE `date` = '2012-01-01' AND store_nbr = 1 ORDER BY units DESC LIMIT 1