Chinastark/bird_dataset huggingface dataset:
Database: donor
Question: Where is the school that needs a "Viewscreen LCD from Texas Instruments, TI-84 Plus"? Provide the latitude and longitude of that school.
Evidence: 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
SQL: SELECT T2.school_city, T2.school_latitude, T2.school_longitude FROM resources AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T1.item_name = 'Viewscreen LCD FROM Texas Instruments, TI-84 Plus'
Database: donor
Question: How many donations does the project "Look, Look, We Need a Nook!" have?
Evidence: project "Look, Look, We Need a Nook!" refers to title = 'Look, Look, We Need a Nook!'
SQL: SELECT SUM(T3.donation_total) FROM essays AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid INNER JOIN donations AS T3 ON T2.projectid = T3.projectid WHERE T1.title = 'Look, Look, We Need a Nook!'
Database: donor
Question: List the poverty level of all the schools that received donations with the zip code "7079".
Evidence: zip code "7079" refers to donor_zip = '7079'
SQL: SELECT DISTINCT T2.poverty_level FROM donations AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T1.donor_zip = 7079
Database: donor
Question: What is the name of the vendor that the project "Bloody Times" uses for their resources?
Evidence: project "Bloody Times" refers to title = 'Bloody Times'
SQL: SELECT T3.vendor_name FROM essays AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid INNER JOIN resources AS T3 ON T2.projectid = T3.projectid WHERE T1.title = 'Bloody Times'
Database: donor
Question: List all the items from "Sax Arts & Crafts" and the zip code of the schools that received them.
Evidence: from "Sax Arts & Crafts" refers to vendor_name = 'Sax Arts & Crafts'; zip code of the schools refers school_zip
SQL: SELECT T2.school_zip, T1.item_name FROM resources AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T1.vendor_name = 'Sax Arts & Crafts'
Database: donor
Question: What are the coordinates of the school with the project "Wiping Away Bad Grades"?
Evidence: project "Wiping Away Bad Grades" title = 'Wiping Away Bad Grades'; coordinates refers to school_longitude, school_latitude
SQL: SELECT T1.school_longitude, T1.school_latitude FROM projects AS T1 INNER JOIN essays AS T2 ON T1.projectid = T2.projectid WHERE T2.title LIKE 'Wiping Away Bad Grades'
Database: donor
Question: List the primary subject of all the donations with a corporate sponsored giftcard.
Evidence: corporate sponsored giftcard refers to payment_included_campaign_gift_card = 't'; primary subject refers to primary_focus_subject
SQL: SELECT DISTINCT T2.primary_focus_subject FROM donations AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T1.payment_included_campaign_gift_card = 't'
Database: donor
Question: What is the most expensive book item? Please provide a short description of projects related to those.
Evidence: book item refers to project_resource_type = 'Books'; most expensive refers to MAX(item_unit_price)
SQL: SELECT T1.item_name, T2.short_description FROM resources AS T1 INNER JOIN essays AS T2 ON T1.projectid = T2.projectid WHERE T1.project_resource_type = 'Books' ORDER BY T1.item_unit_price DESC LIMIT 1
Database: donor
Question: For what grade was the project "Too Close for Comfort" for?
Evidence: project "Too Close for Comfort" refers to title = 'Too Close for Comfort'; grade refers to grade_level
SQL: SELECT T1.grade_level FROM projects AS T1 INNER JOIN essays AS T2 ON T1.projectid = T2.projectid WHERE T2.title LIKE 'Too Close for Comfort'
Database: donor
Question: What is the total number of students impacted by the projects with a donation from a donor with zip code "22205"?
Evidence: zip code "22205" refers to donor_zip = '22205'; students impacted refers to students_reached
SQL: SELECT SUM(T2.students_reached) FROM donations AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T1.donor_zip = 22205
Database: donor
Question: What percentage of donations are given via a giving or campaign page? List the primary area of those donations.
Evidence: 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
SQL: SELECT CAST(SUM(CASE WHEN T1.via_giving_page = 't' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(donation_total), ( SELECT T2.primary_focus_area FROM donations AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T1.via_giving_page = 't' GROUP BY T2.primary_focus_area ORDER BY SUM(T1.donation_total) DESC LIMIT 1 ) result FROM donations AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid
Database: donor
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.
Evidence: 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))
SQL: SELECT CAST(SUM(CASE WHEN T1.vendor_name = 'Best Buy for Business' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.projectid) FROM resources AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T1.project_resource_type = 'Technology' UNION ALL SELECT DISTINCT T1.date_posted FROM projects AS T1 INNER JOIN resources AS T2 ON T1.projectid = T2.projectid WHERE T2.vendor_name = 'Best Buy for Business' AND T2.project_resource_type = 'Technology'
Database: video_games
Question: How many more games were sold on game platform ID 50 than on game platform ID 51 in region ID 1?
Evidence: result = subtract(sum(num_sales where game_platform_id = 50), sum(num_sales where game_platform_id = 51))
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
Question: Please list all the games that have the same game genre as 3D Lemmings.
Evidence: game refers to game_name; 3D Lemmings refers to game_name = '3D Lemmings'
SQL: SELECT T1.game_name FROM game AS T1 WHERE T1.genre_id = ( SELECT T.genre_id FROM game AS T WHERE T.game_name = '3D Lemmings' )
Database: video_games
Question: How many action games are there in total?
Evidence: action game refers to genre_name = 'Action'
SQL: SELECT COUNT(T1.id) FROM game AS T1 INNER JOIN genre AS T2 ON T1.genre_id = T2.id WHERE T2.genre_name = 'Action'
Database: video_games
Question: What is the genre of 3D Lemmings?
Evidence: genre refers to genre_name; 3D Lemmings refers to game_name = '3D Lemmings'
SQL: SELECT T2.genre_name FROM game AS T1 INNER JOIN genre AS T2 ON T1.genre_id = T2.id WHERE T1.game_name = '3D Lemmings'
Database: video_games
Question: Who is the publisher of 3D Lemmings?
Evidence: publisher refers to publisher_name; 3D Lemmings refers to game_name = '3D Lemmings'
SQL: SELECT T3.publisher_name FROM game AS T1 INNER JOIN game_publisher AS T2 ON T1.id = T2.game_id INNER JOIN publisher AS T3 ON T2.publisher_id = T3.id WHERE T1.game_name = '3D Lemmings'
Database: video_games
Question: Please list the names of all the games published by 10TACLE Studios.
Evidence: name refers to game_name; published by 10TACLE Studios refers to publisher_name = '10TACLE Studios'
SQL: SELECT T1.game_name FROM game AS T1 INNER JOIN game_publisher AS T2 ON T1.id = T2.game_id INNER JOIN publisher AS T3 ON T2.publisher_id = T3.id WHERE T3.publisher_name = '10TACLE Studios'
Database: video_games
Question: Among the games published by 10TACLE Studios, how many of them are puzzles?
Evidence: published by 10TACLE Studios refers to publisher_name = '10TACLE Studios'; puzzle refers to genre_name = 'Puzzle'
SQL: SELECT COUNT(T1.id) FROM game AS T1 INNER JOIN game_publisher AS T2 ON T1.id = T2.game_id INNER JOIN publisher AS T3 ON T2.publisher_id = T3.id INNER JOIN genre AS T4 ON T1.genre_id = T4.id WHERE T4.genre_name = 'Puzzle' AND T3.publisher_name = '10TACLE Studios'
Database: video_games
Question: Please list the names of all the games published by 10TACLE Studios and are puzzles.
Evidence: name refers to game_name; published by 10TACLE Studios refers to publisher_name = '10TACLE Studios'; puzzle refers to genre_name = 'Puzzle'
SQL: SELECT T1.game_name FROM game AS T1 INNER JOIN game_publisher AS T2 ON T1.id = T2.game_id INNER JOIN publisher AS T3 ON T2.publisher_id = T3.id INNER JOIN genre AS T4 ON T1.genre_id = T4.id WHERE T3.publisher_name = '10TACLE Studios' AND T4.genre_name = 'Puzzle'
Database: video_games
Question: Which publisher has published the most games?
Evidence: publisher refers to publisher_name; the most games refers to max(count(game_id))
SQL: SELECT T.publisher_name FROM ( SELECT T2.publisher_name, COUNT(DISTINCT T2.id) FROM game_publisher AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.id GROUP BY T1.publisher_id ORDER BY COUNT(T2.id) DESC LIMIT 1 ) t
Database: video_games
Question: On which platform was Panzer Tactics released in 2007?
Evidence: platform refers to platform_name; Panzer Tactics refers to game_name = 'Panzer Tactics'; released in 2007 refers to release_year = 2007
SQL: SELECT T5.platform_name FROM game_publisher AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.id INNER JOIN game AS T3 ON T1.game_id = T3.id INNER JOIN game_platform AS T4 ON T1.id = T4.game_publisher_id INNER JOIN platform AS T5 ON T4.platform_id = T5.id WHERE T3.game_name = 'Panzer Tactics' AND T4.release_year = 2007
Database: video_games
Question: In which year was Panzer Tactics released on DS?
Evidence: year refers to release_year; Panzer Tactics refers to game_name = 'Panzer Tactics'; on DS refers to platform_name = 'DS'
SQL: SELECT T4.release_year FROM game_publisher AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.id INNER JOIN game AS T3 ON T1.game_id = T3.id INNER JOIN game_platform AS T4 ON T1.id = T4.game_publisher_id INNER JOIN platform AS T5 ON T4.platform_id = T5.id WHERE T3.game_name = 'Panzer Tactics' AND T5.platform_name = 'DS'
Database: video_games
Question: Please list the names of the publishers of all the puzzle games.
Evidence: name of publisher refers to publisher_name; puzzle refers to genre_name = 'Puzzle'
SQL: SELECT DISTINCT T3.publisher_name FROM game AS T1 INNER JOIN game_publisher AS T2 ON T1.id = T2.game_id INNER JOIN publisher AS T3 ON T2.publisher_id = T3.id INNER JOIN genre AS T4 ON T1.genre_id = T4.id WHERE T4.genre_name = 'Puzzle'
Database: video_games
Question: What is the name of the publisher that has published the most puzzle games?
Evidence: 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'))
SQL: SELECT T.publisher_name FROM ( SELECT T3.publisher_name, COUNT(DISTINCT T1.id) FROM game AS T1 INNER JOIN game_publisher AS T2 ON T1.id = T2.game_id INNER JOIN publisher AS T3 ON T2.publisher_id = T3.id INNER JOIN genre AS T4 ON T1.genre_id = T4.id WHERE T4.genre_name = 'Puzzle' GROUP BY T3.publisher_name ORDER BY COUNT(DISTINCT T1.id) DESC LIMIT 1 ) t
Database: video_games
Question: How many publishers have published more than 3 puzzle games?
Evidence: puzzle refers to genre_name = 'Puzzle'; more than 3 puzzle games refers to count(game_id where genre_name = 'Puzzle') > 3
SQL: SELECT COUNT(T.publisher_name) FROM ( SELECT T3.publisher_name, COUNT(DISTINCT T1.id) FROM game AS T1 INNER JOIN game_publisher AS T2 ON T1.id = T2.game_id INNER JOIN publisher AS T3 ON T2.publisher_id = T3.id INNER JOIN genre AS T4 ON T1.genre_id = T4.id WHERE T4.genre_name = 'Puzzle' GROUP BY T3.publisher_name HAVING COUNT(DISTINCT T1.id) > 3 ) t
Database: video_games
Question: Among the games published by Nintendo, what is the percentage of those in the genre of sports?
Evidence: 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'
SQL: SELECT CAST(COUNT(CASE WHEN T4.genre_name = 'Sports' THEN T1.id ELSE NULL END) AS REAL) * 100/ COUNT(T1.id) FROM game AS T1 INNER JOIN game_publisher AS T2 ON T1.id = T2.game_id INNER JOIN publisher AS T3 ON T2.publisher_id = T3.id INNER JOIN genre AS T4 ON T1.genre_id = T4.id WHERE T3.publisher_name = 'Nintendo'
Database: video_games
Question: How many games were sold on the DS platform on average in the 4 different regions?
Evidence: 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'
SQL: SELECT SUM(T1.num_sales) * 100000 / 4 FROM region_sales AS T1 INNER JOIN game_platform AS T2 ON T1.game_platform_id = T2.id INNER JOIN platform AS T3 ON T2.platform_id = T3.id WHERE T3.platform_name = 'DS'
Database: video_games
Question: Tell the number of games whose publisher id is 352.
Evidence: number of games refers to count(game_id)
SQL: SELECT DISTINCT T.game_id FROM game_publisher AS T WHERE T.publisher_id = 352
Database: video_games
Question: List the genre id of the game Pro Evolution Soccer 2012.
Evidence: Pro Evolution Soccer 2012 refers to game_name = 'Pro Evolution Soccer 2012'
SQL: SELECT T.genre_id FROM game AS T WHERE T.game_name = 'Pro Evolution Soccer 2012'
Database: video_games
Question: State the region id of Japan.
Evidence: region id refers to region.id; Japan refers to region_name = 'Japan'
SQL: SELECT T.id FROM region AS T WHERE T.region_name = 'Japan'
Database: video_games
Question: Show the id of the game platform with the most sales in region 2.
Evidence: 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'
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
Question: Which genre has the most games? Show its id.
Evidence: the most games refers to max(game_id); genre id refers to genre_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
Question: What is the id of the game "Resident Evil Archives: Resident Evil"?
Evidence: id of game refers to game.id; "Resident Evil Archives: Resident Evil" refers to game_name = '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
Question: Show the number of games which were released on X360 in 2010.
Evidence: on X360 refers to platform_name = 'X360'; in 2010 refers to release_year = '2010'
SQL: SELECT COUNT(DISTINCT T3.game_id) FROM platform AS T1 INNER JOIN game_platform AS T2 ON T1.id = T2.platform_id INNER JOIN game_publisher AS T3 ON T2.game_publisher_id = T3.id WHERE T1.platform_name = 'X360' AND T2.release_year = 2010
Database: video_games
Question: State the publisher name of the game "ModNation Racers".
Evidence: game "ModNation Racers" refers to game_name = 'ModNation Racers'
SQL: SELECT T1.publisher_name FROM publisher AS T1 INNER JOIN game_publisher AS T2 ON T1.id = T2.publisher_id INNER JOIN game AS T3 ON T2.game_id = T3.id WHERE T3.game_name = 'ModNation Racers'
Database: video_games
Question: Show the id of game platform which makes the most sales in Japan.
Evidence: id of game platform refers to game_platform_id; the most sales refers to max(num_sales); in Japan refers to region_name = 'Japan'
SQL: SELECT T.game_platform_id FROM ( SELECT T2.game_platform_id, MAX(T2.num_sales) FROM region AS T1 INNER JOIN region_sales AS T2 ON T1.id = T2.region_id WHERE T1.region_name = 'Japan' ) t
Database: video_games
Question: How many platforms are available for the game Pro Evolution Soccer 2016?
Evidence: game Pro Evolution Soccer 2016 refers to game_name = 'Pro Evolution Soccer 2016'
SQL: SELECT COUNT(T2.id) FROM game_platform AS T1 INNER JOIN platform AS T2 ON T1.platform_id = T2.id INNER JOIN game_publisher AS T3 ON T1.game_publisher_id = T3.id INNER JOIN game AS T4 ON T3.game_id = T4.id WHERE T4.game_name = 'Pro Evolution Soccer 2016'
Database: video_games
Question: How many games in the database belong to the genre of sports?
Evidence: the genre of sports refers to genre_name = 'Sports'
SQL: SELECT COUNT(T1.id) FROM game AS T1 INNER JOIN genre AS T2 ON T1.genre_id = T2.id WHERE T2.genre_name = 'Sports'
Database: video_games
Question: Name of the publisher of the game id 10031.
Evidence: name of publisher refers to publisher_name; the game id 10031 refers to game_id = '10031'
SQL: SELECT T2.publisher_name FROM game_publisher AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.id WHERE T1.game_id = 10031
Database: video_games
Question: State the name of the publisher with the most games.
Evidence: name of publisher refers to publisher_name; the most games refers to max(game_id)
SQL: SELECT T.publisher_name FROM ( SELECT T2.publisher_name, COUNT(DISTINCT T1.game_id) FROM game_publisher AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.id GROUP BY T2.publisher_name ORDER BY COUNT(DISTINCT T1.game_id) DESC LIMIT 1 ) t
Database: video_games
Question: How many more sports games than simulation games?
Evidence: sports game refers to genre_name = 'Sports'; simulation game refers to genre_name = 'Simulation'; how many more = subtract(sum(game_id where genre_name = 'Sports'), sum(game_id where genre_name = 'Simulation'))
SQL: SELECT COUNT(CASE WHEN T1.genre_name = 'Sports' THEN T2.id ELSE NULL END) - COUNT(CASE WHEN T1.genre_name = 'Simulation' THEN T2.id ELSE NULL END) FROM genre AS T1 INNER JOIN game AS T2 ON T1.id = T2.genre_id
Database: video_games
Question: Tell the genre of the game "Resident Evil: Revelations".
Evidence: genre refers to genre_name; game "Resident Evil: Revelations" refers to game_name = 'Resident Evil: Revelations'
SQL: SELECT T2.genre_name FROM game AS T1 INNER JOIN genre AS T2 ON T1.genre_id = T2.id WHERE T1.game_name = 'Resident Evil: Revelations'
Database: video_games
Question: How many sales does game platform id 3871 make in Europe?
Evidence: number of sales = multiply(num_sales, 100000); in Europe refers to region_name = 'Europe'
SQL: SELECT T2.num_sales * 100000 FROM region AS T1 INNER JOIN region_sales AS T2 ON T1.id = T2.region_id WHERE T1.region_name = 'Europe' AND T2.game_platform_id = 3871
Database: video_games
Question: Give the number of games which were published by Ascaron Entertainment GmbH.
Evidence: published by Ascaron Entertainment GmbH refers to publisher_name = 'Ascaron Entertainment GmbH'
SQL: SELECT COUNT(T2.game_id) FROM publisher AS T1 INNER JOIN game_publisher AS T2 ON T1.id = T2.publisher_id WHERE T1.publisher_name = 'Ascaron Entertainment GmbH'
Database: video_games
Question: Show the name of the earliest platform in the database.
Evidence: the earliest refers to min(release_year); name of platform refers to platform_name
SQL: SELECT T2.platform_name FROM game_platform AS T1 INNER JOIN platform AS T2 ON T1.platform_id = T2.id ORDER BY T1.release_year ASC LIMIT 1
Database: video_games
Question: For all the games which were published by Namco Bandai Games, what percentage of them were adventure games?
Evidence: published by Namco Bandai Games refers to publisher_name = 'Namco Bandai Games'; adventure game refers to genre_name = 'Adventure'; percentage = divide(sum(game_id where genre_name = 'Adventure'), count(game_id)) * 100% where publisher_name = 'Namco Bandai Games'
SQL: SELECT CAST(COUNT(CASE WHEN T4.genre_name = 'Adventure' THEN T1.id ELSE NULL END) AS REAL) * 100 / COUNT(T1.id) FROM game AS T1 INNER JOIN game_publisher AS T2 ON T1.id = T2.game_id INNER JOIN publisher AS T3 ON T2.publisher_id = T3.id INNER JOIN genre AS T4 ON T1.genre_id = T4.id WHERE T3.publisher_name = 'Namco Bandai Games'
Database: video_games
Question: How many times more is the number of games which were published by Atari than Athena?
Evidence: published by Atari refers to publisher_name = 'Atari'; published by  Athena refers to publisher_name = 'Athena'; times = divide(sum(publisher_id where publisher_name = 'Atari'), sum(publisher_id where publisher_name = 'Athena'))
SQL: SELECT CAST(COUNT(CASE WHEN T1.publisher_name = 'Atari' THEN T2.game_id ELSE NULL END) AS REAL) / COUNT(CASE WHEN T1.publisher_name = 'Athena' THEN T2.game_id ELSE NULL END) FROM publisher AS T1 INNER JOIN game_publisher AS T2 ON T1.id = T2.publisher_id
Database: video_games
Question: How many games did Electronic Arts publish?
Evidence: Electronic Arts refers to publisher_name = 'Electronic Arts'
SQL: SELECT COUNT(DISTINCT T2.game_id) FROM publisher AS T1 INNER JOIN game_publisher AS T2 ON T1.id = T2.publisher_id WHERE T1.publisher_name = 'Electronic Arts'
Database: video_games
Question: What is the genre of the Advent Rising game?
Evidence: genre refers to genre_name; Advent Rising game refers to game_name = 'Advent Rising'
SQL: SELECT T2.genre_name FROM game AS T1 INNER JOIN genre AS T2 ON T1.genre_id = T2.id WHERE T1.game_name = 'Advent Rising'
Database: video_games
Question: How many role-playing games did Microsoft Game Studios publish?
Evidence: role-playing game refers to genre_name = 'Role-Playing'; Microsoft Game Studios refers to publisher_name = 'Microsoft Game Studios'
SQL: SELECT COUNT(T3.id) FROM publisher AS T1 INNER JOIN game_publisher AS T2 ON T1.id = T2.publisher_id INNER JOIN game AS T3 ON T2.game_id = T3.id INNER JOIN genre AS T4 ON T3.genre_id = T4.id WHERE T4.genre_name = 'Role-Playing' AND T1.publisher_name = 'Microsoft Game Studios'
Database: video_games
Question: Which publisher published the most games?
Evidence: publisher refers to publisher_name; the most games refers to max(count(publisher_id))
SQL: SELECT T.publisher_name FROM ( SELECT T2.publisher_name, COUNT(DISTINCT T1.game_id) FROM game_publisher AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.id GROUP BY T2.publisher_name ORDER BY COUNT(DISTINCT T1.game_id) DESC LIMIT 1 ) t
Database: video_games
Question: In 2004, what are the names of the platforms where Codemasters publish its games?
Evidence: name of platform refers to platform_name; Codemasters refers to publisher_name = 'Codemasters'; in 2004 refers to release_year = 2004
SQL: SELECT T4.platform_name FROM publisher AS T1 INNER JOIN game_publisher AS T2 ON T1.id = T2.publisher_id INNER JOIN game_platform AS T3 ON T2.id = T3.game_publisher_id INNER JOIN platform AS T4 ON T3.platform_id = T4.id WHERE T3.release_year = 2004 AND T1.publisher_name = 'Codemasters'
Database: video_games
Question: How many games were released on PS4 in 2014?
Evidence: on PS4 refers to platform_name = 'PS4'; in 2014 refers to release_year = 2014
SQL: SELECT COUNT(DISTINCT T3.game_id) FROM platform AS T1 INNER JOIN game_platform AS T2 ON T1.id = T2.platform_id INNER JOIN game_publisher AS T3 ON T2.game_publisher_id = T3.id WHERE T1.platform_name = 'PS4' AND T2.release_year = 2014
Database: video_games
Question: What are the names of the publishers who published the oldest games?
Evidence: name of publisher refers to publisher_name; the oldest game refers to min(release_year)
SQL: SELECT DISTINCT T3.publisher_name FROM game_platform AS T1 INNER JOIN game_publisher AS T2 ON T1.game_publisher_id = T2.id INNER JOIN publisher AS T3 ON T2.publisher_id = T3.id ORDER BY T1.release_year LIMIT 1
Database: video_games
Question: How many publishers in Japan released a game on X360 in 2011?
Evidence: in Japan refers to region_name = 'Japan'; on X360 refers to platform_name = 'X360'; in 2011 refers to release_year = 2011
SQL: SELECT COUNT(T3.game_publisher_id) FROM region AS T1 INNER JOIN region_sales AS T2 ON T1.id = T2.region_id INNER JOIN game_platform AS T3 ON T2.game_platform_id = T3.id INNER JOIN platform AS T4 ON T3.platform_id = T4.id WHERE T4.platform_name = 'X360' AND T3.release_year = 2011 AND T1.region_name = 'Japan'