1sf/bird-sql-train-with-schema huggingface dataset:
Database: music_platform_2
Tables: runs, podcasts, reviews, categories
Columns (table index, column name): -1, *, 0, run_at, 0, max_rowid, 0, reviews_added, 1, podcast_id, 1, itunes_id, 1, slug, 1, itunes_url, 1, title, 2, podcast_id, 2, title, 2, content, 2, rating, 2, author_id, 2, created_at, 3, podcast_id, 3, category
Question: How many reviews are created for the podcast "Scaling Global" under?
Evidence: "Scaling Global" is the title of podcast
SQL: 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'
Database: music_platform_2
Tables: runs, podcasts, reviews, categories
Columns (table index, column name): -1, *, 0, run_at, 0, max_rowid, 0, reviews_added, 1, podcast_id, 1, itunes_id, 1, slug, 1, itunes_url, 1, title, 2, podcast_id, 2, title, 2, content, 2, rating, 2, author_id, 2, created_at, 3, podcast_id, 3, category
Question: Among the reviews for the podcast "Please Excuse My Dead Aunt Sally", how many of them are made in the year 2019?
Evidence: "Please Excuse My Dead Aunt Sally" is the title of podcast; made in the year 2019 refers to created_at like '2019%'
SQL: 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-%'
Database: music_platform_2
Tables: runs, podcasts, reviews, categories
Columns (table index, column name): -1, *, 0, run_at, 0, max_rowid, 0, reviews_added, 1, podcast_id, 1, itunes_id, 1, slug, 1, itunes_url, 1, title, 2, podcast_id, 2, title, 2, content, 2, rating, 2, author_id, 2, created_at, 3, podcast_id, 3, category
Question: Please list the titles of the podcasts for which the author whose ID is F7E5A318989779D has written a review.
Evidence: author whose ID is F7E5A318989779D refers to author_id = 'F7E5A318989779D'
SQL: SELECT T2.title FROM podcasts AS T1 INNER JOIN reviews AS T2 ON T2.podcast_id = T1.podcast_id WHERE T2.author_id = 'F7E5A318989779D'
Database: music_platform_2
Tables: runs, podcasts, reviews, categories
Columns (table index, column name): -1, *, 0, run_at, 0, max_rowid, 0, reviews_added, 1, podcast_id, 1, itunes_id, 1, slug, 1, itunes_url, 1, title, 2, podcast_id, 2, title, 2, content, 2, rating, 2, author_id, 2, created_at, 3, podcast_id, 3, category
Question: How many ratings of 5 have been given to the podcast "Please Excuse My Dead Aunt Sally"?
Evidence: rating of 5 refers to rating = 5; 'Please Excuse My Dead Aunt Sally' is the title of podcast
SQL: 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
Database: music_platform_2
Tables: runs, podcasts, reviews, categories
Columns (table index, column name): -1, *, 0, run_at, 0, max_rowid, 0, reviews_added, 1, podcast_id, 1, itunes_id, 1, slug, 1, itunes_url, 1, title, 2, podcast_id, 2, title, 2, content, 2, rating, 2, author_id, 2, created_at, 3, podcast_id, 3, category
Question: What is the average rating of the podcast "Please Excuse My Dead Aunt Sally"?
Evidence: "Please Excuse My Dead Aunty Sally" is the title of podcast; Average rating = Divide (Sum(rating), Count(rating))
SQL: SELECT AVG(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'
Database: university
Tables: country, ranking_system, ranking_criteria, university, university_ranking_year, university_year
Columns (table index, column name): -1, *, 0, id, 0, country_name, 1, id, 1, system_name, 2, id, 2, ranking_system_id, 2, criteria_name, 3, id, 3, country_id, 3, university_name, 4, university_id, 4, ranking_criteria_id, 4, year, 4, score, 5, university_id, 5, year, 5, num_students, 5, student_staff_ratio, 5, pct_international_students, 5, pct_female_students
Question: How many universities have at least 80,000 students in the year 2011?
Evidence: have at least 80,000 students refers to num_students > 8000; year = 2011
SQL: SELECT COUNT(*) FROM university_year WHERE num_students > 80000 AND year = 2011
Database: university
Tables: country, ranking_system, ranking_criteria, university, university_ranking_year, university_year
Columns (table index, column name): -1, *, 0, id, 0, country_name, 1, id, 1, system_name, 2, id, 2, ranking_system_id, 2, criteria_name, 3, id, 3, country_id, 3, university_name, 4, university_id, 4, ranking_criteria_id, 4, year, 4, score, 5, university_id, 5, year, 5, num_students, 5, student_staff_ratio, 5, pct_international_students, 5, pct_female_students
Question: What is the ranking system ID of the award criteria?
Evidence: award criteria refers to criteria_name = 'Award';
SQL: SELECT ranking_system_id FROM ranking_criteria WHERE criteria_name = 'Award'
Database: university
Tables: country, ranking_system, ranking_criteria, university, university_ranking_year, university_year
Columns (table index, column name): -1, *, 0, id, 0, country_name, 1, id, 1, system_name, 2, id, 2, ranking_system_id, 2, criteria_name, 3, id, 3, country_id, 3, university_name, 4, university_id, 4, ranking_criteria_id, 4, year, 4, score, 5, university_id, 5, year, 5, num_students, 5, student_staff_ratio, 5, pct_international_students, 5, pct_female_students
Question: How many state universities are there?
Evidence: state universities refers to university_name LIKE '%State%';
SQL: SELECT COUNT(*) FROM university WHERE university_name LIKE '%State%'
Database: university
Tables: country, ranking_system, ranking_criteria, university, university_ranking_year, university_year
Columns (table index, column name): -1, *, 0, id, 0, country_name, 1, id, 1, system_name, 2, id, 2, ranking_system_id, 2, criteria_name, 3, id, 3, country_id, 3, university_name, 4, university_id, 4, ranking_criteria_id, 4, year, 4, score, 5, university_id, 5, year, 5, num_students, 5, student_staff_ratio, 5, pct_international_students, 5, pct_female_students
Question: What is the student staff ratio of the university with the highest student staff ratio of all time?
Evidence: highest student staff ratio refers to max(student_staff_ratio)
SQL: SELECT MAX(student_staff_ratio) FROM university_year WHERE student_staff_ratio = ( SELECT MAX(student_staff_ratio) FROM university_year )
Database: university
Tables: country, ranking_system, ranking_criteria, university, university_ranking_year, university_year
Columns (table index, column name): -1, *, 0, id, 0, country_name, 1, id, 1, system_name, 2, id, 2, ranking_system_id, 2, criteria_name, 3, id, 3, country_id, 3, university_name, 4, university_id, 4, ranking_criteria_id, 4, year, 4, score, 5, university_id, 5, year, 5, num_students, 5, student_staff_ratio, 5, pct_international_students, 5, pct_female_students
Question: How many criteria belong to ranking system ID 3?
SQL: SELECT COUNT(id) FROM ranking_criteria WHERE ranking_system_id = 3
Database: university
Tables: country, ranking_system, ranking_criteria, university, university_ranking_year, university_year
Columns (table index, column name): -1, *, 0, id, 0, country_name, 1, id, 1, system_name, 2, id, 2, ranking_system_id, 2, criteria_name, 3, id, 3, country_id, 3, university_name, 4, university_id, 4, ranking_criteria_id, 4, year, 4, score, 5, university_id, 5, year, 5, num_students, 5, student_staff_ratio, 5, pct_international_students, 5, pct_female_students
Question: What is the ID of the university that has only 1% of international students between 2011 to 2015?
Evidence: 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
SQL: SELECT university_id FROM university_year WHERE pct_international_students = 1 AND year BETWEEN 2011 AND 2015
Database: university
Tables: country, ranking_system, ranking_criteria, university, university_ranking_year, university_year
Columns (table index, column name): -1, *, 0, id, 0, country_name, 1, id, 1, system_name, 2, id, 2, ranking_system_id, 2, criteria_name, 3, id, 3, country_id, 3, university_name, 4, university_id, 4, ranking_criteria_id, 4, year, 4, score, 5, university_id, 5, year, 5, num_students, 5, student_staff_ratio, 5, pct_international_students, 5, pct_female_students
Question: Give the name of the country that has the most universities.
Evidence: has the most universities refers to MAX(COUNT(id)); name of the 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 GROUP BY T2.country_name ORDER BY COUNT(T1.university_name) DESC LIMIT 1
Database: university
Tables: country, ranking_system, ranking_criteria, university, university_ranking_year, university_year
Columns (table index, column name): -1, *, 0, id, 0, country_name, 1, id, 1, system_name, 2, id, 2, ranking_system_id, 2, criteria_name, 3, id, 3, country_id, 3, university_name, 4, university_id, 4, ranking_criteria_id, 4, year, 4, score, 5, university_id, 5, year, 5, num_students, 5, student_staff_ratio, 5, pct_international_students, 5, pct_female_students
Question: What is the name of the university that had the highest number of international students for 6 consecutive years?
Evidence: 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;
SQL: 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
Database: university
Tables: country, ranking_system, ranking_criteria, university, university_ranking_year, university_year
Columns (table index, column name): -1, *, 0, id, 0, country_name, 1, id, 1, system_name, 2, id, 2, ranking_system_id, 2, criteria_name, 3, id, 3, country_id, 3, university_name, 4, university_id, 4, ranking_criteria_id, 4, year, 4, score, 5, university_id, 5, year, 5, num_students, 5, student_staff_ratio, 5, pct_international_students, 5, pct_female_students
Question: In 2014, what is the name of the university which was considered a leader in the publications rank?
Evidence: 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;
SQL: 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
Database: university
Tables: country, ranking_system, ranking_criteria, university, university_ranking_year, university_year
Columns (table index, column name): -1, *, 0, id, 0, country_name, 1, id, 1, system_name, 2, id, 2, ranking_system_id, 2, criteria_name, 3, id, 3, country_id, 3, university_name, 4, university_id, 4, ranking_criteria_id, 4, year, 4, score, 5, university_id, 5, year, 5, num_students, 5, student_staff_ratio, 5, pct_international_students, 5, pct_female_students
Question: What is the name of the university that has the lowest number of students of all time?
Evidence: has the lowest number of students refers to min(num_students); name of the 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 LIMIT 1
Database: university
Tables: country, ranking_system, ranking_criteria, university, university_ranking_year, university_year
Columns (table index, column name): -1, *, 0, id, 0, country_name, 1, id, 1, system_name, 2, id, 2, ranking_system_id, 2, criteria_name, 3, id, 3, country_id, 3, university_name, 4, university_id, 4, ranking_criteria_id, 4, year, 4, score, 5, university_id, 5, year, 5, num_students, 5, student_staff_ratio, 5, pct_international_students, 5, pct_female_students
Question: How many universities are there in the United States of America?
Evidence: in the United States of America refers to country_name = 'United States of America';
SQL: 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'
Database: university
Tables: country, ranking_system, ranking_criteria, university, university_ranking_year, university_year
Columns (table index, column name): -1, *, 0, id, 0, country_name, 1, id, 1, system_name, 2, id, 2, ranking_system_id, 2, criteria_name, 3, id, 3, country_id, 3, university_name, 4, university_id, 4, ranking_criteria_id, 4, year, 4, score, 5, university_id, 5, year, 5, num_students, 5, student_staff_ratio, 5, pct_international_students, 5, pct_female_students
Question: In 2016, what is the name of the university in Australia with the highest score in Citations criteria?
Evidence: 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)
SQL: 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
Database: university
Tables: country, ranking_system, ranking_criteria, university, university_ranking_year, university_year
Columns (table index, column name): -1, *, 0, id, 0, country_name, 1, id, 1, system_name, 2, id, 2, ranking_system_id, 2, criteria_name, 3, id, 3, country_id, 3, university_name, 4, university_id, 4, ranking_criteria_id, 4, year, 4, score, 5, university_id, 5, year, 5, num_students, 5, student_staff_ratio, 5, pct_international_students, 5, pct_female_students
Question: How many universities scored 0 in Awards between 2005 to 2015?
Evidence: between 2005 to 2015 refers to year BETWEEN 2005 AND 2015; scored 0 refers to score = 0; in Awards refers to criteria_name = 'Award'
SQL: 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
Database: university
Tables: country, ranking_system, ranking_criteria, university, university_ranking_year, university_year
Columns (table index, column name): -1, *, 0, id, 0, country_name, 1, id, 1, system_name, 2, id, 2, ranking_system_id, 2, criteria_name, 3, id, 3, country_id, 3, university_name, 4, university_id, 4, ranking_criteria_id, 4, year, 4, score, 5, university_id, 5, year, 5, num_students, 5, student_staff_ratio, 5, pct_international_students, 5, pct_female_students
Question: Which country is the University of Oxford located?
Evidence: University of Oxford refers to university_name = 'University of Oxford'; 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 university_name = 'University of Oxford'
Database: university
Tables: country, ranking_system, ranking_criteria, university, university_ranking_year, university_year
Columns (table index, column name): -1, *, 0, id, 0, country_name, 1, id, 1, system_name, 2, id, 2, ranking_system_id, 2, criteria_name, 3, id, 3, country_id, 3, university_name, 4, university_id, 4, ranking_criteria_id, 4, year, 4, score, 5, university_id, 5, year, 5, num_students, 5, student_staff_ratio, 5, pct_international_students, 5, pct_female_students
Question: How many times did the Yale University achieve a score of no less than 10 in the Quality of Education Rank?
Evidence: 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'
SQL: 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'
Database: university
Tables: country, ranking_system, ranking_criteria, university, university_ranking_year, university_year
Columns (table index, column name): -1, *, 0, id, 0, country_name, 1, id, 1, system_name, 2, id, 2, ranking_system_id, 2, criteria_name, 3, id, 3, country_id, 3, university_name, 4, university_id, 4, ranking_criteria_id, 4, year, 4, score, 5, university_id, 5, year, 5, num_students, 5, student_staff_ratio, 5, pct_international_students, 5, pct_female_students
Question: What are the names of the criteria under Center for World University Rankings?
Evidence: names of the criteria refers to criteria_name; under Center for World University Rankings refers to system_name = 'Center for World University Rankings';
SQL: 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'
Database: university
Tables: country, ranking_system, ranking_criteria, university, university_ranking_year, university_year
Columns (table index, column name): -1, *, 0, id, 0, country_name, 1, id, 1, system_name, 2, id, 2, ranking_system_id, 2, criteria_name, 3, id, 3, country_id, 3, university_name, 4, university_id, 4, ranking_criteria_id, 4, year, 4, score, 5, university_id, 5, year, 5, num_students, 5, student_staff_ratio, 5, pct_international_students, 5, pct_female_students
Question: List the names of all the universities that have no less than 50,000 students in the year 2012.
Evidence: have no less than 50,000 students refers to num_students > 50000; 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.num_students > 50000 AND T1.year = 2012
Database: university
Tables: country, ranking_system, ranking_criteria, university, university_ranking_year, university_year
Columns (table index, column name): -1, *, 0, id, 0, country_name, 1, id, 1, system_name, 2, id, 2, ranking_system_id, 2, criteria_name, 3, id, 3, country_id, 3, university_name, 4, university_id, 4, ranking_criteria_id, 4, year, 4, score, 5, university_id, 5, year, 5, num_students, 5, student_staff_ratio, 5, pct_international_students, 5, pct_female_students
Question: Between 2011 to 2016, in which countries can you find the universities where at least 50% of its students are international students?
Evidence: 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
SQL: 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
Database: university
Tables: country, ranking_system, ranking_criteria, university, university_ranking_year, university_year
Columns (table index, column name): -1, *, 0, id, 0, country_name, 1, id, 1, system_name, 2, id, 2, ranking_system_id, 2, criteria_name, 3, id, 3, country_id, 3, university_name, 4, university_id, 4, ranking_criteria_id, 4, year, 4, score, 5, university_id, 5, year, 5, num_students, 5, student_staff_ratio, 5, pct_international_students, 5, pct_female_students
Question: How many universities have no less than 20,000 female students in 2016? Identify how many of the said universities are located in the United States of America.
Evidence: 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'
SQL: 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
Database: university
Tables: country, ranking_system, ranking_criteria, university, university_ranking_year, university_year
Columns (table index, column name): -1, *, 0, id, 0, country_name, 1, id, 1, system_name, 2, id, 2, ranking_system_id, 2, criteria_name, 3, id, 3, country_id, 3, university_name, 4, university_id, 4, ranking_criteria_id, 4, year, 4, score, 5, university_id, 5, year, 5, num_students, 5, student_staff_ratio, 5, pct_international_students, 5, pct_female_students
Question: What are the names of the top 5 universities with the highest number of international students?
Evidence: highest number of international students refers to MAX(DIVIDE(MULTIPLY(num_students, pct_international_students), 100)); 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 ORDER BY (CAST(T1.num_students * T1.pct_international_students AS REAL) / 100) DESC LIMIT 5
Database: university
Tables: country, ranking_system, ranking_criteria, university, university_ranking_year, university_year
Columns (table index, column name): -1, *, 0, id, 0, country_name, 1, id, 1, system_name, 2, id, 2, ranking_system_id, 2, criteria_name, 3, id, 3, country_id, 3, university_name, 4, university_id, 4, ranking_criteria_id, 4, year, 4, score, 5, university_id, 5, year, 5, num_students, 5, student_staff_ratio, 5, pct_international_students, 5, pct_female_students
Question: What is the university ID of the university with the largest student staff ratio?
Evidence: the largest student staff ratio refers to max(student_staff_ratio)
SQL: SELECT university_id FROM university_year ORDER BY student_staff_ratio DESC LIMIT 1
Database: university
Tables: country, ranking_system, ranking_criteria, university, university_ranking_year, university_year
Columns (table index, column name): -1, *, 0, id, 0, country_name, 1, id, 1, system_name, 2, id, 2, ranking_system_id, 2, criteria_name, 3, id, 3, country_id, 3, university_name, 4, university_id, 4, ranking_criteria_id, 4, year, 4, score, 5, university_id, 5, year, 5, num_students, 5, student_staff_ratio, 5, pct_international_students, 5, pct_female_students
Question: Give the year where a university had the lowest number of students.
Evidence: had the lowest number of students refers to MIN(num_students)
SQL: SELECT year FROM university_year ORDER BY num_students ASC LIMIT 1
Database: university
Tables: country, ranking_system, ranking_criteria, university, university_ranking_year, university_year
Columns (table index, column name): -1, *, 0, id, 0, country_name, 1, id, 1, system_name, 2, id, 2, ranking_system_id, 2, criteria_name, 3, id, 3, country_id, 3, university_name, 4, university_id, 4, ranking_criteria_id, 4, year, 4, score, 5, university_id, 5, year, 5, num_students, 5, student_staff_ratio, 5, pct_international_students, 5, pct_female_students
Question: Compute the average percentage of female students.
Evidence: average percentage of female students refers to avg(pct_female_students)
SQL: SELECT AVG(pct_female_students) FROM university_year