Chinastark/bird_dataset huggingface dataset:
Database: donor
Note: received donations of less than 10 dollars refers to dollar_amount = 'under_10'; city refers to school_city;
Question: In which city is there a greater number of schools that have received donations of less than 10 dollars?
SQL: SELECT projects.school_city FROM donations INNER JOIN projects ON donations.projectid = projects.projectid WHERE donations.dollar_amount = 'under_10' GROUP BY projects.school_city ORDER BY count(projects.schoolid) DESC LIMIT 1
Database: donor
Note: latitude 42003718 refers to school_latitude = 42003718; longitude -87668289 refers to school_longitude = -87668289;
Question: What is the project title of the school located at latitude 42003718 and longitude -87668289?
SQL: SELECT essays.title FROM essays INNER JOIN projects ON essays.projectid = projects.projectid WHERE projects.school_latitude = 42003718 AND projects.school_longitude = -87668289
Database: donor
Note: title Team More Books! Refers to title = 'Team More Books!'; as a New York teaching fellow refers to teacher_ny_teaching_fellow = 't';
Question: Find out if the project with the title Team More Books! has a New York teaching fellow.
SQL: SELECT projects.teacher_ny_teaching_fellow FROM essays INNER JOIN projects ON essays.projectid = projects.projectid WHERE essays.title LIKE 'Team More Books!'
Database: donor
Note: primary focus area is Literature refers to primary_focus_area = 'Literature';
Question: What is the name of the vendors that serve resources to schools whose primary focus area is Literature?
SQL: SELECT resources.vendor_name FROM resources INNER JOIN projects ON resources.projectid = projects.projectid WHERE projects.primary_focus_area LIKE 'Literacy%' GROUP BY resources.vendor_name ORDER BY count(projects.primary_focus_area) DESC LIMIT 1
Database: donor
Note: for grades 9-12 refers to grade_level = 'Grades 9-12';
Question: What is the name of the vendors serving material for projects for grades 9-12?
SQL: SELECT DISTINCT resources.vendor_name FROM resources INNER JOIN projects ON resources.projectid = projects.projectid WHERE projects.grade_level = 'Grades 9-12'
Database: donor
Note: in Chicago refers to school_city = 'Chicago'; teachers refers to is_teacher_acct = 't';
Question: How many teachers have made some type of donation for projects in Chicago?
SQL: SELECT count(DISTINCT projects.teacher_acctid) FROM donations INNER JOIN projects ON donations.projectid = projects.projectid WHERE donations.is_teacher_acct = 't' AND projects.school_city = 'Chicago'
Database: donor
Note: Rock Hill City School refers to school_city = 'Rock Hill'; teacher donors refers to is_teacher_acct = 't';
Question: How many Rock Hill City School projects have teacher donors?
SQL: SELECT count(DISTINCT projects.teacher_acctid) FROM projects INNER JOIN donations ON projects.projectid = donations.projectid WHERE projects.school_city = 'Rock Hill' AND is_teacher_acct = 't'
Database: donor
Note: with an optional support refers to donation_included_optional_support = 't'; reach more than 300 students refers to students_reached>300;
Question: What is the total sum of the donations paid with an optional support in projects that reach more than 300 students?
SQL: SELECT sum(donations.dollar_amount) FROM projects INNER JOIN donations ON projects.projectid = donations.projectid WHERE projects.students_reached > 300 AND donations.donation_included_optional_support = 't'
Database: donor
Note: Onslow Co School District refers to school_district = 'Onslow Co School District';
Question: How many total items were requested for the Onslow Co School District urban metro school projects?
SQL: SELECT sum(resources.item_quantity) FROM resources INNER JOIN projects ON resources.projectid = projects.projectid WHERE projects.school_metro = 'urban' AND projects.school_district = 'Onslow Co School District'
Database: donor
Note: Fresno County colleges refers to school_county = 'Fresno'; average refers to DIVIDE(sum(donation_optional_support,donation_to_project),sum(donation_total));
Question: What is the average total donations received by Fresno County colleges?
SQL: SELECT sum(donations.donation_optional_support + donations.donation_to_project) / count(donationid) FROM projects INNER JOIN donations ON projects.projectid = donations.projectid WHERE projects.school_county = 'Fresno'
Database: donor
Note: ABC Read project been launched refers to title = 'ABC Read'; percentage refers to DIVIDE(count(case when title = 'ABC Read' then school_county else null end),count(school_county))*100;
Question: In what percentage of counties has the ABC Read project been launched?
SQL: SELECT cast(sum(CASE WHEN essays.title LIKE 'ABC Read' THEN 1 ELSE 0 END) AS REAL) * 100 / count(projects.school_county) FROM projects INNER JOIN essays ON projects.projectid = essays.projectid
Database: donor
Note: donations per honoree refers to for_honoree = 't'; average refers to DIVIDE(sum(item_quantity), count(donationid));
Question: What is the average amount of resources from projects that have received donations per honoree?
SQL: SELECT avg(resources.item_quantity) FROM resources INNER JOIN donations ON resources.projectid = donations.projectid WHERE donations.for_honoree = 't'
Database: donor
Note: project "Photojournalists Want to Exhibit Their Best Works" refers to title = 'Photojournalists Want to Exhibit Their Best Works'; when project go live refers to datePosted;
Question: When did the project "Photojournalists Want to Exhibit Their Best Works" go live?
SQL: SELECT projects.date_posted FROM projects INNER JOIN essays ON projects.projectid = essays.projectid WHERE essays.title LIKE 'Photojournalists Want to Exhibit Their Best Works'
Database: donor
Note: Mathematics as a primary subject refers to primary_focus_subject = 'Mathematics'; most expensive refers to max(item_unit_price);
Question: Which item provided for projects with Mathematics as a primary subject is the most expensive?
SQL: SELECT resources.item_name FROM resources INNER JOIN projects ON resources.projectid = projects.projectid WHERE projects.primary_focus_subject = 'Mathematics' ORDER BY resources.item_unit_price DESC LIMIT 1
Database: donor
Note: needs a "Viewscreen LCD from Texas Instruments, TI-84 Plus" refers to item_name = 'Viewscreen LCD from Texas Instruments, TI-84 Plus'; where is the school refers to school_city; latitude refers to school_latitude; longtitude refers to school_longitude;
Question: Where is the school that needs a "Viewscreen LCD from Texas Instruments, TI-84 Plus"? Provide the latitude and longitude of that school.
SQL: SELECT projects.school_city, projects.school_latitude, projects.school_longitude FROM resources INNER JOIN projects ON resources.projectid = projects.projectid WHERE resources.item_name = 'Viewscreen LCD FROM Texas Instruments, TI-84 Plus'
Database: donor
Note: project "Look, Look, We Need a Nook!" refers to title = 'Look, Look, We Need a Nook!';
Question: How many donations does the project "Look, Look, We Need a Nook!" have?
SQL: SELECT sum(donations.donation_total) FROM essays INNER JOIN projects ON essays.projectid = projects.projectid INNER JOIN donations ON projects.projectid = donations.projectid WHERE essays.title = 'Look, Look, We Need a Nook!'
Database: donor
Note: zip code "7079" refers to donor_zip = '7079';
Question: List the poverty level of all the schools that received donations with the zip code "7079".
SQL: SELECT DISTINCT projects.poverty_level FROM donations INNER JOIN projects ON donations.projectid = projects.projectid WHERE donations.donor_zip = 7079
Database: donor
Note: project "Bloody Times" refers to title = 'Bloody Times';
Question: What is the name of the vendor that the project "Bloody Times" uses for their resources?
SQL: SELECT resources.vendor_name FROM essays INNER JOIN projects ON essays.projectid = projects.projectid INNER JOIN resources ON projects.projectid = resources.projectid WHERE essays.title = 'Bloody Times'
Database: donor
Note: from "Sax Arts & Crafts" refers to vendor_name = 'Sax Arts & Crafts'; zip code of the schools refers school_zip;
Question: List all the items from "Sax Arts & Crafts" and the zip code of the schools that received them.
SQL: SELECT projects.school_zip, resources.item_name FROM resources INNER JOIN projects ON resources.projectid = projects.projectid WHERE resources.vendor_name = 'Sax Arts & Crafts'
Database: donor
Note: project "Wiping Away Bad Grades" title = 'Wiping Away Bad Grades'; coordinates refers to school_longitude, school_latitude;
Question: What are the coordinates of the school with the project "Wiping Away Bad Grades"?
SQL: SELECT projects.school_longitude, projects.school_latitude FROM projects INNER JOIN essays ON projects.projectid = essays.projectid WHERE essays.title LIKE 'Wiping Away Bad Grades'
Database: donor
Note: corporate sponsored giftcard refers to payment_included_campaign_gift_card = 't'; primary subject refers to primary_focus_subject;
Question: List the primary subject of all the donations with a corporate sponsored giftcard.
SQL: SELECT DISTINCT projects.primary_focus_subject FROM donations INNER JOIN projects ON donations.projectid = projects.projectid WHERE donations.payment_included_campaign_gift_card = 't'
Database: donor
Note: book item refers to project_resource_type = 'Books'; most expensive refers to MAX(item_unit_price);
Question: What is the most expensive book item? Please provide a short description of projects related to those.
SQL: SELECT resources.item_name, essays.short_description FROM resources INNER JOIN essays ON resources.projectid = essays.projectid WHERE resources.project_resource_type = 'Books' ORDER BY resources.item_unit_price DESC LIMIT 1
Database: donor
Note: project "Too Close for Comfort" refers to title = 'Too Close for Comfort'; grade refers to grade_level;
Question: For what grade was the project "Too Close for Comfort" for?
SQL: SELECT projects.grade_level FROM projects INNER JOIN essays ON projects.projectid = essays.projectid WHERE essays.title LIKE 'Too Close for Comfort'
Database: donor
Note: zip code "22205" refers to donor_zip = '22205'; students impacted refers to students_reached;
Question: What is the total number of students impacted by the projects with a donation from a donor with zip code "22205"?
SQL: SELECT sum(projects.students_reached) FROM donations INNER JOIN projects ON donations.projectid = projects.projectid WHERE donations.donor_zip = 22205
Database: donor
Note: given via a giving or campaign page refers to via_giving_page = 't'; percentage refers to DIVIDE(count(case when via_giving_page = 't' then donationid else null end),count(donationid))*100; primary area of donation refers to primary_focus_area;
Question: What percentage of donations are given via a giving or campaign page? List the primary area of those donations.
SQL: SELECT cast(sum(CASE WHEN donations.via_giving_page = 't' THEN 1 ELSE 0 END) AS REAL) * 100 / count(donation_total), ( SELECT projects.primary_focus_area FROM donations INNER JOIN projects ON donations.projectid = projects.projectid WHERE donations.via_giving_page = 't' GROUP BY projects.primary_focus_area ORDER BY sum(donations.donation_total) DESC LIMIT 1 ) RESULT FROM donations INNER JOIN projects ON donations.projectid = projects.projectid
Database: donor
Note: technology items refers to project_resource_type = 'Technology'; from Best Buy for Business refers to vendor_name = 'Best Buy for Business'; percentage refers to DIVIDE(count(case when vendor_name = 'Best Buy for Business'),count(projectid));
Question: Among the technology items, what percentage of them are from Best Buy for Business? Provide the date of the project related to those items.
SQL: SELECT cast(sum(CASE WHEN projects.vendor_name = 'Best Buy for Business' THEN 1 ELSE 0 END) AS REAL) * 100 / count(projects.projectid) FROM resources INNER JOIN projects ON projects.projectid = resources.projectid WHERE projects.project_resource_type = 'Technology' UNION ALL SELECT DISTINCT projects.date_posted FROM projects INNER JOIN resources ON projects.projectid = resources.projectid WHERE resources.vendor_name = 'Best Buy for Business' AND resources.project_resource_type = 'Technology'
Database: video_games
Note: result = subtract(sum(num_sales where game_platform_id = 50), sum(num_sales where game_platform_id = 51));
Question: How many more games were sold on game platform ID 50 than on game platform ID 51 in region ID 1?
SQL: SELECT (sum(CASE WHEN t.game_platform_id = 50 THEN t.num_sales ELSE 0 END) - sum(CASE WHEN t.game_platform_id = 51 THEN t.num_sales ELSE 0 END)) * 100000 AS nums FROM region_sales AS t WHERE t.region_id = 1
Database: video_games
Note: game refers to game_name; 3D Lemmings refers to game_name = '3D Lemmings';
Question: Please list all the games that have the same game genre as 3D Lemmings.
SQL: SELECT game.game_name FROM game WHERE game.genre_id = ( SELECT t.genre_id FROM game AS t WHERE t.game_name = '3D Lemmings' )
Database: video_games
Note: action game refers to genre_name = 'Action';
Question: How many action games are there in total?
SQL: SELECT count(game.id) FROM game INNER JOIN genre ON game.genre_id = genre.id WHERE genre.genre_name = 'Action'
Database: video_games
Note: genre refers to genre_name; 3D Lemmings refers to game_name = '3D Lemmings';
Question: What is the genre of 3D Lemmings?
SQL: SELECT genre.genre_name FROM game INNER JOIN genre ON game.genre_id = genre.id WHERE game.game_name = '3D Lemmings'
Database: video_games
Note: publisher refers to publisher_name; 3D Lemmings refers to game_name = '3D Lemmings';
Question: Who is the publisher of 3D Lemmings?
SQL: SELECT publisher.publisher_name FROM game INNER JOIN game_publisher ON game.id = game_publisher.game_id INNER JOIN publisher ON game_publisher.publisher_id = publisher.id WHERE game.game_name = '3D Lemmings'
Database: video_games
Note: name refers to game_name; published by 10TACLE Studios refers to publisher_name = '10TACLE Studios';
Question: Please list the names of all the games published by 10TACLE Studios.
SQL: SELECT game.game_name FROM game INNER JOIN game_publisher ON game.id = game_publisher.game_id INNER JOIN publisher ON game_publisher.publisher_id = publisher.id WHERE publisher.publisher_name = '10TACLE Studios'
Database: video_games
Note: published by 10TACLE Studios refers to publisher_name = '10TACLE Studios'; puzzle refers to genre_name = 'Puzzle';
Question: Among the games published by 10TACLE Studios, how many of them are puzzles?
SQL: SELECT count(game.id) FROM game INNER JOIN game_publisher ON game.id = game_publisher.game_id INNER JOIN publisher ON game_publisher.publisher_id = publisher.id INNER JOIN genre ON game.genre_id = genre.id WHERE genre.genre_name = 'Puzzle' AND publisher.publisher_name = '10TACLE Studios'
Database: video_games
Note: name refers to game_name; published by 10TACLE Studios refers to publisher_name = '10TACLE Studios'; puzzle refers to genre_name = 'Puzzle';
Question: Please list the names of all the games published by 10TACLE Studios and are puzzles.
SQL: SELECT game.game_name FROM game INNER JOIN game_publisher ON game.id = game_publisher.game_id INNER JOIN publisher ON game_publisher.publisher_id = publisher.id INNER JOIN genre ON game.genre_id = genre.id WHERE publisher.publisher_name = '10TACLE Studios' AND genre.genre_name = 'Puzzle'
Database: video_games
Note: publisher refers to publisher_name; the most games refers to max(count(game_id));
Question: Which publisher has published the most games?
SQL: SELECT t.publisher_name FROM ( SELECT publisher.publisher_name, count(DISTINCT publisher.id) FROM game_publisher INNER JOIN publisher ON game_publisher.publisher_id = publisher.id GROUP BY game_publisher.publisher_id ORDER BY count(publisher.id) DESC LIMIT 1 ) t
Database: video_games
Note: platform refers to platform_name; Panzer Tactics refers to game_name = 'Panzer Tactics'; released in 2007 refers to release_year = 2007;
Question: On which platform was Panzer Tactics released in 2007?
SQL: SELECT platform.platform_name FROM game_publisher INNER JOIN publisher ON game_publisher.publisher_id = publisher.id INNER JOIN game ON game_publisher.game_id = game.id INNER JOIN game_platform ON game_publisher.id = game_platform.game_publisher_id INNER JOIN platform ON game_platform.platform_id = platform.id WHERE game.game_name = 'Panzer Tactics' AND game_platform.release_year = 2007
Database: video_games
Note: year refers to release_year; Panzer Tactics refers to game_name = 'Panzer Tactics'; on DS refers to platform_name = 'DS';
Question: In which year was Panzer Tactics released on DS?
SQL: SELECT game_platform.release_year FROM game_publisher INNER JOIN publisher ON game_publisher.publisher_id = publisher.id INNER JOIN game ON game_publisher.game_id = game.id INNER JOIN game_platform ON game_publisher.id = game_platform.game_publisher_id INNER JOIN platform ON game_platform.platform_id = platform.id WHERE game.game_name = 'Panzer Tactics' AND platform.platform_name = 'DS'
Database: video_games
Note: name of publisher refers to publisher_name; puzzle refers to genre_name = 'Puzzle';
Question: Please list the names of the publishers of all the puzzle games.
SQL: SELECT DISTINCT publisher.publisher_name FROM game INNER JOIN game_publisher ON game.id = game_publisher.game_id INNER JOIN publisher ON game_publisher.publisher_id = publisher.id INNER JOIN genre ON game.genre_id = genre.id WHERE genre.genre_name = 'Puzzle'
Database: video_games
Note: name of publisher refers to publisher_name; puzzle refers to genre_name = 'Puzzle'; the most puzzle games refers to max(count(game_id where genre_name = 'Puzzle'));
Question: What is the name of the publisher that has published the most puzzle games?
SQL: SELECT t.publisher_name FROM ( SELECT publisher.publisher_name, count(DISTINCT game.id) FROM game INNER JOIN game_publisher ON game.id = game_publisher.game_id INNER JOIN publisher ON game_publisher.publisher_id = publisher.id INNER JOIN genre ON game.genre_id = genre.id WHERE genre.genre_name = 'Puzzle' GROUP BY publisher.publisher_name ORDER BY count(DISTINCT game.id) DESC LIMIT 1 ) t
Database: video_games
Note: puzzle refers to genre_name = 'Puzzle'; more than 3 puzzle games refers to count(game_id where genre_name = 'Puzzle') > 3;
Question: How many publishers have published more than 3 puzzle games?
SQL: SELECT count(t.publisher_name) FROM ( SELECT publisher.publisher_name, count(DISTINCT game.id) FROM game INNER JOIN game_publisher ON game.id = game_publisher.game_id INNER JOIN publisher ON game_publisher.publisher_id = publisher.id INNER JOIN genre ON game.genre_id = genre.id WHERE genre.genre_name = 'Puzzle' GROUP BY publisher.publisher_name HAVING count(DISTINCT game.id) > 3 ) t
Database: video_games
Note: published by Nintendo refers to publisher_name = 'Nintendo'; in the genre of sports refers to genre_name = 'Sports'; percentage = divide(count(game_id where genre_name = 'Sports'), count(game_id)) * 100% where publisher_name = 'Nintendo';
Question: Among the games published by Nintendo, what is the percentage of those in the genre of sports?
SQL: SELECT cast(count(CASE WHEN genre.genre_name = 'Sports' THEN game.id ELSE NULL END) AS REAL) * 100/ count(game.id) FROM game INNER JOIN game_publisher ON game.id = game_publisher.game_id INNER JOIN publisher ON game_publisher.publisher_id = publisher.id INNER JOIN genre ON game.genre_id = genre.id WHERE publisher.publisher_name = 'Nintendo'
Database: video_games
Note: on the DS platform refers to platform_name = 'DS'; number of games sold on average = divide(sum(multiply(num_sales, 100000)), 4) where platform_name = 'DS';
Question: How many games were sold on the DS platform on average in the 4 different regions?
SQL: SELECT sum(region_sales.num_sales) * 100000 / 4 FROM region_sales INNER JOIN game_platform ON region_sales.game_platform_id = game_platform.id INNER JOIN platform ON game_platform.platform_id = platform.id WHERE platform.platform_name = 'DS'
Database: video_games
Note: number of games refers to count(game_id);
Question: Tell the number of games whose publisher id is 352.
SQL: SELECT DISTINCT t.game_id FROM game_publisher AS t WHERE t.publisher_id = 352
Database: video_games
Note: Pro Evolution Soccer 2012 refers to game_name = 'Pro Evolution Soccer 2012';
Question: List the genre id of the game Pro Evolution Soccer 2012.
SQL: SELECT t.genre_id FROM game AS t WHERE t.game_name = 'Pro Evolution Soccer 2012'
Database: video_games
Note: region id refers to region.id; Japan refers to region_name = 'Japan';
Question: State the region id of Japan.
SQL: SELECT t.id FROM region AS t WHERE t.region_name = 'Japan'
Database: video_games
Note: id of the game platform refers to game_platform_id; the most sales refers to max(num_sales); region 2 refers to region_id = '2';
Question: Show the id of the game platform with the most sales in region 2.
SQL: SELECT t1.game_platform_id FROM ( SELECT t.game_platform_id, sum(t.num_sales) FROM region_sales AS t WHERE t.region_id = 2 GROUP BY t.game_platform_id ORDER BY sum(t.num_sales) DESC LIMIT 1 ) t1
Database: video_games
Note: the most games refers to max(game_id); genre id refers to genre_id;
Question: Which genre has the most games? Show its id.
SQL: SELECT genre_id FROM ( SELECT t.genre_id, count(t.id) FROM game AS t GROUP BY t.genre_id ORDER BY count(t.id) DESC LIMIT 1 )
Database: video_games
Note: id of game refers to game.id; "Resident Evil Archives: Resident Evil" refers to game_name = 'Resident Evil Archives: Resident Evil';
Question: What is the id of the game "Resident Evil Archives: Resident Evil"?
SQL: SELECT t.genre_id FROM game AS t WHERE t.game_name = 'Resident Evil Archives: Resident Evil'
Database: video_games
Note: on X360 refers to platform_name = 'X360'; in 2010 refers to release_year = '2010';
Question: Show the number of games which were released on X360 in 2010.
SQL: SELECT count(DISTINCT game_publisher.game_id) FROM platform INNER JOIN game_platform ON platform.id = game_platform.platform_id INNER JOIN game_publisher ON game_platform.game_publisher_id = game_publisher.id WHERE platform.platform_name = 'X360' AND game_platform.release_year = 2010
Database: video_games
Note: game "ModNation Racers" refers to game_name = 'ModNation Racers';
Question: State the publisher name of the game "ModNation Racers".
SQL: SELECT publisher.publisher_name FROM publisher INNER JOIN game_publisher ON publisher.id = game_publisher.publisher_id INNER JOIN game ON game_publisher.game_id = game.id WHERE game.game_name = 'ModNation Racers'
Database: video_games
Note: id of game platform refers to game_platform_id; the most sales refers to max(num_sales); in Japan refers to region_name = 'Japan';
Question: Show the id of game platform which makes the most sales in Japan.
SQL: SELECT t.game_platform_id FROM ( SELECT region_sales.game_platform_id, max(region_sales.num_sales) FROM region INNER JOIN region_sales ON region.id = region_sales.region_id WHERE region.region_name = 'Japan' ) t
Database: video_games
Note: game Pro Evolution Soccer 2016 refers to game_name = 'Pro Evolution Soccer 2016';
Question: How many platforms are available for the game Pro Evolution Soccer 2016?
SQL: SELECT count(platform.id) FROM game_platform INNER JOIN platform ON game_platform.platform_id = platform.id INNER JOIN game_publisher ON game_platform.game_publisher_id = game_publisher.id INNER JOIN game ON game_publisher.game_id = game.id WHERE game.game_name = 'Pro Evolution Soccer 2016'
Database: video_games
Note: the genre of sports refers to genre_name = 'Sports';
Question: How many games in the database belong to the genre of sports?
SQL: SELECT count(game.id) FROM game INNER JOIN genre ON game.genre_id = genre.id WHERE genre.genre_name = 'Sports'
Database: video_games
Note: name of publisher refers to publisher_name; the game id 10031 refers to game_id = '10031';
Question: Name of the publisher of the game id 10031.
SQL: SELECT publisher.publisher_name FROM game_publisher INNER JOIN publisher ON game_publisher.publisher_id = publisher.id WHERE game_publisher.game_id = 10031