Chinastark/bird_dataset huggingface dataset:
Database: video_games
Question: Which game platform is the most popular in Europe?
Evidence: game platform refers to game_platform_id; the most popular refers to max(num_sales); in Europe refers to region_name = 'Europe'
SQL: SELECT T.platform_name FROM ( SELECT T4.platform_name, SUM(T2.num_sales) 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 T1.region_name = 'Europe' ORDER BY T2.num_sales DESC LIMIT 1 ) t
Database: video_games
Question: Which year has the most number of PC games releases?
Evidence: year refers to release_year; the most number of releases refers to max(count(game_id))
SQL: SELECT T.release_year FROM ( SELECT T2.release_year, 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 = 'PC' GROUP BY T2.release_year ORDER BY COUNT(DISTINCT T3.game_id) DESC LIMIT 1 ) t
Database: video_games
Question: List the names of all the publishers who published one game only.
Evidence: name of publisher refers to publisher_name; published one game only refers to count(publisher_id) = 1
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 HAVING COUNT(DISTINCT T1.game_id) = 1 ) t
Database: video_games
Question: What are the names of the games that were published by 505 Games?
Evidence: name of game refers to game_name; published by 505 Games refers to publisher_name = '505 Games'
SQL: SELECT T3.game_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 T1.publisher_name = '505 Games'
Database: video_games
Question: What is the genre ID of the game named 25 to Life?
Evidence: the game named 25 to Life refers to game_name = '25 to Life'
SQL: SELECT T.genre_id FROM game AS T WHERE T.game_name = '25 to Life'
Database: video_games
Question: List down the game ID of games with genre ID 2.
Evidence: game ID refers to game.id; genre ID 2 refers to genre_id = 2
SQL: SELECT T.id FROM game AS T WHERE T.genre_id = 2
Database: video_games
Question: Provide the release year of record ID 1 to 10.
Evidence: record ID 1 to 10 refers to game.id BETWEEN 1 AND 10
SQL: SELECT T.release_year FROM game_platform AS T WHERE T.id BETWEEN 1 AND 10
Database: video_games
Question: Give the game publisher ID of records with platform ID 15.
Evidence: platform ID 15 refers to platform_id = 15
SQL: SELECT T.game_publisher_id FROM game_platform AS T WHERE T.platform_id = 15
Database: video_games
Question: List down the record ID of records released between 2000 to 2003.
Evidence: record ID refers to game.id; released between 2000 to 2003 refers to release_year BETWEEN 2000 AND 2003
SQL: SELECT T.id FROM game_platform AS T WHERE T.release_year BETWEEN 2000 AND 2003
Database: video_games
Question: What is the number of sales in region ID 2 with game platform ID 9615?
Evidence: number of sales refers to multiply(num_sales, 100000)
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
Question: List down the names of platform where the games released in 2016 can be played on.
Evidence: name of platform refers to platform_name; released in 2016 refers to release_year = 2016
SQL: SELECT DISTINCT T1.platform_name FROM platform AS T1 INNER JOIN game_platform AS T2 ON T1.id = T2.platform_id WHERE T2.release_year = 2016
Database: video_games
Question: When was the game titled 3DS Classic Collection released?
Evidence: when refers to release_year; the game titled 3DS Classic Collection refers to game_name = '3DS Classic Collection'
SQL: SELECT T1.release_year FROM game_platform AS T1 INNER JOIN game_publisher AS T2 ON T1.game_publisher_id = T2.id INNER JOIN game AS T3 ON T2.game_id = T3.id WHERE T3.game_name = '3DS Classic Collection'
Database: video_games
Question: What is the average number of sales in Japan?
Evidence: in Japan refers to region_name = 'Japan'; average number of sales = multiply(avg(num_sales), 100000) where region_name = 'Japan'
SQL: SELECT AVG(T2.num_sales) * 100000 AS avg_japan FROM region AS T1 INNER JOIN region_sales AS T2 ON T1.id = T2.region_id WHERE T1.region_name = 'Japan'
Database: video_games
Question: Give the genre of the games released from 2000 to 2002.
Evidence: genre refers to genre_name; released from 2000 to 2002 refers to release_year BETWEEN 2000 AND 2002
SQL: SELECT DISTINCT T4.genre_name FROM game_platform AS T1 INNER JOIN game_publisher AS T2 ON T1.game_publisher_id = T2.id INNER JOIN game AS T3 ON T2.game_id = T3.id INNER JOIN genre AS T4 ON T3.genre_id = T4.id WHERE T1.release_year BETWEEN 2000 AND 2002
Database: video_games
Question: List down the name of games published by 3DO.
Evidence: name of game refers to game_name; published by 3DO refers to publisher_name = '3DO'
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 = '3DO'
Database: video_games
Question: How many role-playing games are there?
Evidence: role-playing game refers to genre_name = 'Role-Playing'
SQL: SELECT COUNT(T1.id) FROM game AS T1 INNER JOIN genre AS T2 ON T1.genre_id = T2.id WHERE T2.genre_name = 'Role-Playing'
Database: video_games
Question: List the region name where games reached 300000 sales and above.
Evidence: reached 300000 sales and above refers to num_sales > 3
SQL: SELECT DISTINCT T1.region_name FROM region AS T1 INNER JOIN region_sales AS T2 ON T1.id = T2.region_id WHERE T2.num_sales * 100000 > 300000
Database: video_games
Question: Which company published the game with the most sales in North America?
Evidence: company refers to publisher_name; the most sales refers to max(num_sales); in North America refers to region_name = 'North America'
SQL: SELECT T.publisher_name FROM ( SELECT T5.publisher_name, SUM(T2.num_sales) * 100000 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 game_publisher AS T4 ON T3.game_publisher_id = T4.id INNER JOIN publisher AS T5 ON T4.publisher_id = T5.id WHERE T1.region_name = 'North America' GROUP BY T5.publisher_name ORDER BY SUM(T2.num_sales) * 100000 DESC LIMIT 1 ) t
Database: video_games
Question: What is the release year of the game that gained 350000 sales in North America?
Evidence: gained 350000 sales refers to num_sales = 3.5; in North America refers to region_name = 'North America'
SQL: SELECT T3.release_year 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 WHERE T2.num_sales * 100000 = 350000 AND T1.region_name = 'North America'
Database: video_games
Question: In which platform does the game titled 15 Days available?
Evidence: platform refers to platform_name; the game titled 15 Days refers to game_name = '15 Days'
SQL: SELECT T1.platform_name 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 INNER JOIN game AS T4 ON T3.game_id = T4.id WHERE T4.game_name = 'Counter Force'
Database: video_games
Question: Give the name of the publisher of the game ID 75.
Evidence: name of publisher refers to publisher_name; the game ID 75 refers to game_id = 75
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 = 75
Database: video_games
Question: What is the title of the game that gained the most sales in Japan?
Evidence: title of the game refers to game_name; gained the most sales refers to max(num_sales); in Japan refers to region_name = 'Japan'
SQL: SELECT T.game_name FROM ( SELECT T5.game_name 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 game_publisher AS T4 ON T3.game_publisher_id = T4.id INNER JOIN game AS T5 ON T4.game_id = T5.id WHERE T1.region_name = 'Japan' ORDER BY T2.num_sales DESC LIMIT 1 ) t
Database: video_games
Question: Provide the game publisher's name of the game with sales greater than 90% of the average sales in Japan.
Evidence: 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'
SQL: SELECT DISTINCT T5.publisher_name 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 game_publisher AS T4 ON T3.game_publisher_id = T4.id INNER JOIN publisher AS T5 ON T4.publisher_id = T5.id WHERE T2.num_sales * 10000000 > ( SELECT AVG(T2.num_sales) * 100000 * 90 FROM region AS T1 INNER JOIN region_sales AS T2 ON T1.id = T2.region_id WHERE T1.region_name = 'Japan' )
Database: video_games
Question: Among the games released in 2004, what is the percentage of games on PSP?
Evidence: 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
SQL: SELECT CAST(COUNT(CASE WHEN T1.platform_name = 'PSP' THEN T3.game_id ELSE NULL END) AS REAL) * 100 / COUNT(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 T2.release_year = 2004
Database: video_games
Question: How many games were released in 1981?
Evidence: released in 1981 refers to release_year = 1981
SQL: SELECT COUNT(T.id) FROM game_platform AS T WHERE T.release_year = 1981
Database: video_games
Question: What is the genre ID of the '2Xtreme' game?
Evidence: the '2Xtreme' game refers to game_name = '2Xtreme'
SQL: SELECT T.genre_id FROM game AS T WHERE T.game_name = '2Xtreme'
Database: video_games
Question: Sum the total game sales in every region for platform ID 9658.
Evidence: total game sales refers to multiply(sum(num_sales), 100000); platform ID 9658 refers to game_platform_id = 9658
SQL: SELECT SUM(T.num_sales) * 100000 FROM region_sales AS T WHERE T.game_platform_id = 9658
Database: video_games
Question: Provide the ID of 1C Company.
Evidence: ID refers to publisher.id; 1C Company refers to publisher_name = '1C Company'
SQL: SELECT T.id FROM publisher AS T WHERE T.publisher_name = '1C Company'
Database: video_games
Question: Provide the genre name of the genre ID 3.
Evidence: genre ID 3 refers to genre.id = 3
SQL: SELECT T.genre_name FROM genre AS T WHERE T.id = 3
Database: video_games
Question: List the game IDs that were released in 2017.
Evidence: game ID refers to game.id; released in 2017 refers to release_year = 2017
SQL: SELECT T.id FROM game_platform AS T WHERE T.release_year = 2017
Database: video_games
Question: When was the "Adventure Island" game released?
Evidence: when refers to release_year; the "Adventure Island" game refers to game_name = 'Adventure Island'
SQL: SELECT T3.release_year FROM game AS T1 INNER JOIN game_publisher AS T2 ON T1.id = T2.game_id INNER JOIN game_platform AS T3 ON T2.id = T3.game_publisher_id WHERE T1.game_name = 'Adventure Island'
Database: video_games
Question: How many games are puzzle genre?
Evidence: puzzle genre refers to genre_name = 'Puzzle'
SQL: SELECT COUNT(T1.id) FROM game AS T1 INNER JOIN genre AS T2 ON T1.genre_id = T2.id WHERE T2.genre_name = 'Puzzle'
Database: video_games
Question: Provide the games that can be played on the SCD platform.
Evidence: game refers to game_name; on the SCD platform refers to platform_name = 'SCD'
SQL: SELECT T4.game_name 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 T2.platform_name = 'SCD'
Database: video_games
Question: How many games were published by Acclaim Entertainment?
Evidence: published by Acclaim Entertainment refers to publisher_name = 'Acclaim Entertainment'
SQL: SELECT COUNT(DISTINCT T1.game_id) FROM game_publisher AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.id WHERE T2.publisher_name = 'Acclaim Entertainment'
Database: video_games
Question: Name the publisher of the Chronicles of the Sword game.
Evidence: publisher refers to publisher_name; the Chronicles of the Sword game refers to game_name = 'Chronicles of the Sword'
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 = 'Chronicles of the Sword'
Database: video_games
Question: Provide the number of games sold in North America on the PS4 platform.
Evidence: 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'
SQL: SELECT SUM(T1.num_sales * 100000) FROM region_sales AS T1 INNER JOIN region AS T2 ON T1.region_id = T2.id INNER JOIN game_platform AS T3 ON T1.game_platform_id = T3.id INNER JOIN platform AS T4 ON T3.platform_id = T4.id WHERE T2.region_name = 'North America' AND T4.platform_name = 'PS4'
Database: video_games
Question: Provide the ID of the most popular platform in Europe.
Evidence: ID refers to game_platform_id; the most popular refers to max(num_sales); in Europe refers to region_name = 'Europe'
SQL: SELECT T.game_platform_id FROM ( SELECT T1.game_platform_id, SUM(T1.num_sales) FROM region_sales AS T1 INNER JOIN region AS T2 ON T1.region_id = T2.id WHERE T2.region_name = 'Europe' GROUP BY T1.game_platform_id ORDER BY SUM(T1.num_sales) DESC LIMIT 1 ) t
Database: video_games
Question: Name the game released in 2011.
Evidence: game refers to game_name; released in 2011 refers to release_year = 2011
SQL: SELECT T3.game_name FROM game_platform AS T1 INNER JOIN game_publisher AS T2 ON T1.game_publisher_id = T2.id INNER JOIN game AS T3 ON T2.game_id = T3.id WHERE T1.release_year = 2011
Database: video_games
Question: How many games can be played on the Wii platform?
Evidence: on the Wii platform refers to platform_name = 'Wii'
SQL: SELECT COUNT(T1.id) FROM game_platform AS T1 INNER JOIN platform AS T2 ON T1.platform_id = T2.id WHERE T2.platform_name = 'Wii'
Database: video_games
Question: Provide any five games and release year under the sports genre.
Evidence: game refers to game_name; under the sports genre refers to genre_name = 'Sports'
SQL: SELECT T3.game_name, T1.release_year FROM game_platform AS T1 INNER JOIN game_publisher AS T2 ON T1.game_publisher_id = T2.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 = 'Sports' LIMIT 5
Database: video_games
Question: Mention the genre of the 2Xtreme.
Evidence: genre refers to genre_name; the 2Xtreme game refers to game_name = '2Xtreme'
SQL: SELECT T2.id FROM game AS T1 INNER JOIN genre AS T2 ON T1.genre_id = T2.id WHERE T1.game_name = '2Xtreme'
Database: video_games
Question: Provide the platform where the Panzer Tactics can be played.
Evidence: platform refers to platform_name; the Panzer Tactics is a game name.
SQL: SELECT T4.platform_name FROM game AS T1 INNER JOIN game_publisher AS T2 ON T1.id = T2.game_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 T1.game_name = 'Panzer Tactics'
Database: video_games
Question: Calculate how many percent of sales in North America is higher than the average sale per region for platform ID 9577.
Evidence: in North America refers to region_name = 'North America'; platform ID 9577 refers to game_platform_id = 9577; percent = divide(subtract(num_sales where region_name = 'North America' and game_platform_id = 9577, avg(num_sales)), avg(num_sales)) * 100%
SQL: SELECT (SUM(CASE WHEN T2.region_name = 'North America' THEN T1.num_sales ELSE 0 END) - AVG(T1.num_sales)) * 100.0 / AVG(T1.num_sales) FROM region_sales AS T1 INNER JOIN region AS T2 ON T1.region_id = T2.id WHERE T1.game_platform_id = 9577
Database: video_games
Question: Which game has the longest name?
Evidence: game refers to game_name; the longest name refers to max(length(game_name))
SQL: SELECT T.game_name FROM game AS T ORDER BY LENGTH(T.game_name) DESC LIMIT 1
Database: video_games
Question: How many games were released in 2001?
Evidence: released in 2001 refers to release_year = 2001
SQL: SELECT COUNT(T.id) FROM game_platform AS T WHERE T.release_year = 2001
Database: video_games
Question: What is the total number of sales across all regions?
Evidence: total number of sales = sum(num_sales)
SQL: SELECT SUM(T.num_sales) * 100000 FROM region_sales t
Database: video_games
Question: What is the average number of games published by a publisher?
Evidence: average number = divide(count(game_id), count(publisher_id))
SQL: SELECT CAST(COUNT(T.game_id) AS REAL) / COUNT(DISTINCT T.publisher_id) FROM game_publisher AS T
Database: video_games
Question: What is the first year a game is released?
Evidence: the first year refers to min(release_year)
SQL: SELECT MIN(T.release_year) FROM game_platform t
Database: video_games
Question: What is the least common game genre?
Evidence: the least common game genre refers to min(count(genre_id)); genre refers to genre_name
SQL: SELECT T.game_name FROM ( SELECT T2.game_name, COUNT(T2.id) FROM genre AS T1 INNER JOIN game AS T2 ON T1.id = T2.genre_id GROUP BY T2.game_name ORDER BY COUNT(T2.id) ASC LIMIT 1 ) t
Database: video_games
Question: Which is the publisher for the game "Prism: Light the Way"?
Evidence: publisher refers to publisher_name; game "Prism: Light the Way" refers to game_name = 'Prism: Light the Way'
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 = 'Prism: Light the Way'
Database: video_games
Question: List the platforms that release the most games each year.
Evidence: platform refers to platform_id; the most games refers to max(count(game_publisher_id))
SQL: SELECT T1.platform_name 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 GROUP BY T2.release_year, T1.platform_name ORDER BY COUNT(DISTINCT T3.game_id) DESC
Database: video_games
Question: How many games do not have any sales in Europe?
Evidence: do not have any sales refers to num_sales = 0; in Europe refers to region_name = 'Europe'
SQL: SELECT COUNT(*) FROM region_sales AS T1 INNER JOIN region AS T2 ON T1.region_id = T2.id WHERE T2.region_name = 'Europe' AND T1.num_sales = 0
Database: video_games
Question: What are the games that were released in 2006?
Evidence: game refers to game_name; released in 2006 refers to release_year = 2006
SQL: SELECT T3.game_name FROM game_platform AS T1 INNER JOIN game_publisher AS T2 ON T1.game_publisher_id = T2.id INNER JOIN game AS T3 ON T2.game_id = T3.id WHERE T1.release_year = 2006
Database: video_games
Question: What is the genre of the game "Mario vs. Donkey Kong"?
Evidence: genre refers to genre_name; game "Mario vs. Donkey Kong" refers to game_name = 'Mario vs. Donkey Kong'
SQL: SELECT T1.genre_name FROM genre AS T1 INNER JOIN game AS T2 ON T1.id = T2.genre_id WHERE T2.game_name = 'Mario vs. Donkey Kong'
Database: video_games
Question: Which publisher 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 T1.publisher_name, COUNT(DISTINCT T2.game_id) FROM publisher AS T1 INNER JOIN game_publisher AS T2 ON T1.id = T2.publisher_id GROUP BY T1.publisher_name ORDER BY COUNT(DISTINCT T2.game_id) DESC LIMIT 1 ) t
Database: video_games
Question: List all the platform games.
Evidence: platform game refers to genre_name = 'Platform'; game refers to game_name
SQL: SELECT T2.game_name FROM genre AS T1 INNER JOIN game AS T2 ON T1.id = T2.genre_id WHERE T1.genre_name = 'Platform'
Database: video_games
Question: What are the years that "WiiU" got a new game?
Evidence: year refers to release_year; "WiiU" refers to platform_name = 'WiiU'
SQL: SELECT T2.release_year FROM platform AS T1 INNER JOIN game_platform AS T2 ON T1.id = T2.platform_id WHERE T1.platform_name = 'WiiU' ORDER BY T2.release_year DESC LIMIT 1
Database: video_games
Question: Which game has the most sales in Japan?
Evidence: 
which game refers to game_name; most sales refers to MAX(num_sales); Japan refers to region_name = 'Japan';
SQL: SELECT T5.game_name 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 game_publisher AS T4 ON T3.game_publisher_id = T4.id INNER JOIN game AS T5 ON T4.game_id = T5.id WHERE T1.region_name = 'Japan' ORDER BY T2.num_sales DESC LIMIT 1
Database: video_games
Question: List the games from the publisher "Activision".
Evidence: games refers to game_name; "Activision" refers to publisher_name = 'Activision';
SQL: SELECT T3.game_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 T1.publisher_name = 'Activision'
Database: video_games
Question: How many different publishers have published a game that starts with "Marvel"?
Evidence: game that starts with "Marvel" refers to game_name LIKE 'Marvel%';
SQL: SELECT COUNT(DISTINCT T1.publisher_id) FROM game_publisher AS T1 INNER JOIN game AS T2 ON T1.game_id = T2.id WHERE T2.game_name LIKE 'Marvel%'
Database: video_games
Question: What percentage of games are sports?
Evidence: percentage = MULTIPLY(DIVIDE(SUM(genre_name = 'sport'), COUNT(game_name)), 100.0); sports refers to genre_name = 'sport';
SQL: SELECT CAST(COUNT(CASE WHEN T1.genre_name = 'Sports' THEN T2.id ELSE NULL END) AS REAL) * 100 / COUNT(T2.id) FROM genre AS T1 INNER JOIN game AS T2 ON T1.id = T2.genre_id
Database: video_games
Question: What is the ratio of game sales between North America and Japan?
Evidence: ratio = DIVIDE(SUM(num_sales WHERE region_name = 'North America'), SUM(num_sales WHERE region_name = 'Japan')); North America refers to region_name = 'North America'; Japan refers to region_name = 'Japan';
SQL: SELECT SUM(CASE WHEN T2.region_name = 'North America' THEN T1.num_sales ELSE 0 END) / SUM(CASE WHEN T2.region_name = 'Japan' THEN T1.num_sales ELSE 0 END) FROM region_sales AS T1 INNER JOIN region AS T2 ON T1.region_id = T2.id
Database: video_games
Question: Which year has the most number of video game releases?
Evidence: year that has the most number of video game releases refers to MAX(COUNT(release_year));
SQL: SELECT T1.release_year FROM ( SELECT T.release_year, COUNT(id) FROM game_platform AS T GROUP BY T.release_year ORDER BY COUNT(T.id) DESC LIMIT 1 ) T1
Database: video_games
Question: How many video game publishers have Interactive in their names?
Evidence: publishers that have Interactive in their names refers to publisher_name LIKE '%Interactive%';
SQL: SELECT COUNT(T.id) FROM publisher AS T WHERE T.publisher_name LIKE '%Interactive%'
Database: video_games
Question: What are the top 2 platforms with the most sales in North America?
Evidence: platforms refers to platform_name; most sales refers to MAX(num_sales); North America refers to region_name = 'North America';
SQL: SELECT T4.platform_name 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 T1.region_name = 'North America' ORDER BY T2.num_sales DESC LIMIT 2
Database: video_games
Question: How many games did BMG Interactive Entertainment release in 2012?
Evidence: BMG Interactive Entertainment refers to publisher_name = 'BMG Interactive Entertainment'; release in 2012 refers to release_year = 2012;
SQL: SELECT COUNT(DISTINCT T2.game_id) 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 WHERE T3.release_year = 2012