db_id stringclasses 68 values | question stringlengths 24 325 | evidence stringlengths 0 580 | SQL stringlengths 23 728 |
|---|---|---|---|
world | What city has the highest population? | highest population refers to MAX(Population); | SELECT Name FROM City ORDER BY Population DESC LIMIT 1 |
world | Provide the district of the city with a population of 201843. | SELECT District FROM City WHERE population = 201843 | |
world | What country has the largest surface area? | largest surface area refers to MAX(SurfaceArea); | SELECT Name FROM Country ORDER BY SurfaceArea DESC LIMIT 1 |
world | How many countries have a life expectancy of 75.1? | SELECT COUNT(*) FROM Country WHERE LifeExpectancy = 75.1 | |
world | What is the year of independence of Brunei? | year of independence refers to IndepYear; Brunei is a name of country; | SELECT IndepYear FROM Country WHERE Name = 'Brunei' |
world | How many countries have no GNP? | no GNP refers to GNP = 0; | SELECT COUNT(*) FROM Country WHERE GNP = 0 |
world | What is the average surface area of all countries? | average surface area = AVG(SurfaceArea); | SELECT AVG(SurfaceArea) FROM Country |
world | How many languages are there in the country where Tocantins district belongs? | SELECT COUNT(DISTINCT T2.Language) FROM City AS T1 INNER JOIN CountryLanguage AS T2 ON T1.CountryCode = T2.CountryCode WHERE T1.District = 'Tocantins' | |
world | What are the districts that belong to the country with the largest surface area? | largest surface area refers to MAX(SurfaceArea); | SELECT T1.District FROM City AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.Code WHERE T2.Name = ( SELECT Name FROM Country ORDER BY SurfaceArea DESC LIMIT 1 ) |
world | How many cities are there in the country ruled by Kostis Stefanopoulos? | ruled by Kostis Stefanopoulos refers to HeadOfState = 'Kostis Stefanopoulos'; | SELECT COUNT(DISTINCT T1.Name) FROM City AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.Code WHERE T2.HeadOfState = 'Kostis Stefanopoulos' |
world | What are the official languages used in Greece? | official language refers to IsOfficial = 'T'; Greece is a name of country; | SELECT T1.Language FROM CountryLanguage AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.Code WHERE T1.IsOfficial = 'T' AND T2.name = 'Greece' |
world | Give the population of the country where Queimados city belongs. | SELECT T2.Population FROM City AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.Code WHERE T1.Name = 'Queimados' | |
world | What are the official languages of the country where you can find the city with the least population? | official language refers to IsOfficial = 'T'; least population refers to MIN(Population); | SELECT T2.Language FROM City AS T1 INNER JOIN CountryLanguage AS T2 ON T1.CountryCode = T2.CountryCode WHERE T2.IsOfficial = 'T' ORDER BY T1.Population ASC LIMIT 1 |
world | What is the surface area and GNP of the country where Namibe district belongs? | SELECT T2.SurfaceArea, T2.GNP FROM City AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.Code WHERE T1.District = 'Namibe' | |
world | List the names of the country that officially uses English as their language. | officially uses English as their language refers to `Language` = 'English' AND IsOfficial = 'T'; | SELECT T2.Name FROM CountryLanguage AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.Code WHERE T1.IsOfficial = 'T' AND T1.Language = 'English' |
world | What are the districts that belong to the country with the lowest surface area? | lowest surface area refers to MIN(SurfaceArea); | SELECT T1.District FROM City AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.Code ORDER BY T2.SurfaceArea ASC LIMIT 1 |
world | List down the country names of countries that have a GNP lower than 1000 and have Dutch as their language. | GNP lower than 1000 refers to GNP < 1000; Dutch as their language refers to `Language` = 'Dutch'; | SELECT T2.Name FROM CountryLanguage AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.Code WHERE T2.GNP < 1000 AND T1.IsOfficial = 'T' AND T1.Language = 'Dutch' |
world | What is the GNP of the country where district "Entre Rios" belongs? | SELECT T2.GNP FROM City AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.Code WHERE T1.District = 'Entre Rios' LIMIT 1 | |
world | What is the local name of the country where "The Valley" city belongs? | SELECT T2.LocalName FROM City AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.Code WHERE T1.Name = 'The Valley' | |
world | List down the cities belongs to the country that has surface area greater than 7000000. | surface area greater than 7000000 refers to SurfaceArea > 7000000; | SELECT T2.Name, T1.Name FROM City AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.Code WHERE T2.SurfaceArea > 7000000 |
world | What is the life expectancy of the countries that uses Japanese as their language? | uses Japanese as their language refers to `Language` = 'Japanese'; | SELECT AVG(T2.LifeExpectancy) FROM CountryLanguage AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.Code WHERE T1.Language = 'Japanese' |
world | How many cities are there in the country with the surface area of 652090? | SELECT T2.Name, COUNT(T1.Name) FROM City AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.Code WHERE T2.SurfaceArea = 652090 GROUP BY T2.Name | |
world | List down the languages of countries with an independence year between 1980 to 1995. | independence year between 1980 to 1995 refers to IndepYear BETWEEN 1980 AND 1995; | SELECT T2.Name, T1.Language FROM CountryLanguage AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.Code WHERE T2.IndepYear BETWEEN 1980 AND 1995 |
world | What is the life expectancy of the people living in Calama city? | SELECT T2.LifeExpectancy FROM City AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.Code WHERE T1.Name = 'Calama' | |
world | Provide the language used in the country ruled by Pierre Buyoya. | ruled by Pierre Buyoya refers to HeadOfState = 'Pierre Buyoya'; | SELECT T1.Language FROM CountryLanguage AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.Code WHERE T2.HeadOfState = 'Pierre Buyoya' |
world | In countries with constitutional monarchy, what is the percentage of cities located in the district of England? | constitutional monarchy refers to GovernmentForm = 'Constitutional Monarchy'; percentage = MULTIPLY(DIVIDE(SUM(GovernmentForm = 'Constitutional Monarchy' WHERE District = 'England'), COUNT(GovernmentForm = 'Constitutional Monarchy')), 100) | SELECT CAST(SUM(CASE WHEN T1.District = 'England' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM City AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.Code WHERE T2.GovernmentForm = 'Constitutional Monarchy' |
world | Among the cities with a population between 140000 and 150000, list the country that has life expectancy greater than 80% life expectancy of all countries. | life expectancy greater than 80% life expectancy of all countries refers to LifeExpectancy < (MULTIPLY(AVG(LifeExpectancy), 0.8)); | SELECT T2.Name FROM City AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.Code WHERE T1.Population BETWEEN 140000 AND 150000 GROUP BY T2.Name, LifeExpectancy HAVING LifeExpectancy < ( SELECT AVG(LifeExpectancy) FROM Country ) * 0.8 |
world | Among the countries that use Italian as their language, what is the percentage of republic countries? | use Italian as their language refers to `Language` = 'Italian'; percentage = MULTIPLY(DIVIDE(SUM(`Language` = 'Italian' WHERE GovernmentForm = 'Republic'), COUNT(`Language` = 'Italian')), 100); use Italian as their language refers to `Language` = 'Italian'; republic countries refers to GovernmentForm = 'Republic'; | SELECT CAST(SUM(CASE WHEN T2.GovernmentForm = 'Republic' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM CountryLanguage AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.Code WHERE T1.Language = 'Italian' |
music_platform_2 | How many podcasts are there in the category which has the most podcasts? | category which has the most podcast refers to the category with Max(count(podcast_id)) | SELECT COUNT(podcast_id) FROM categories WHERE category = ( SELECT category FROM categories GROUP BY category ORDER BY COUNT(podcast_id) DESC LIMIT 1 ) |
music_platform_2 | What is the percentage of the podcast that are categorized in four or more categories? | categorized in 4 or more refers to Count(category) > 4; percentage = Divide(Count(podcast_id(count(category) > 4)), Count(podcast_id)) * 100 | SELECT COUNT(T1.podcast_id) FROM ( SELECT podcast_id FROM categories GROUP BY podcast_id HAVING COUNT(category) >= 4 ) AS T1 |
music_platform_2 | Provide the itunes id and url for podcast titled 'Brown Suga Diaries'. | url refers to itunes_url; 'Brown Suga Diaries' is the title of podcast | SELECT itunes_id, itunes_url FROM podcasts WHERE title = 'Brown Suga Diaries' |
music_platform_2 | List all podcast with its itunes url for all title containing the word 'Dream'. | containing the word 'Dream' refers to title LIKE '%Dream%' | SELECT itunes_url FROM podcasts WHERE title LIKE '%Dream%' GROUP BY itunes_url |
music_platform_2 | Name all the categories for podcast titled 'I Heart My Life Show'. | 'I Hearty My Life Show' is the title of podcast | SELECT T1.category FROM categories AS T1 INNER JOIN podcasts AS T2 ON T2.podcast_id = T1.podcast_id WHERE T2.title = 'I Heart My Life Show' |
music_platform_2 | List all the podcast title and its itunes url under the 'society-culture' category. | SELECT T2.title, T2.itunes_url FROM categories AS T1 INNER JOIN podcasts AS T2 ON T2.podcast_id = T1.podcast_id WHERE T1.category = 'society-culture' | |
music_platform_2 | How many people rated 5 for the podcast which title contains the word 'spoiler' under the 'art' category '? | rated 5 refers to rating = 5; contain the word 'spoilers' refers to title like '%spoilers%'; 'art' is the category name; | SELECT COUNT(T3.podcast_id) FROM categories AS T1 INNER JOIN podcasts AS T2 ON T2.podcast_id = T1.podcast_id INNER JOIN reviews AS T3 ON T3.podcast_id = T2.podcast_id WHERE T2.title LIKE '%spoilers%' AND T1.category = 'arts' AND T3.rating = 5 |
music_platform_2 | Which category does the podcast titled 'SciFi Tech Talk' belong to? | podcast titled 'SciFi Tech Talk' refers to title = 'SciFi Tech Talk' | SELECT T1.category FROM categories AS T1 INNER JOIN podcasts AS T2 ON T2.podcast_id = T1.podcast_id WHERE T2.title = 'SciFi Tech Talk' |
music_platform_2 | List all the names of podcasts under the 'true crime' category. | name of the podcast refers to title of the podcast | SELECT T2.title FROM categories AS T1 INNER JOIN podcasts AS T2 ON T2.podcast_id = T1.podcast_id WHERE T1.category = 'true-crime' |
music_platform_2 | How many reviews does 'LifeAfter/The Message' have which were rated below 3? | LifeAfter/The Message' is the title of podcast; rated below 3 refers to rating < 3 | SELECT COUNT(T2.rating) FROM podcasts AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id WHERE T1.title = 'LifeAfter/The Message' AND T2.rating <= 3 |
music_platform_2 | Of the arts-books and arts-design categories, which one has more podcasts and what is the numerical difference between them? | arts-books' and 'arts-design' are category; numerical difference = Subtract(Count(podcast_id(category = 'arts-books')), Count(podcast_id(category = 'arts-design'))); one has much more podcast refers to Max(Count(podcast_id)) | SELECT ( SELECT category FROM categories WHERE category = 'arts-books' OR category = 'arts-design' GROUP BY category ORDER BY COUNT(podcast_id) DESC LIMIT 1 ) "has more podcasts" , ( SELECT SUM(CASE WHEN category = 'arts-books' THEN 1 ELSE 0 END) - SUM(CASE WHEN category = 'arts-design' THEN 1 ELSE 0 END) FROM categories ) "differenct BETWEEN arts-books and arts-design" |
music_platform_2 | How many total reviews runned at in June 2022 were added to the podcasts? | run at in June 2022 refers to run_at BETWEEN '2022-06-01 00:00:00' and '2022-06-30 23:59:59'; reviews refers to review_added | SELECT SUM(reviews_added) FROM runs WHERE run_at LIKE '2022-06-%' |
music_platform_2 | How many podcast reviews with a rating of 3 were created during the first quarter of 2015? | rating of 3 refers to rating = 3; created during the first quarter of 2015 refers to created_at BETWEEN'2015-01-01T00:00:00-07:00' and '2015-03-31T23:59:59-07:00' | SELECT COUNT(podcast_id) FROM reviews WHERE rating = 3 AND created_at BETWEEN '2015-01-01T00:00:00-07:00' AND '2015-03-31T23:59:59-07:00' |
music_platform_2 | Indicates the title of all podcasts in the fiction category. | SELECT T2.title FROM categories AS T1 INNER JOIN podcasts AS T2 ON T2.podcast_id = T1.podcast_id WHERE T1.category = 'fiction' | |
music_platform_2 | In how many categories were podcast reviews created in the last six months of 2016? List them. | created in last six months of 2016 refers to created_at BETWEEN '2016-07-01T00:00:00-07:00' and '2016-12-31T23:59:59-07:00' | SELECT COUNT(DISTINCT T1.category) FROM categories AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id WHERE T2.created_at BETWEEN '2016-07-01T00:00:00-07:00' AND '2016-12-31T23:59:59-07:00' |
music_platform_2 | What is the category and itune url of the title "Scaling Global"? | SELECT T1.category, T2.itunes_url FROM categories AS T1 INNER JOIN podcasts AS T2 ON T2.podcast_id = T1.podcast_id WHERE T2.title = 'Scaling Global' | |
music_platform_2 | What is the least common category? | least common category refers to Min(Count(category)) | SELECT category FROM categories GROUP BY category ORDER BY COUNT(podcast_id) ASC LIMIT 1 |
music_platform_2 | Which "music" podcast has the longest title? | music podcasts refers to category = 'music'; longest title refers to title = Max(length(title)) | SELECT T2.title FROM categories AS T1 INNER JOIN podcasts AS T2 ON T2.podcast_id = T1.podcast_id WHERE T1.category = 'music' ORDER BY LENGTH(T2.title) DESC LIMIT 1 |
music_platform_2 | List all the cagetories for all the podcasts with "jessica" in the title. | podcast with 'jessica' in title refers to title like '%jessica%' | SELECT category FROM categories WHERE podcast_id IN ( SELECT podcast_id FROM podcasts WHERE title LIKE '%jessica%' ) |
music_platform_2 | What is the category for the "Moist Boys" podcast? | "Moist Boys" refers to title of podcast | SELECT category FROM categories WHERE podcast_id IN ( SELECT podcast_id FROM podcasts WHERE title = 'Moist Boys' ) |
music_platform_2 | List the urls for all the "fiction-science-fiction" podcasts. | fiction-science-fiction podcasts refers to category = 'fiction-science-fiction'; urls refers to itunes_url | SELECT itunes_url FROM podcasts WHERE podcast_id IN ( SELECT podcast_id FROM categories WHERE category = 'fiction-science-fiction' ) |
music_platform_2 | How many reviews does "Planet Money" have? | "Planet Money" is the title of podcast | SELECT COUNT(T2.podcast_id) FROM podcasts AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id WHERE T1.title = 'Planet Money' |
music_platform_2 | Which category is the podcast "Scaling Global" under? | "Scaling Global" is the title of podcast | SELECT category FROM categories WHERE podcast_id IN ( SELECT podcast_id FROM podcasts WHERE title = 'Scaling Global' ) |
music_platform_2 | Please list the titles of all the podcasts under the category "arts-performing-arts". | category 'arts-performing-arts' refers to category = 'arts-performing-arts'; | SELECT DISTINCT T2.title FROM categories AS T1 INNER JOIN podcasts AS T2 ON T2.podcast_id = T1.podcast_id WHERE T1.category = 'arts-performing-arts' |
music_platform_2 | How many reviews are created for the podcast "Scaling Global" under? | "Scaling Global" is the title of podcast | SELECT COUNT(T2.content) FROM podcasts AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id WHERE T1.title = 'Scaling Global' |
music_platform_2 | Among the reviews for the podcast "Please Excuse My Dead Aunt Sally", how many of them are made in the year 2019? | "Please Excuse My Dead Aunt Sally" is the title of podcast; made in the year 2019 refers to created_at like '2019%' | SELECT COUNT(T2.created_at) FROM podcasts AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id WHERE T1.title = 'Please Excuse My Dead Aunt Sally' AND T2.created_at LIKE '2019-%' |
music_platform_2 | How many ratings of 5 have been given to the podcast "Please Excuse My Dead Aunt Sally"? | rating of 5 refers to rating = 5; 'Please Excuse My Dead Aunt Sally' is the title of podcast | SELECT COUNT(T2.rating) FROM podcasts AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id WHERE T1.title = 'Please Excuse My Dead Aunt Sally' AND T2.rating = 5 |
university | How many universities have at least 80,000 students in the year 2011? | have at least 80,000 students refers to num_students > 8000; year = 2011 | SELECT COUNT(*) FROM university_year WHERE num_students > 80000 AND year = 2011 |
university | What is the ranking system ID of the award criteria? | award criteria refers to criteria_name = 'Award'; | SELECT ranking_system_id FROM ranking_criteria WHERE criteria_name = 'Award' |
university | How many state universities are there? | state universities refers to university_name LIKE '%State%'; | SELECT COUNT(*) FROM university WHERE university_name LIKE '%State%' |
university | What is the student staff ratio of the university with the highest student staff ratio of all time? | highest student staff ratio refers to max(student_staff_ratio) | SELECT MAX(student_staff_ratio) FROM university_year WHERE student_staff_ratio = ( SELECT MAX(student_staff_ratio) FROM university_year ) |
university | How many criteria belong to ranking system ID 3? | SELECT COUNT(id) FROM ranking_criteria WHERE ranking_system_id = 3 | |
university | What is the ID of the university that has only 1% of international students between 2011 to 2015? | 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 | SELECT university_id FROM university_year WHERE pct_international_students = 1 AND year BETWEEN 2011 AND 2015 |
university | Give the name of the country that has the most universities. | has the most universities refers to MAX(COUNT(id)); name of the country refers to country_name | SELECT T2.country_name FROM university AS T1 INNER JOIN country AS T2 ON T1.country_id = T2.id GROUP BY T2.country_name ORDER BY COUNT(T1.university_name) DESC LIMIT 1 |
university | What is the name of the university that had the highest number of international students for 6 consecutive years? | 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; | SELECT T2.university_name FROM university_year AS T1 INNER JOIN university AS T2 ON T1.university_id = T2.id ORDER BY T1.pct_international_students DESC LIMIT 1 |
university | In 2014, what is the name of the university which was considered a leader in the publications rank? | 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; | SELECT T3.university_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 T1.criteria_name = 'Publications Rank' AND T2.year = 2014 AND T1.id = 17 ORDER BY T2.score DESC LIMIT 1 |
university | What is the name of the university that has the lowest number of students of all time? | has the lowest number of students refers to min(num_students); name of the university refers to university_name | 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 LIMIT 1 |
university | How many universities are there in the United States of America? | in the United States of America refers to country_name = 'United States of America'; | SELECT COUNT(*) FROM university AS T1 INNER JOIN country AS T2 ON T1.country_id = T2.id WHERE T2.country_name = 'United States of America' |
university | In 2016, what is the name of the university in Australia with the highest score in Citations criteria? | 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) | SELECT T3.university_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 INNER JOIN country AS T4 ON T4.id = T3.country_id WHERE T1.criteria_name = 'Citations' AND T2.year = 2016 AND T1.id = 4 AND T4.country_name = 'Australia' ORDER BY T2.score DESC LIMIT 1 |
university | How many universities scored 0 in Awards between 2005 to 2015? | between 2005 to 2015 refers to year BETWEEN 2005 AND 2015; scored 0 refers to score = 0; in Awards refers to criteria_name = 'Award' | SELECT COUNT(*) FROM ranking_criteria AS T1 INNER JOIN university_ranking_year AS T2 ON T1.id = T2.ranking_criteria_id WHERE T1.criteria_name = 'Award' AND T2.year BETWEEN 2005 AND 2015 AND T2.score = 0 |
university | Which country is the University of Oxford located? | University of Oxford refers to university_name = 'University of Oxford'; which country refers to country_name | SELECT T2.country_name FROM university AS T1 INNER JOIN country AS T2 ON T1.country_id = T2.id WHERE university_name = 'University of Oxford' |
university | How many times did the Yale University achieve a score of no less than 10 in the Quality of Education Rank? | 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' | SELECT COUNT(*) 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 = 'Yale University' AND T2.score >= 10 AND T1.criteria_name = 'Quality of Education Rank' |
university | What are the names of the criteria under Center for World University Rankings? | names of the criteria refers to criteria_name; under Center for World University Rankings refers to system_name = 'Center for World University Rankings'; | SELECT T2.criteria_name FROM ranking_system AS T1 INNER JOIN ranking_criteria AS T2 ON T1.id = T2.ranking_system_id WHERE T1.system_name = 'Center for World University Rankings' |
university | List the names of all the universities that have no less than 50,000 students in the year 2012. | have no less than 50,000 students refers to num_students > 50000; name of university refers to university_name; | SELECT T2.university_name FROM university_year AS T1 INNER JOIN university AS T2 ON T1.university_id = T2.id WHERE T1.num_students > 50000 AND T1.year = 2012 |
university | Between 2011 to 2016, in which countries can you find the universities where at least 50% of its students are international students? | 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 | SELECT DISTINCT T3.country_name 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.pct_international_students > 50 AND T2.year BETWEEN 2011 AND 2016 |
university | 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. | 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' | SELECT COUNT(*) , SUM(CASE WHEN T3.country_name = 'United States of America' THEN 1 ELSE 0 END) AS nums_in_usa 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 = 2016 AND T2.num_students * T2.pct_female_students / 100 > 20000 |
university | What is the university ID of the university with the largest student staff ratio? | the largest student staff ratio refers to max(student_staff_ratio) | SELECT university_id FROM university_year ORDER BY student_staff_ratio DESC LIMIT 1 |
university | Give the year where a university had the lowest number of students. | had the lowest number of students refers to MIN(num_students) | SELECT year FROM university_year ORDER BY num_students ASC LIMIT 1 |
university | Compute the average percentage of female students. | average percentage of female students refers to avg(pct_female_students) | SELECT AVG(pct_female_students) FROM university_year |
university | Provide the number of international students and number of students in 2013 in university ID 20. | number of international students refers to DIVIDE(MULTIPLY(pct_international_students, num_students), 100); in 2013 refers to year = 2013 | SELECT pct_international_students * num_students, num_students FROM university_year WHERE year = 2013 AND university_id = 20 |
university | What is the university ID of Harvard University? | of Harvard University refers to university_name = 'Harvard University'; | SELECT id FROM university WHERE university_name = 'Harvard University' |
university | List the university ID of the university that scored 100 in 2011. | in 2011 refers to year = 2011; score = 100 | SELECT university_id FROM university_ranking_year WHERE score = 100 AND year = 2011 |
university | Provide the ranking system of the ranking criteria named Quality of Education Rank. | criteria named Quality of Education Rank refers to criteria_name = 'Quality of Education Rank'; ranking system refers to system_name; | 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 = 'Quality of Education Rank' |
university | What is the student staff ratio of Harvard University in 2012? | Harvard University refers to university_name = 'Harvard University'; in 2012 refers to year = 2012 | SELECT T1.student_staff_ratio FROM university_year AS T1 INNER JOIN university AS T2 ON T1.university_id = T2.id WHERE T2.university_name = 'Harvard University' AND T1.year = 2012 |
university | Give the location of the university ID 112. | location refers to country_name | SELECT T2.country_name FROM university AS T1 INNER JOIN country AS T2 ON T1.country_id = T2.id WHERE T1.id = 112 |
university | Calculate the total number of students in universities located in Sweden. | located in Sweden refers to country_name = 'Sweden'; number of students refers to num_students | SELECT 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 = 'Sweden' |
university | What is the ranking criteria ID of Brown University in 2014? | Brown University refers to university_name = 'Brown University'; in 2014 refers to year = 2014 | SELECT T1.ranking_criteria_id FROM university_ranking_year AS T1 INNER JOIN university AS T2 ON T1.university_id = T2.id WHERE T2.university_name = 'Brown University' AND T1.year = 2014 |
university | List the name of universities located in Spain. | name of universities refers to university_name; located in Spain refers to country_name = 'Spain'; | SELECT T1.university_name FROM university AS T1 INNER JOIN country AS T2 ON T1.country_id = T2.id WHERE T2.country_name = 'Spain' |
university | What is the criteria name of the university ID 32 in 2015? | in 2015 refers to year = 2015 | SELECT T1.criteria_name FROM ranking_criteria AS T1 INNER JOIN university_ranking_year AS T2 ON T1.id = T2.ranking_criteria_id WHERE T2.university_id = 32 AND T2.year = 2015 |
university | Compute the average score of the university located in Brazil. | average score refers to avg(score); located in Brazil refers to country_name = 'Brazil'; | SELECT AVG(T2.score) 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 T3.country_name = 'Brazil' |
university | In which country does the most populated university in 2014 located ? | the most populated university refers to max(num_students); in 2014 refers to year = 2014 | SELECT T2.country_id FROM university_year AS T1 INNER JOIN university AS T2 ON T1.university_id = T2.id WHERE T1.year = 2014 ORDER BY T1.num_students DESC LIMIT 1 |
university | Give the score and number of international students in university ID 100 in 2015. | number of international students refers to DIVIDE(MULTIPLY(num_students, pct_international_students), 100); in 2015 refers to year = 2015 | SELECT CAST(T1.num_students * T1.pct_international_students AS REAL) / 100, T2.score FROM university_year AS T1 INNER JOIN university_ranking_year AS T2 ON T1.university_id = T2.university_id WHERE T2.year = 2015 AND T1.university_id = 100 |
university | What is the student population of the university that scored 98 in 2013? | student population refers to num_students; in 2013 refers to year = 2013 | SELECT SUM(T1.num_students) FROM university_year AS T1 INNER JOIN university_ranking_year AS T2 ON T1.university_id = T2.university_id WHERE T2.score = 98 AND T1.year = 2013 |
university | List the criteria names under the ranking system called Center for World University Ranking. | ranking system called Center for World University Ranking refers to system_name = 'Center for World University Rankings'; | SELECT T2.criteria_name FROM ranking_system AS T1 INNER JOIN ranking_criteria AS T2 ON T1.id = T2.ranking_system_id WHERE T1.system_name = 'Center for World University Rankings' |
university | Provide the country name of universities with the number of students greater than 98% of the average student population of all universities in 2013. | 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 | SELECT DISTINCT T3.country_name 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 = 2013 AND T2.num_students * 100 > ( SELECT AVG(num_students) FROM university_year ) * 98 |
university | Among universities that score below 80 in 2015, what is the percentage of international students? | 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)) | SELECT SUM(CAST(T1.num_students * T1.pct_international_students AS REAL) / 100) / COUNT(*) * 100 FROM university_year AS T1 INNER JOIN university_ranking_year AS T2 ON T1.university_id = T2.university_id WHERE T2.score < 80 AND T1.year = 2015 |
university | How many students attended universities were there in 2011? | in 2011 refers to year = 2011; | SELECT SUM(num_students) FROM university_year WHERE year = 2011 |
university | Among all universities, how many female students were there in 2011? | in 2011 refers to year = 2011; female students refers to SUM(DIVIDE(MULTIPLY(num_students, pct_female_students), 100)) | SELECT SUM(CAST(num_students * pct_female_students AS REAL) / 100) FROM university_year WHERE year = 2011 |
university | What is the university ID with the most students in 2011? | most students refers to MAX(num_students), in 2011 refers to year = 2011 | SELECT university_id FROM university_year WHERE year = 2011 ORDER BY num_students DESC LIMIT 1 |
university | How many institutions with over 50,000 students in 2011 had a percentage of oversea students of more than 10%? | 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; | SELECT COUNT(*) FROM university_year WHERE year = 2011 AND num_students > 50000 AND pct_international_students > 10 |
university | Provide the ID of the university with the highest percentage of female students in 2012. | 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 | SELECT university_id FROM university_year WHERE year = 2012 ORDER BY pct_female_students DESC LIMIT 1 |
university | Which university had the highest reputation in 2012? | had the highest reputation refers to MAX(score), in 2012 refers to year = 2012; which university refers to university_name; | SELECT T2.university_name FROM university_ranking_year AS T1 INNER JOIN university AS T2 ON T1.university_id = T2.id WHERE T1.year = 2012 ORDER BY T1.score DESC LIMIT 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.