Chinastark/bird_dataset huggingface dataset:
Database: video_games
Note: name of publisher refers to publisher_name; the most games refers to max(game_id);
Question: State the name of the publisher with the most games.
SQL: SELECT t.publisher_name FROM ( SELECT publisher.publisher_name, count(DISTINCT game_publisher.game_id) FROM game_publisher INNER JOIN publisher ON game_publisher.publisher_id = publisher.id GROUP BY publisher.publisher_name ORDER BY count(DISTINCT game_publisher.game_id) DESC LIMIT 1 ) t
Database: video_games
Note: 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'));
Question: How many more sports games than simulation games?
SQL: SELECT count(CASE WHEN genre.genre_name = 'Sports' THEN game.id ELSE NULL END) - count(CASE WHEN genre.genre_name = 'Simulation' THEN game.id ELSE NULL END) FROM genre INNER JOIN game ON genre.id = game.genre_id
Database: video_games
Note: genre refers to genre_name; game "Resident Evil: Revelations" refers to game_name = 'Resident Evil: Revelations';
Question: Tell the genre of the game "Resident Evil: Revelations".
SQL: SELECT genre.genre_name FROM game INNER JOIN genre ON game.genre_id = genre.id WHERE game.game_name = 'Resident Evil: Revelations'
Database: video_games
Note: number of sales = multiply(num_sales, 100000); in Europe refers to region_name = 'Europe';
Question: How many sales does game platform id 3871 make in Europe?
SQL: SELECT region_sales.num_sales * 100000 FROM region INNER JOIN region_sales ON region.id = region_sales.region_id WHERE region.region_name = 'Europe' AND region_sales.game_platform_id = 3871
Database: video_games
Note: published by Ascaron Entertainment GmbH refers to publisher_name = 'Ascaron Entertainment GmbH';
Question: Give the number of games which were published by Ascaron Entertainment GmbH.
SQL: SELECT count(game_publisher.game_id) FROM publisher INNER JOIN game_publisher ON publisher.id = game_publisher.publisher_id WHERE publisher.publisher_name = 'Ascaron Entertainment GmbH'
Database: video_games
Note: the earliest refers to min(release_year); name of platform refers to platform_name;
Question: Show the name of the earliest platform in the database.
SQL: SELECT platform.platform_name FROM game_platform INNER JOIN platform ON game_platform.platform_id = platform.id ORDER BY game_platform.release_year ASC LIMIT 1
Database: video_games
Note: 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';
Question: For all the games which were published by Namco Bandai Games, what percentage of them were adventure games?
SQL: SELECT cast(count(CASE WHEN genre.genre_name = 'Adventure' 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 = 'Namco Bandai Games'
Database: video_games
Note: 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'));
Question: How many times more is the number of games which were published by Atari than Athena?
SQL: SELECT cast(count(CASE WHEN publisher.publisher_name = 'Atari' THEN game_publisher.game_id ELSE NULL END) AS REAL) / count(CASE WHEN publisher.publisher_name = 'Athena' THEN game_publisher.game_id ELSE NULL END) FROM publisher INNER JOIN game_publisher ON publisher.id = game_publisher.publisher_id
Database: video_games
Note: Electronic Arts refers to publisher_name = 'Electronic Arts';
Question: How many games did Electronic Arts publish?
SQL: SELECT count(DISTINCT game_publisher.game_id) FROM publisher INNER JOIN game_publisher ON publisher.id = game_publisher.publisher_id WHERE publisher.publisher_name = 'Electronic Arts'
Database: video_games
Note: genre refers to genre_name; Advent Rising game refers to game_name = 'Advent Rising';
Question: What is the genre of the Advent Rising game?
SQL: SELECT genre.genre_name FROM game INNER JOIN genre ON game.genre_id = genre.id WHERE game.game_name = 'Advent Rising'
Database: video_games
Note: role-playing game refers to genre_name = 'Role-Playing'; Microsoft game Studios refers to publisher_name = 'Microsoft game Studios';
Question: How many role-playing games did Microsoft Game Studios publish?
SQL: SELECT count(game.id) FROM publisher INNER JOIN game_publisher ON publisher.id = game_publisher.publisher_id INNER JOIN game ON game_publisher.game_id = game.id INNER JOIN genre ON game.genre_id = genre.id WHERE genre.genre_name = 'Role-Playing' AND publisher.publisher_name = 'Microsoft Game Studios'
Database: video_games
Note: publisher refers to publisher_name; the most games refers to max(count(publisher_id));
Question: Which publisher published the most games?
SQL: SELECT t.publisher_name FROM ( SELECT publisher.publisher_name, count(DISTINCT game_publisher.game_id) FROM game_publisher INNER JOIN publisher ON game_publisher.publisher_id = publisher.id GROUP BY publisher.publisher_name ORDER BY count(DISTINCT game_publisher.game_id) DESC LIMIT 1 ) t
Database: video_games
Note: name of platform refers to platform_name; Codemasters refers to publisher_name = 'Codemasters'; in 2004 refers to release_year = 2004;
Question: In 2004, what are the names of the platforms where Codemasters publish its games?
SQL: SELECT platform.platform_name FROM publisher INNER JOIN game_publisher ON publisher.id = game_publisher.publisher_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_platform.release_year = 2004 AND publisher.publisher_name = 'Codemasters'
Database: video_games
Note: on PS4 refers to platform_name = 'PS4'; in 2014 refers to release_year = 2014;
Question: How many games were released on PS4 in 2014?
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 = 'PS4' AND game_platform.release_year = 2014
Database: video_games
Note: name of publisher refers to publisher_name; the oldest game refers to min(release_year);
Question: What are the names of the publishers who published the oldest games?
SQL: SELECT DISTINCT publisher.publisher_name FROM game_platform INNER JOIN game_publisher ON game_platform.game_publisher_id = game_publisher.id INNER JOIN publisher ON game_publisher.publisher_id = publisher.id ORDER BY game_platform.release_year LIMIT 1
Database: video_games
Note: in Japan refers to region_name = 'Japan'; on X360 refers to platform_name = 'X360'; in 2011 refers to release_year = 2011;
Question: How many publishers in Japan released a game on X360 in 2011?
SQL: SELECT count(game_platform.game_publisher_id) FROM region INNER JOIN region_sales ON region.id = region_sales.region_id 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 = 'X360' AND game_platform.release_year = 2011 AND region.region_name = 'Japan'
Database: video_games
Note: game platform refers to game_platform_id; the most popular refers to max(num_sales); in Europe refers to region_name = 'Europe';
Question: Which game platform is the most popular in Europe?
SQL: SELECT t.platform_name FROM ( SELECT platform.platform_name, sum(region_sales.num_sales) FROM region INNER JOIN region_sales ON region.id = region_sales.region_id INNER JOIN game_platform ON region_sales.game_platform_id = game_platform.id INNER JOIN platform ON game_platform.platform_id = platform.id WHERE region.region_name = 'Europe' ORDER BY region_sales.num_sales DESC LIMIT 1 ) t
Database: video_games
Note: year refers to release_year; the most number of releases refers to max(count(game_id));
Question: Which year has the most number of PC games releases?
SQL: SELECT t.release_year FROM ( SELECT game_platform.release_year, 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 = 'PC' GROUP BY game_platform.release_year ORDER BY count(DISTINCT game_publisher.game_id) DESC LIMIT 1 ) t
Database: video_games
Note: name of publisher refers to publisher_name; published one game only refers to count(publisher_id) = 1;
Question: List the names of all the publishers who published one game only.
SQL: SELECT t.publisher_name FROM ( SELECT publisher.publisher_name, count(DISTINCT game_publisher.game_id) FROM game_publisher INNER JOIN publisher ON game_publisher.publisher_id = publisher.id GROUP BY publisher.publisher_name HAVING count(DISTINCT game_publisher.game_id) = 1 ) t
Database: video_games
Note: name of game refers to game_name; published by 505 games refers to publisher_name = '505 games';
Question: What are the names of the games that were published by 505 Games?
SQL: SELECT game.game_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 publisher.publisher_name = '505 Games'
Database: video_games
Note: the game named 25 to Life refers to game_name = '25 to Life';
Question: What is the genre ID of the game named 25 to Life?
SQL: SELECT t.genre_id FROM game AS t WHERE t.game_name = '25 to Life'
Database: video_games
Note: game id refers to game.id; genre id 2 refers to genre_id = 2;
Question: List down the game ID of games with genre ID 2.
SQL: SELECT t.id FROM game AS t WHERE t.genre_id = 2
Database: video_games
Note: record id 1 to 10 refers to game.id BETWEEN 1 AND 10;
Question: Provide the release year of record ID 1 to 10.
SQL: SELECT t.release_year FROM game_platform AS t WHERE t.id BETWEEN 1 AND 10
Database: video_games
Note: platform id 15 refers to platform_id = 15;
Question: Give the game publisher ID of records with platform ID 15.
SQL: SELECT t.game_publisher_id FROM game_platform AS t WHERE t.platform_id = 15
Database: video_games
Note: record id refers to game.id; released between 2000 to 2003 refers to release_year BETWEEN 2000 AND 2003;
Question: List down the record ID of records released between 2000 to 2003.
SQL: SELECT t.id FROM game_platform AS t WHERE t.release_year BETWEEN 2000 AND 2003
Database: video_games
Note: number of sales refers to multiply(num_sales, 100000);
Question: What is the number of sales in region ID 2 with game platform ID 9615?
SQL: SELECT t.num_sales * 100000 FROM region_sales AS t WHERE t.region_id = 2 AND t.game_platform_id = 9615
Database: video_games
Note: name of platform refers to platform_name; released in 2016 refers to release_year = 2016;
Question: List down the names of platform where the games released in 2016 can be played on.
SQL: SELECT DISTINCT platform.platform_name FROM platform INNER JOIN game_platform ON platform.id = game_platform.platform_id WHERE game_platform.release_year = 2016
Database: video_games
Note: when refers to release_year; the game titled 3DS Classic Collection refers to game_name = '3DS Classic Collection';
Question: When was the game titled 3DS Classic Collection released?
SQL: SELECT game_platform.release_year FROM game_platform 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 = '3DS Classic Collection'
Database: video_games
Note: in Japan refers to region_name = 'Japan'; average number of sales = multiply(avg(num_sales), 100000) where region_name = 'Japan';
Question: What is the average number of sales in Japan?
SQL: SELECT avg(region_sales.num_sales) * 100000 AS avg_japan FROM region INNER JOIN region_sales ON region.id = region_sales.region_id WHERE region.region_name = 'Japan'
Database: video_games
Note: genre refers to genre_name; released from 2000 to 2002 refers to release_year BETWEEN 2000 AND 2002;
Question: Give the genre of the games released from 2000 to 2002.
SQL: SELECT DISTINCT genre.genre_name FROM game_platform INNER JOIN game_publisher ON game_platform.game_publisher_id = game_publisher.id INNER JOIN game ON game_publisher.game_id = game.id INNER JOIN genre ON game.genre_id = genre.id WHERE game_platform.release_year BETWEEN 2000 AND 2002
Database: video_games
Note: name of game refers to game_name; published by 3DO refers to publisher_name = '3DO';
Question: List down the name of games published by 3DO.
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 = '3DO'
Database: video_games
Note: role-playing game refers to genre_name = 'Role-Playing';
Question: How many role-playing games are there?
SQL: SELECT count(game.id) FROM game INNER JOIN genre ON game.genre_id = genre.id WHERE genre.genre_name = 'Role-Playing'
Database: video_games
Note: reached 300000 sales and above refers to num_sales > 3;
Question: List the region name where games reached 300000 sales and above.
SQL: SELECT DISTINCT region.region_name FROM region INNER JOIN region_sales ON region.id = region_sales.region_id WHERE region_sales.num_sales * 100000 > 300000
Database: video_games
Note: company refers to publisher_name; the most sales refers to max(num_sales); in North America refers to region_name = 'North America';
Question: Which company published the game with the most sales in North America?
SQL: SELECT t.publisher_name FROM ( SELECT publisher.publisher_name, sum(region_sales.num_sales) * 100000 FROM region INNER JOIN region_sales ON region.id = region_sales.region_id INNER JOIN game_platform ON region_sales.game_platform_id = game_platform.id INNER JOIN game_publisher ON game_platform.game_publisher_id = game_publisher.id INNER JOIN publisher ON game_publisher.publisher_id = publisher.id WHERE region.region_name = 'North America' GROUP BY publisher.publisher_name ORDER BY sum(region_sales.num_sales) * 100000 DESC LIMIT 1 ) t
Database: video_games
Note: gained 350000 sales refers to num_sales = 3.5; in North America refers to region_name = 'North America';
Question: What is the release year of the game that gained 350000 sales in North America?
SQL: SELECT game_platform.release_year FROM region INNER JOIN region_sales ON region.id = region_sales.region_id INNER JOIN game_platform ON region_sales.game_platform_id = game_platform.id WHERE region_sales.num_sales * 100000 = 350000 AND region.region_name = 'North America'
Database: video_games
Note: platform refers to platform_name; the game titled 15 Days refers to game_name = '15 Days';
Question: In which platform does the game titled 15 Days available?
SQL: SELECT platform.platform_name 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 INNER JOIN game ON game_publisher.game_id = game.id WHERE game.game_name = 'Counter Force'
Database: video_games
Note: name of publisher refers to publisher_name; the game id 75 refers to game_id = 75;
Question: Give the name of the publisher of the game ID 75.
SQL: SELECT publisher.publisher_name FROM game_publisher INNER JOIN publisher ON game_publisher.publisher_id = publisher.id WHERE game_publisher.game_id = 75
Database: video_games
Note: title of the game refers to game_name; gained the most sales refers to max(num_sales); in Japan refers to region_name = 'Japan';
Question: What is the title of the game that gained the most sales in Japan?
SQL: SELECT t.game_name FROM ( SELECT game.game_name FROM region INNER JOIN region_sales ON region.id = region_sales.region_id INNER JOIN game_platform ON region_sales.game_platform_id = game_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 region.region_name = 'Japan' ORDER BY region_sales.num_sales DESC LIMIT 1 ) t
Database: video_games
Note: game publisher's name refers to publisher_name; sales greater than 90% of the average sales refers to num_sales > multiply(0.9, avg(num_sales)); in Japan refers to region_name = 'Japan';
Question: Provide the game publisher's name of the game with sales greater than 90% of the average sales in Japan.
SQL: SELECT DISTINCT publisher.publisher_name FROM region INNER JOIN region_sales ON region.id = region_sales.region_id INNER JOIN game_platform ON region_sales.game_platform_id = game_platform.id INNER JOIN game_publisher ON game_platform.game_publisher_id = game_publisher.id INNER JOIN publisher ON game_publisher.publisher_id = publisher.id WHERE region_sales.num_sales * 10000000 > ( SELECT avg(region_sales.num_sales) * 100000 * 90 FROM region INNER JOIN region_sales ON region.id = region_sales.region_id WHERE region.region_name = 'Japan' )
Database: video_games
Note: in 2004 refers to release_year = 2004; on PSP refers to platform_name = 'PSP'; percentage = divide(sum(platform_id where platform_name = 'PSP'), count(platform_id)) * 100% where release_year = 2004;
Question: Among the games released in 2004, what is the percentage of games on PSP?
SQL: SELECT cast(count(CASE WHEN platform.platform_name = 'PSP' THEN game_publisher.game_id ELSE NULL END) AS REAL) * 100 / count(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 game_platform.release_year = 2004
Database: video_games
Note: released in 1981 refers to release_year = 1981;
Question: How many games were released in 1981?
SQL: SELECT count(t.id) FROM game_platform AS t WHERE t.release_year = 1981
Database: video_games
Note: the '2Xtreme' game refers to game_name = '2Xtreme';
Question: What is the genre ID of the '2Xtreme' game?
SQL: SELECT t.genre_id FROM game AS t WHERE t.game_name = '2Xtreme'
Database: video_games
Note: total game sales refers to multiply(sum(num_sales), 100000); platform id 9658 refers to game_platform_id = 9658;
Question: Sum the total game sales in every region for platform ID 9658.
SQL: SELECT sum(t.num_sales) * 100000 FROM region_sales AS t WHERE t.game_platform_id = 9658
Database: video_games
Note: id refers to publisher.id; 1C Company refers to publisher_name = '1C Company';
Question: Provide the ID of 1C Company.
SQL: SELECT t.id FROM publisher AS t WHERE t.publisher_name = '1C Company'
Database: video_games
Note: genre id 3 refers to genre.id = 3;
Question: Provide the genre name of the genre ID 3.
SQL: SELECT t.genre_name FROM genre AS t WHERE t.id = 3
Database: video_games
Note: game id refers to game.id; released in 2017 refers to release_year = 2017;
Question: List the game IDs that were released in 2017.
SQL: SELECT t.id FROM game_platform AS t WHERE t.release_year = 2017
Database: video_games
Note: when refers to release_year; the "Adventure Island" game refers to game_name = 'Adventure Island';
Question: When was the "Adventure Island" game released?
SQL: SELECT game_platform.release_year FROM game INNER JOIN game_publisher ON game.id = game_publisher.game_id INNER JOIN game_platform ON game_publisher.id = game_platform.game_publisher_id WHERE game.game_name = 'Adventure Island'
Database: video_games
Note: puzzle genre refers to genre_name = 'Puzzle';
Question: How many games are puzzle genre?
SQL: SELECT count(game.id) FROM game INNER JOIN genre ON game.genre_id = genre.id WHERE genre.genre_name = 'Puzzle'
Database: video_games
Note: game refers to game_name; on the SCD platform refers to platform_name = 'SCD';
Question: Provide the games that can be played on the SCD platform.
SQL: SELECT game.game_name 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 platform.platform_name = 'SCD'
Database: video_games
Note: published by Acclaim Entertainment refers to publisher_name = 'Acclaim Entertainment';
Question: How many games were published by Acclaim Entertainment?
SQL: SELECT count(DISTINCT game_publisher.game_id) FROM game_publisher INNER JOIN publisher ON game_publisher.publisher_id = publisher.id WHERE publisher.publisher_name = 'Acclaim Entertainment'
Database: video_games
Note: publisher refers to publisher_name; the Chronicles of the Sword game refers to game_name = 'Chronicles of the Sword';
Question: Name the publisher of the Chronicles of the Sword game.
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 = 'Chronicles of the Sword'
Database: video_games
Note: number of games sold refers to sum(multiply(num_sales, 100000)); in North America refers to region_name = 'North America'; on the PS4 platform refers to platform_name = 'PS4';
Question: Provide the number of games sold in North America on the PS4 platform.
SQL: SELECT sum(region_sales.num_sales * 100000) FROM region_sales INNER JOIN region ON region_sales.region_id = region.id INNER JOIN game_platform ON region_sales.game_platform_id = game_platform.id INNER JOIN platform ON game_platform.platform_id = platform.id WHERE region.region_name = 'North America' AND platform.platform_name = 'PS4'
Database: video_games
Note: id refers to game_platform_id; the most popular refers to max(num_sales); in Europe refers to region_name = 'Europe';
Question: Provide the ID of the most popular platform in Europe.
SQL: SELECT t.game_platform_id FROM ( SELECT region_sales.game_platform_id, sum(region_sales.num_sales) FROM region_sales INNER JOIN region ON region_sales.region_id = region.id WHERE region.region_name = 'Europe' GROUP BY region_sales.game_platform_id ORDER BY sum(region_sales.num_sales) DESC LIMIT 1 ) t
Database: video_games
Note: game refers to game_name; released in 2011 refers to release_year = 2011;
Question: Name the game released in 2011.
SQL: SELECT game.game_name FROM game_platform 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_platform.release_year = 2011
Database: video_games
Note: on the Wii platform refers to platform_name = 'Wii';
Question: How many games can be played on the Wii platform?
SQL: SELECT count(game_platform.id) FROM game_platform INNER JOIN platform ON game_platform.platform_id = platform.id WHERE platform.platform_name = 'Wii'
Database: video_games
Note: game refers to game_name; under the sports genre refers to genre_name = 'Sports';
Question: Provide any five games and release year under the sports genre.
SQL: SELECT game.game_name, game_platform.release_year FROM game_platform INNER JOIN game_publisher ON game_platform.game_publisher_id = game_publisher.id INNER JOIN game ON game_publisher.game_id = game.id INNER JOIN genre ON game.genre_id = genre.id WHERE genre.genre_name = 'Sports' LIMIT 5
Database: video_games
Note: genre refers to genre_name; the 2Xtreme game refers to game_name = '2Xtreme';
Question: Mention the genre of the 2Xtreme.
SQL: SELECT genre.id FROM game INNER JOIN genre ON game.genre_id = genre.id WHERE game.game_name = '2Xtreme'
Database: video_games
Note: platform refers to platform_name; the Panzer Tactics is a game name.;
Question: Provide the platform where the Panzer Tactics can be played.
SQL: SELECT platform.platform_name FROM game INNER JOIN game_publisher ON game.id = game_publisher.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'