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