Chinastark/bird_dataset huggingface dataset:
Database: video_games
Note: which region refers to region_name; highest number of games sold on all platforms refers to MAX(SUM(num_sales));
Question: Which region has the highest number of games sold on all platforms?
SQL: SELECT t.region_name FROM ( SELECT region.region_name, sum(region_sales.num_sales) 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 GROUP BY platform.platform_name ORDER BY sum(region_sales.num_sales) DESC LIMIT 1 ) t
Database: video_games
Note: how many games = MULTIPLY(SUM(num_sales), 100000); PS3 refers to platform_name = 'PS3'; Japan refers to region_name = 'Japan';
Question: How many games were sold on PS3 platform in Japan?
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 = 'Japan' AND platform.platform_name = 'PS3'
Database: video_games
Note: names of games refers to game_name; released in 2007 refers to release_year = 2007;
Question: What are the names of games that were released in 2007?
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 = 2007
Database: video_games
Note: Activision refers to publisher_name = 'Activision';
Question: How many games were published by Activision?
SQL: SELECT count(DISTINCT game.id) FROM game_publisher INNER JOIN publisher ON game_publisher.publisher_id = publisher.id INNER JOIN game ON game_publisher.game_id = game.id WHERE publisher.publisher_name = 'Activision'
Database: video_games
Note: more than 200000 sales refers to SUM(num_sales) > 2; Japan refers to region_name = 'Japan';
Question: Indicate the release year of the game with more than 200000 sales in Japan.
SQL: SELECT DISTINCT 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 > 200000 AND region.region_name = 'Japan'
Database: video_games
Note: in 2010 refers to release_year = 2010; PS3 refers to platform_name = 'PS3';
Question: In 2010, how many PS3 games were released?
SQL: SELECT 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 platform.platform_name = 'PS3' AND game_platform.release_year = 2010
Database: video_games
Note: publisher refers to publisher_name; publisher who has published the most games of all time refers to MAX(COUNT(publisher_name));
Question: Indicate the publisher who has published the most games of all time.
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: shooter games refers to game_name WHERE genre_name = 'shooter';
Question: How many shooter games are there?
SQL: SELECT count(game.id) FROM game INNER JOIN genre ON game.genre_id = genre.id WHERE genre.genre_name = 'Shooter'
Database: video_games
Note: percentage - MULTIPLY(DIVidE(SUM(platform_name = 'PS4'), COUNT(game_id)), 100); in 2014 refers to release_year = 2014;
Question: What is the percentage of games that were released on PS4 in 2014 among all platforms?
SQL: SELECT cast(count(CASE WHEN platform.platform_name = 'PS4' THEN game_publisher.game_id ELSE NULL END) AS REAL) * 100 / count(game_publisher.game_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 WHERE game_platform.release_year = 2014
Database: video_games
Note: how much are the sales = SUM(num_sales);
Question: How much are the sales of the games in region ID 4?
SQL: SELECT sum(t.num_sales) * 100000 FROM region_sales AS t WHERE t.region_id = 4
Database: video_games
Question: List down the game platform IDs of games with a region ID of 1.
SQL: SELECT t.game_platform_id FROM region_sales AS t WHERE t.region_id = 1
Database: video_games
Note: difference = SUBTRACT(SUM(num_sales WHERE region_id = 2), SUM(num_sales WHERE region_id = 3));
Question: Calculate the difference between sales of games from region ID 2 and region ID 3.
SQL: SELECT sum(CASE WHEN t.region_id = 2 THEN t.num_sales ELSE 0 END) - sum(CASE WHEN t.region_id = 3 THEN t.num_sales ELSE 0 END) FROM region_sales t
Database: video_games
Note: released in 2007 refers to release_year = 2007;
Question: List down the platform IDs of the games released in 2007.
SQL: SELECT DISTINCT t.platform_id FROM game_platform AS t WHERE t.release_year = 2007
Database: video_games
Question: State the game publisher IDs of the games with a platform ID of 16.
SQL: SELECT t.game_publisher_id FROM game_platform AS t WHERE t.platform_id = 16
Database: video_games
Note: released in 1984 refers to release_year = 1984;
Question: Calculate the number of game publisher IDs for games released in 1984.
SQL: SELECT count(t.game_publisher_id) FROM game_platform AS t WHERE t.release_year = 1984
Database: video_games
Question: List down the platform IDs of the games with a region ID of 3.
SQL: SELECT game_platform.id FROM region_sales INNER JOIN game_platform ON region_sales.game_platform_id = game_platform.id WHERE region_sales.region_id = 3
Database: video_games
Note: sales = SUM(num_sales); Japan region refers to region_name = 'Japan';
Question: What are the sales made by the games in Japan region?
SQL: SELECT sum(CASE WHEN region.region_name = 'Japan' THEN region_sales.num_sales ELSE 0 END) AS nums FROM region_sales INNER JOIN region ON region_sales.region_id = region.id
Database: video_games
Note: X360 refers to platform_name = 'X360';
Question: How many game publisher IDs have published games on the X360 platform?
SQL: SELECT count(game_platform.game_publisher_id) FROM game_platform INNER JOIN platform ON game_platform.platform_id = platform.id WHERE platform.platform_name = 'X360'
Database: video_games
Note: name of the platforms refers to platform_name; released in 2000 refers to release_year = 2000;
Question: State the name of the platforms for games released in 2000.
SQL: SELECT DISTINCT platform.platform_name FROM game_platform INNER JOIN platform ON game_platform.platform_id = platform.id WHERE game_platform.release_year = 2000
Database: video_games
Note: difference = SUBTRACT(SUM(platform_name = 'PS3'), SUM(platform_name = 'X360')); PS3 refers to platform_name = 'PS3'; X360 refers to platform_name = 'X360';
Question: Find out the difference between the number of publishers who released the games on the PS3 and X360.
SQL: SELECT count(CASE WHEN platform.platform_name = 'PS3' THEN game_platform.game_publisher_id ELSE NULL END) - count(CASE WHEN platform.platform_name = 'X360' THEN game_platform.game_publisher_id ELSE NULL END) FROM game_platform INNER JOIN platform ON game_platform.platform_id = platform.id
Database: video_games
Note: Bethesda Softworks refers to publisher_name = 'Bethesda Softworks';
Question: What are the game IDs of the games published by Bethesda Softworks?
SQL: SELECT game_publisher.game_id FROM game_publisher INNER JOIN publisher ON game_publisher.publisher_id = publisher.id WHERE publisher.publisher_name = 'Bethesda Softworks'
Database: video_games
Note: Capcom refers to publisher_name = 'Capcom';  Sony Computer Entertainment refers to publisher_name = 'Sony Computer Entertainment';
Question: Calculate the total number of IDs for the game published by Capcom and Sony Computer 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 IN ('Capcom', 'Sony Computer Entertainment')
Database: video_games
Note: genre refers to genre_name; "Grand Theft Auto V" refers to game_name = 'Grand Theft Auto V';
Question: What is the genre of the game "Grand Theft Auto V"?
SQL: SELECT genre.genre_name FROM game INNER JOIN genre ON game.genre_id = genre.id WHERE game.game_name = 'Grand Theft Auto V'
Database: video_games
Note: name of games refers to game_name; racing genre refers to genre_name = 'Racing';
Question: List down the names of the games in the racing genre.
SQL: SELECT game.game_name FROM game INNER JOIN genre ON game.genre_id = genre.id WHERE genre.genre_name = 'Racing'
Database: video_games
Note: fighting genre refers to genre_name = 'Fighting';
Question: Calculate the number of games in the fighting genre.
SQL: SELECT count(game.id) FROM game INNER JOIN genre ON game.genre_id = genre.id WHERE genre.genre_name = 'Fighting'
Database: video_games
Note: genres of games refers to genre_name; publisher with an id of 464 refers to publisher_id = 464;
Question: What are the genres of games published by the publisher with an ID of 464?
SQL: SELECT DISTINCT genre.genre_name FROM game INNER JOIN genre ON game.genre_id = genre.id INNER JOIN game_publisher ON game.id = game_publisher.game_id WHERE game_publisher.publisher_id = 464
Database: video_games
Note: platform of the game refers to platform_name; "Final Fantasy XIII-2" refers to game_name = 'Final Fantasy XIII-2';
Question: Find out the platform of the game "Final Fantasy XIII-2".
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 = 'Final Fantasy XIII-2'
Database: video_games
Note: total sales = SUM(num_sales); released in 2000 refers to release_year = 2000;
Question: Calculate the total sales made by the games released in 2000.
SQL: SELECT sum(region_sales.num_sales) FROM region_sales INNER JOIN game_platform ON region_sales.game_platform_id = game_platform.id WHERE game_platform.release_year = 2000
Database: video_games
Note: difference = SUBTRACT(SUM(num_sales WHERE release_year = 2000), SUM(num_sales WHERE release_year = 1990));
Question: Calculate the difference in sales between the games released in 1990 and 2000.
SQL: SELECT sum(CASE WHEN game_platform.release_year = 2000 THEN region_sales.num_sales ELSE 0 END) - sum(CASE WHEN game_platform.release_year = 1990 THEN region_sales.num_sales ELSE 0 END) FROM region_sales INNER JOIN game_platform ON region_sales.game_platform_id = game_platform.id
Database: video_games
Note: released in 1990 refers to release_year = 1990; 2000 refers to release_year = 2000;
Question: What are the platform IDs of records released in 2006?
SQL: SELECT DISTINCT t.platform_id FROM game_platform AS t WHERE t.release_year = 2006
Database: video_games
Note: average = AVG(MULTIPLY(num_sales, 100000));
Question: Compute the average number of sales in region ID 3.
SQL: SELECT avg(t.num_sales * 100000) FROM region_sales AS t WHERE t.region_id = 3
Database: video_games
Note: which year refers to release_year; record id 19 refers to game platform.id; id = 19;
Question: In which year did the record ID 19 with game publisher ID 6657 released?
SQL: SELECT t.release_year FROM game_platform AS t WHERE t.game_publisher_id = 6657 AND t.id = 19
Database: video_games
Note: total sales in all regions = MULTIPLY(SUM(num_sales), 100000);
Question: Calculate the total sales in all regions with game platform ID 66.
SQL: SELECT sum(t.num_sales) * 100000 FROM region_sales AS t WHERE t.game_platform_id = 66
Database: video_games
Question: Give the game name of the game ID 44.
SQL: SELECT t.game_name FROM game AS t WHERE t.id = 44
Database: video_games
Note: games available refers to game_name; Wii refers to platform_name = 'Wii';
Question: List the games available on Wii.
SQL: SELECT game.game_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 platform.platform_name = 'Wii'
Database: video_games
Note: names of games refers to game_name; released in 2015 refers to release_year = 2015;
Question: Provide the name of games released in 2015.
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 = 2015
Database: video_games
Note: adventure games refers to game_name WHERE genre_name = 'Adventure'; released in 2005 refers to release_year = 2005;
Question: What is the total number of adventure games released in 2005?
SQL: SELECT count(DISTINCT game.id) 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 = 'Adventure' AND game_platform.release_year = 2005
Database: video_games
Note: name of the company that produced the game refers to publisher_name; Adventure Time: Explore the Dungeon Because I Don't Know! Refers to game_name = 'Adventure Time: Explore the Dungeon Because I Don''t Know!';
Question: What is the name of the company that produced the game titled Adventure Time: Explore the Dungeon Because I Don't Know!?
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 = 'Adventure Time: Explore the Dungeon Because I Don''t Know!'
Database: video_games
Note: 20000 sales and below refers to num_sales < 0.2;
Question: List down the game platform ID and region name where the games achieved 20000 sales and below.
SQL: SELECT region_sales.game_platform_id, region.region_name FROM region INNER JOIN region_sales ON region.id = region_sales.region_id WHERE region_sales.num_sales * 100000 <= 20000
Database: video_games
Note: name of game refers to game_name; 505 games refers to publisher_name = '505 games'; in 2006 refers to release_year = 2006;
Question: Provide the name of game produced by 505 Games in 2006.
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 INNER JOIN publisher ON game_publisher.publisher_id = publisher.id WHERE publisher.publisher_name = '505 Games' AND game_platform.release_year = 2006
Database: video_games
Note: genre of the game refers to genre_name; game id 119 refers to game.id = 119;
Question: What is the genre of the game ID 119?
SQL: SELECT genre.genre_name FROM game INNER JOIN genre ON game.genre_id = genre.id WHERE game.id = 119
Database: video_games
Note: Abylight refers to publisher_name = 'Abylight';
Question: List the game IDs of the games produced by Abylight.
SQL: SELECT game_publisher.game_id FROM game_publisher INNER JOIN publisher ON game_publisher.publisher_id = publisher.id WHERE publisher.publisher_name = 'Abylight'
Database: video_games
Note: which region refers to region_name; lowest number of sales refers to MIN(num_sales);
Question: In which region where a game had the lowest number of sales?
SQL: SELECT DISTINCT region.region_name FROM region INNER JOIN region_sales ON region.id = region_sales.region_id ORDER BY region_sales.num_sales LIMIT 1
Database: video_games
Note: strategy games refers to game_name WHERE genre_name = 'Strategy';
Question: List down the name of strategy games.
SQL: SELECT game.game_name FROM game INNER JOIN genre ON game.genre_id = genre.id WHERE genre.genre_name = 'Strategy'
Database: video_games
Note: platform refers to platform_name;
Question: In what platform does the game ID 178 available?
SQL: SELECT platform.platform_name FROM game_publisher 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_publisher.game_id = 178
Database: video_games
Note: genre refers to genre_name; 'Airlock', 'Airline Tycoon' , and 'Airblade' refers to game_name IN ('Airlock', 'Airline Tycoon', 'Airblade');
Question: Give the genre of the following game titled 'Airlock' , 'Airline Tycoon' , and 'Airblade', respectively.
SQL: SELECT genre.genre_name FROM game INNER JOIN genre ON game.genre_id = genre.id WHERE game.game_name IN ('Airlock', 'Airline Tycoon', 'Airblade')
Database: video_games
Note: total number of sales = MULTIPLY(SUM(num_sales), 100000); North America refers to region_name = 'North America';
Question: Calculate the total number of sales in North America.
SQL: SELECT sum(region_sales.num_sales) * 100000 AS nums FROM region INNER JOIN region_sales ON region.id = region_sales.region_id WHERE region.region_name = 'North America'
Database: video_games
Note: publishers refers to publisher_name; number of sales less than 10000 refers to num_sales < 0.1;
Question: List down at least five publishers of the games with number of sales less than 10000.
SQL: SELECT t.publisher_name FROM ( 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.region_name = 'North America' AND region_sales.num_sales * 100000 < 10000 LIMIT 5 ) t
Database: video_games
Note: Airborne Troops: Countdown to D-Day refers to game_name = 'Airborne Troops: Countdown to D-Day';
Question: List the platform ID of the game titled Airborne Troops: Countdown to D-Day.
SQL: SELECT game_platform.platform_id 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 = 'Airborne Troops: Countdown to D-Day'
Database: video_games
Note: PSP refers to platform_name = 'PSP'; released in 2004 refers to release_year = 2004;
Question: How many games available on PSP were released in 2004?
SQL: SELECT 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 platform.platform_name = 'PSP' AND game_platform.release_year = 2004
Database: video_games
Note: genre of the game refers to genre_name; '999: Nine Hours, Nine Persons, Nine Doors' refers to game_name = '999: Nine Hours, Nine Persons, Nine Doors';
Question: What is the genre of the game titled '999: Nine Hours, Nine Persons, Nine Doors' ?
SQL: SELECT genre.genre_name FROM game INNER JOIN genre ON game.genre_id = genre.id WHERE game.game_name = '999: Nine Hours, Nine Persons, Nine Doors'
Database: video_games
Note: when the game was released refers to release_year;
Question: When was the game ID 156 released?
SQL: SELECT game_platform.release_year FROM game_platform INNER JOIN game_publisher ON game_platform.game_publisher_id = game_publisher.id WHERE game_publisher.game_id = 156
Database: video_games
Note: difference = SUBTRACT(SUM(platform_name = 'SNES'), SUM(platform_name = 'DS')); SNES refers to platform_name = SNES ; DS refers to platform_name = 'DS' ;
Question: What is the diffrence between the number of games produced by Culture Brain that can be played on SNES and DS?
SQL: SELECT count(CASE WHEN platform.platform_name = 'SNES' THEN game_publisher.game_id ELSE NULL END) - count(CASE WHEN platform.platform_name = 'DS' THEN game_publisher.game_id ELSE NULL END) 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 publisher ON game_publisher.publisher_id = publisher.id WHERE publisher.publisher_name = 'Culture Brain'
Database: video_games
Note: Wii refers to platform_name = 'Wii'; percentage = MULTIPLY(DIVidE(SUM(release_year = 2007), COUNT(release_year)), 100.0); released in 2007 refers to release_year = 2007;
Question: In games that can be played on Wii, what is the percentage of games released in 2007?
SQL: SELECT cast(count(CASE WHEN game_platform.release_year = 2007 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 platform.platform_name = 'Wii'
Database: video_games
Note: Europe refers to region_name = 'Europe'; sales lesser than 30% of the average number of sales refers to SUM(num_sales) < MULTIPLY(AVG(num_sales), 0.3);
Question: Among games sold in Europe, list the platform ID of games with sales lesser than 30% of the average number of sales.
SQL: SELECT DISTINCT game_platform.platform_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 WHERE region.region_name = 'Europe' AND region_sales.num_sales * 100 * 100000 < ( SELECT avg(region_sales.num_sales * 100000) * 30 FROM region INNER JOIN region_sales ON region.id = region_sales.region_id WHERE region.region_name = 'Europe' )
Database: authors
Note: affiliated refers to affiliation; 'University of California Berkeley' is the affiliation;
Question: How many authors are affiliated with University of California Berkeley?
SQL: SELECT count(id) FROM author WHERE affiliation = 'University of California Berkeley'
Database: authors
Note: "Stitching videos streamed by mobile phones in real-time" is the title of paper; what the paper is about refers to keywords;
Question: What is the paper "Stitching videos streamed by mobile phones in real-time" about?
SQL: SELECT keyword FROM paper WHERE title = 'Stitching videos streamed by mobile phones in real-time'
Database: authors
Note: journal "Concepts in Magnetic Resonance Part A" refers to fullname = 'Concepts in Magnetic Resonance Part A'; in 2018 refers to year = 2018;
Question: Please list the titles of the papers published in the journal "Concepts in Magnetic Resonance Part A" in 2008.
SQL: SELECT paper.title FROM journal INNER JOIN paper ON journal.id = paper.journalid WHERE journal.fullname = 'Concepts in Magnetic Resonance Part A' AND paper.year = 2008
Database: authors
Note: journal "Concepts in Magnetic Resonance Part A" refers to fullname = 'Concepts in Magnetic Resonance Part A';
Question: How many papers were published in the journal "Concepts in Magnetic Resonance Part A"?
SQL: SELECT count(paper.id) FROM journal INNER JOIN paper ON journal.id = paper.journalid WHERE journal.fullname = 'Concepts in Magnetic Resonance Part A'
Database: authors
Note: url refers to homepage; 'Area Effects in Cepaea' is the title of paper;
Question: What is the url of the journal in which the paper "Area Effects in Cepaea" was published?
SQL: SELECT journal.homepage FROM journal INNER JOIN paper ON journal.id = paper.journalid WHERE paper.title = 'Area Effects in Cepaea'
Database: authors
Note: "Molecular Brain" is the fullname of journal;
Question: Among the papers published in the journal "Molecular Brain", how many of them were published in the year 2011?
SQL: SELECT count(paper.id) FROM journal INNER JOIN paper ON journal.id = paper.journalid WHERE paper.year = 2011 AND journal.fullname = 'Molecular Brain'
Database: authors
Note: in 2011 refers to year = 2011; 'Mol Brain' is the shortname of journal;
Question: How many papers were published in 2011 in the journal whose short name is "Mol Brain"?
SQL: SELECT count(paper.id) FROM journal INNER JOIN paper ON journal.id = paper.journalid WHERE paper.year = 2011 AND journal.shortname = 'Mol Brain'