db_id
stringclasses
68 values
question
stringlengths
24
325
evidence
stringlengths
0
580
SQL
stringlengths
23
728
video_games
When was the game titled 3DS Classic Collection released?
when refers to release_year; the game titled 3DS Classic Collection refers to game_name = '3DS Classic Collection'
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'
video_games
What is the average number of sales in Japan?
in Japan refers to region_name = 'Japan'; average number of sales = multiply(avg(num_sales), 100000) where region_name = 'Japan'
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'
video_games
Give the genre of the games released from 2000 to 2002.
genre refers to genre_name; released from 2000 to 2002 refers to release_year BETWEEN 2000 AND 2002
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
video_games
List down the name of games published by 3DO.
name of game refers to game_name; published by 3DO refers to publisher_name = '3DO'
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'
video_games
How many role-playing games are there?
role-playing game refers to genre_name = 'Role-Playing'
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'
video_games
List the region name where games reached 300000 sales and above.
reached 300000 sales and above refers to num_sales > 3
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
video_games
Which company published the game with the most sales in North America?
company refers to publisher_name; the most sales refers to max(num_sales); in North America refers to region_name = 'North America'
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
video_games
What is the release year of the game that gained 350000 sales in North America?
gained 350000 sales refers to num_sales = 3.5; in North America refers to region_name = 'North America'
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'
video_games
In which platform does the game titled 15 Days available?
platform refers to platform_name; the game titled 15 Days refers to game_name = '15 Days'
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'
video_games
Give the name of the publisher of the game ID 75.
name of publisher refers to publisher_name; the game ID 75 refers to game_id = 75
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
video_games
What is the title of the game that gained the most sales in Japan?
title of the game refers to game_name; gained the most sales refers to max(num_sales); in Japan refers to region_name = 'Japan'
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
video_games
Provide the game publisher's name of the game with sales greater than 90% of the average sales in Japan.
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'
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' )
video_games
Among the games released in 2004, what is the percentage of games on PSP?
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
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
video_games
How many games were released in 1981?
released in 1981 refers to release_year = 1981
SELECT COUNT(T.id) FROM game_platform AS T WHERE T.release_year = 1981
video_games
What is the genre ID of the '2Xtreme' game?
the '2Xtreme' game refers to game_name = '2Xtreme'
SELECT T.genre_id FROM game AS T WHERE T.game_name = '2Xtreme'
video_games
Sum the total game sales in every region for platform ID 9658.
total game sales refers to multiply(sum(num_sales), 100000); platform ID 9658 refers to game_platform_id = 9658
SELECT SUM(T.num_sales) * 100000 FROM region_sales AS T WHERE T.game_platform_id = 9658
video_games
Provide the ID of 1C Company.
ID refers to publisher.id; 1C Company refers to publisher_name = '1C Company'
SELECT T.id FROM publisher AS T WHERE T.publisher_name = '1C Company'
video_games
Provide the genre name of the genre ID 3.
genre ID 3 refers to genre.id = 3
SELECT T.genre_name FROM genre AS T WHERE T.id = 3
video_games
List the game IDs that were released in 2017.
game ID refers to game.id; released in 2017 refers to release_year = 2017
SELECT T.id FROM game_platform AS T WHERE T.release_year = 2017
video_games
When was the "Adventure Island" game released?
when refers to release_year; the "Adventure Island" game refers to game_name = 'Adventure Island'
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'
video_games
How many games are puzzle genre?
puzzle genre refers to genre_name = 'Puzzle'
SELECT COUNT(T1.id) FROM game AS T1 INNER JOIN genre AS T2 ON T1.genre_id = T2.id WHERE T2.genre_name = 'Puzzle'
video_games
Provide the games that can be played on the SCD platform.
game refers to game_name; on the SCD platform refers to platform_name = 'SCD'
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'
video_games
How many games were published by Acclaim Entertainment?
published by Acclaim Entertainment refers to publisher_name = 'Acclaim Entertainment'
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'
video_games
Name the publisher of the Chronicles of the Sword game.
publisher refers to publisher_name; the Chronicles of the Sword game refers to game_name = 'Chronicles of the Sword'
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'
video_games
Provide the number of games sold in North America on the PS4 platform.
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'
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'
video_games
Provide the ID of the most popular platform in Europe.
ID refers to game_platform_id; the most popular refers to max(num_sales); in Europe refers to region_name = 'Europe'
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
video_games
Name the game released in 2011.
game refers to game_name; released in 2011 refers to release_year = 2011
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
video_games
How many games can be played on the Wii platform?
on the Wii platform refers to platform_name = 'Wii'
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'
video_games
Provide any five games and release year under the sports genre.
game refers to game_name; under the sports genre refers to genre_name = 'Sports'
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
video_games
Mention the genre of the 2Xtreme.
genre refers to genre_name; the 2Xtreme game refers to game_name = '2Xtreme'
SELECT T2.id FROM game AS T1 INNER JOIN genre AS T2 ON T1.genre_id = T2.id WHERE T1.game_name = '2Xtreme'
video_games
Provide the platform where the Panzer Tactics can be played.
platform refers to platform_name; the Panzer Tactics is a game name.
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'
video_games
Calculate how many percent of sales in North America is higher than the average sale per region for platform ID 9577.
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%
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
video_games
Which game has the longest name?
game refers to game_name; the longest name refers to max(length(game_name))
SELECT T.game_name FROM game AS T ORDER BY LENGTH(T.game_name) DESC LIMIT 1
video_games
How many games were released in 2001?
released in 2001 refers to release_year = 2001
SELECT COUNT(T.id) FROM game_platform AS T WHERE T.release_year = 2001
video_games
What is the total number of sales across all regions?
total number of sales = sum(num_sales)
SELECT SUM(T.num_sales) * 100000 FROM region_sales t
video_games
What is the average number of games published by a publisher?
average number = divide(count(game_id), count(publisher_id))
SELECT CAST(COUNT(T.game_id) AS REAL) / COUNT(DISTINCT T.publisher_id) FROM game_publisher AS T
video_games
What is the first year a game is released?
the first year refers to min(release_year)
SELECT MIN(T.release_year) FROM game_platform t
video_games
What is the least common game genre?
the least common game genre refers to min(count(genre_id)); genre refers to genre_name
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
video_games
Which is the publisher for the game "Prism: Light the Way"?
publisher refers to publisher_name; game "Prism: Light the Way" refers to game_name = 'Prism: Light the Way'
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'
video_games
List the platforms that release the most games each year.
platform refers to platform_id; the most games refers to max(count(game_publisher_id))
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
video_games
How many games do not have any sales in Europe?
do not have any sales refers to num_sales = 0; in Europe refers to region_name = 'Europe'
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
video_games
What are the games that were released in 2006?
game refers to game_name; released in 2006 refers to release_year = 2006
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
video_games
What is the genre of the game "Mario vs. Donkey Kong"?
genre refers to genre_name; game "Mario vs. Donkey Kong" refers to game_name = 'Mario vs. Donkey Kong'
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'
video_games
Which publisher published the most games?
publisher refers to publisher_name; the most games refers to max(count(game_id))
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
video_games
List all the platform games.
platform game refers to genre_name = 'Platform'; game refers to game_name
SELECT T2.game_name FROM genre AS T1 INNER JOIN game AS T2 ON T1.id = T2.genre_id WHERE T1.genre_name = 'Platform'
video_games
What are the years that "WiiU" got a new game?
year refers to release_year; "WiiU" refers to platform_name = 'WiiU'
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
video_games
Which game has the most sales in Japan?
which game refers to game_name; most sales refers to MAX(num_sales); Japan refers to region_name = 'Japan';
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
video_games
List the games from the publisher "Activision".
games refers to game_name; "Activision" refers to publisher_name = 'Activision';
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'
video_games
How many different publishers have published a game that starts with "Marvel"?
game that starts with "Marvel" refers to game_name LIKE 'Marvel%';
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%'
video_games
What percentage of games are sports?
percentage = MULTIPLY(DIVIDE(SUM(genre_name = 'sport'), COUNT(game_name)), 100.0); sports refers to genre_name = 'sport';
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
video_games
What is the ratio of game sales between North America and Japan?
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';
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
video_games
Which year has the most number of video game releases?
year that has the most number of video game releases refers to MAX(COUNT(release_year));
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
video_games
How many video game publishers have Interactive in their names?
publishers that have Interactive in their names refers to publisher_name LIKE '%Interactive%';
SELECT COUNT(T.id) FROM publisher AS T WHERE T.publisher_name LIKE '%Interactive%'
video_games
What are the top 2 platforms with the most sales in North America?
platforms refers to platform_name; most sales refers to MAX(num_sales); North America refers to region_name = 'North America';
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
video_games
How many games did BMG Interactive Entertainment release in 2012?
BMG Interactive Entertainment refers to publisher_name = 'BMG Interactive Entertainment'; release in 2012 refers to release_year = 2012;
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
video_games
What is the name of the publisher that released the most video games in 2007?
name of the publisher refers to publisher_name; publisher that released the most video games in 2007 refers to MAX(COUNT(publisher_name)) WHERE release_year = 2007;
SELECT 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 WHERE T1.release_year = 2007 GROUP BY T3.publisher_name ORDER BY COUNT(DISTINCT T2.game_id) DESC LIMIT 1
video_games
How many publishers published the Minecraft game?
Minecraft refers to game_name = 'Minecraft';
SELECT COUNT(T2.publisher_id) FROM game AS T1 INNER JOIN game_publisher AS T2 ON T1.id = T2.game_id WHERE T1.game_name = 'Minecraft'
video_games
Which publisher has published the most number of Action games?
which publisher refers to publisher_name; publisher that has published the most number of Action games refers to MAX(COUNT(publisher_name)) WHERE genre_name = 'Action'; Action games refers to game_name WHERE genre_name = 'Action';
SELECT T.publisher_name FROM ( SELECT T4.publisher_name, COUNT(DISTINCT T2.id) FROM genre AS T1 INNER JOIN game AS T2 ON T1.id = T2.genre_id INNER JOIN game_publisher AS T3 ON T2.id = T3.game_id INNER JOIN publisher AS T4 ON T3.publisher_id = T4.id WHERE T1.genre_name = 'Action' GROUP BY T4.publisher_name ORDER BY COUNT(DISTINCT T2.id) DESC LIMIT 1 ) t
video_games
How many Sports games did Nintendo publish?
Sports games refers to game_name WHERE genre_name = 'Sports'; Nintendo refers to publisher_name = 'Nintendo';
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 = 'Sports' AND T1.publisher_name = 'Nintendo'
video_games
What is the genre of the game '2 Games in 1: Sonic Advance & ChuChu Rocket!'?
genre refers to genre_name; '2 Games in 1: Sonic Advance & ChuChu Rocket!' is a game name;
SELECT T2.genre_name FROM game AS T1 INNER JOIN genre AS T2 ON T1.genre_id = T2.id WHERE T1.game_name = '2 Games in 1: Sonic Advance & ChuChu Rocket!'
video_games
How many times did other regions make positive sales in DS platform?
other regions refers to region_name = 'Other'; positive sales refers to num_sales > 0; DS platform refers to platform_name = 'DS';
SELECT COUNT(DISTINCT T2.id) FROM platform AS T1 INNER JOIN game_platform AS T2 ON T1.id = T2.platform_id INNER JOIN region_sales AS T3 ON T1.id = T3.game_platform_id INNER JOIN region AS T4 ON T3.region_id = T4.id WHERE T1.platform_name = 'DS' AND T4.region_name = 'Other' AND T3.num_sales > 0
video_games
What are the names of the games published by American Softworks?
names of the games refers to game_name; American Softworks refers to publisher_name = 'American Softworks';
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 = 'American Softworks'
video_games
How many strategy games are there?
strategy games refers game_name WHERE genre_name = 'Strategy';
SELECT COUNT(CASE WHEN T1.genre_name = 'Strategy' THEN T2.id ELSE NULL END) FROM genre AS T1 INNER JOIN game AS T2 ON T1.id = T2.genre_id
video_games
Which publisher published Overwatch?
which publisher refers to publisher_name; Overwatch refers to game_name = 'Overwatch';
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 = 'Overwatch'
video_games
What is the name of the genre with the most number of video games?
name of the genre refers to genre_name; genre with the most number of video games refers to MAX(COUNT(genre_name));
SELECT T2.genre_name FROM game AS T1 INNER JOIN genre AS T2 ON T2.id = T1.genre_id GROUP BY T2.genre_name ORDER BY COUNT(T1.genre_id) DESC LIMIT 1
video_games
What is the number of games sold in Europe for game platform ID 26?
total number of games sold = MULTIPLY(num_sales, 100000); Europe refers to region_name = 'Europe';
SELECT T2.num_sales * 100000 AS nums_eur FROM region AS T1 INNER JOIN region_sales AS T2 ON T1.id = T2.region_id WHERE T2.game_platform_id = 26 AND T1.region_name = 'Europe'
video_games
How many games were released in the year 2001?
released in the year 2001 refers to release_year = 2001;
SELECT COUNT(id) FROM game_platform AS T WHERE T.release_year = 2001
video_games
How many games include the word 'Box' in their name?
games include the word 'Box' in their name refers to game_name = '%Box%';
SELECT COUNT(*) FROM ( SELECT T.game_name FROM game AS T WHERE T.game_name LIKE '%Box%' )
video_games
What are the three largest numbers of games sold?
3 largest numbers of games sold refers to game_name where MAX(num_sales) LIMIT 3;
SELECT T.game_platform_id, SUM(T.num_sales) * 100000 FROM region_sales AS T GROUP BY game_platform_id ORDER BY SUM(T.num_sales) * 100000 DESC LIMIT 3
video_games
What year were the first game released?
year the first game was released refers to MIN(release_year);
SELECT T.release_year FROM game_platform AS T ORDER BY T.release_year ASC LIMIT 1
video_games
What publishers have the word 'Entertainment' in their name?
publishers that have the word 'Entertainment' in their name refers to publisher_name LIKE '%Entertainment%';
SELECT T.publisher_name FROM publisher AS T WHERE T.publisher_name LIKE '%Entertainment%'
video_games
Indicate the name of all adventure games.
name of games refers to game_name; adventure games refers to game_name WHERE genre_name = 'Adventure';
SELECT T2.game_name FROM genre AS T1 INNER JOIN game AS T2 ON T1.id = T2.genre_id WHERE T1.genre_name = 'Adventure'
video_games
List the name of all games published by 'Pioneer LDC'.
name of games refers to game_name; 'Pioneer LDC' refers to publisher_name = 'Pioneer LDC';
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 = 'Pioneer LDC'
video_games
Indicate the name of all the games published for the 'SCD' platform.
name of games refers to game_name;  'SCD' platform refers to platform_name = 'SCD';
SELECT T1.game_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 T4.platform_name = 'SCD'
video_games
List the name of all games published in Japan.
name of games refers to game_name; Japan refers to region_name = 'Japan';
SELECT T1.game_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 region_sales AS T4 ON T3.id = T4.game_platform_id INNER JOIN region AS T5 ON T4.region_id = T5.id WHERE T5.region_name = 'Japan'
video_games
What genres are the games published by 'Agatsuma Entertainment'?
genres refers to genre_name; 'Agatsuma Entertainment' refers to publisher_name = 'Agatsuma Entertainment';
SELECT T4.genre_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 INNER JOIN genre AS T4 ON T3.genre_id = T4.id WHERE T1.publisher_name = 'Agatsuma Entertainment'
video_games
How many games are not of the genres 'Role-Playing', 'Shooter' and 'Simulation'?
not of the genres 'Role-Playing', 'Shooter' and 'Simulation' refers to genre_name NOT IN ('Role-Playing', 'Shooter', 'Simulation');
SELECT COUNT(T2.id) FROM genre AS T1 INNER JOIN game AS T2 ON T1.id = T2.genre_id WHERE T1.genre_name NOT IN ('Role-Playing', 'Shooter', 'Simulation')
video_games
Indicate, by region, which platform has sold the most games.
region refers to region_name; platform refers to game_platform; sold the most games refers to MAX(SUM(num_sales));
SELECT T.region_name FROM ( SELECT T1.platform_name, T4.region_name, SUM(T3.num_sales) FROM platform AS T1 INNER JOIN game_platform AS T2 ON T1.id = T2.platform_id INNER JOIN region_sales AS T3 ON T1.id = T3.game_platform_id INNER JOIN region AS T4 ON T3.region_id = T4.id GROUP BY T1.platform_name, T4.region_name ORDER BY SUM(T3.num_sales) DESC LIMIT 1 ) t
video_games
Which publisher has published the most games in the 'Puzzle' genre?
which publisher refers to publisher_name; publisher that has published the most games refers to MAX(COUNT(publisher_name)); puzzle genre refers to genre_name = 'Puzzle';
SELECT T.publisher_name FROM ( SELECT T1.publisher_name, 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 = 'Puzzle' GROUP BY T1.publisher_name ORDER BY COUNT(T3.id) DESC LIMIT 1 ) t
video_games
Which game has sold the fewest units?
which game refers to game_name; sold the fewest units refers to MIN(num_sales);
SELECT T.game_name FROM ( SELECT T1.game_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 region_sales AS T4 ON T3.id = T4.game_platform_id ORDER BY T4.num_sales LIMIT 1 ) t
video_games
Which publisher has published the game 'Pachi-Slot Kanzen Kouryaku 3: Universal Koushiki Gaido Volume 3'?
which publisher refers to publisher_name; 'Pachi-Slot Kanzen Kouryaku 3: Universal Koushiki Gaido Volume 3' refers to game_name = 'Pachi-Slot Kanzen Kouryaku 3: Universal Koushiki Gaido Volume 3';
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 = 'Pachi-Slot Kanzen Kouryaku 3: Universal Koushiki Gaido Volume 3'
video_games
In which regions has the game 'Pengo' been sold?
which regions refers to region_name; 'Pengo' refers to game_name = 'Pengo';
SELECT T5.region_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 region_sales AS T4 ON T3.id = T4.game_platform_id INNER JOIN region AS T5 ON T4.region_id = T5.id WHERE T1.game_name = 'Pengo'
video_games
List by name all the games released in the year 2010.
name of the games refers to game_name; released in the year 2010 refers to release_year = 2010;
SELECT T1.game_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 WHERE T3.release_year = '2010'
video_games
Calculate the average game sales for the PS2 platform.
average = AVG(MULTIPLY(num_sales), 100000); PS2 refers to platform_name = 'PS2';
SELECT SUM(T3.num_sales * 100000) / COUNT(T1.id) FROM platform AS T1 INNER JOIN game_platform AS T2 ON T1.id = T2.platform_id INNER JOIN region_sales AS T3 ON T2.id = T3.game_platform_id WHERE T1.platform_name = 'PS2'
video_games
Calculate the percentage of games published by 'Brash Entertainment'?
percentage = MULTIPLY(DIVIDE(SUM(publisher_name = 'Brash Entertainment'), COUNT(game_id)), 100.0); 'Brash Entertainment' refers to publisher_name = 'Brash Entertainment';
SELECT CAST(COUNT(CASE WHEN T1.publisher_name = 'Brash Entertainment' THEN T2.game_id ELSE NULL END) AS REAL) * 100 / COUNT(T2.game_id) FROM publisher AS T1 INNER JOIN game_publisher AS T2 ON T1.id = T2.publisher_id
video_games
What is the total number of games sold in region ID 1?
total number of games sold = MULTIPLY(SUM(num_sales), 100000);
SELECT SUM(T.num_sales * 100000) FROM region_sales AS T WHERE T.region_id = 1
video_games
How many FIFA games are there across all platforms?
FIFA games refers to game_name LIKE '%FIFA%';
SELECT COUNT(*) FROM ( SELECT T.game_name FROM game AS T WHERE T.game_name LIKE '%FIFA%' )
video_games
Which platform is the most popular in Europe?
platform that is the most popular refers to platform_name WHERE MAX(num_sales); in Europe refers to region_name = 'Europe' ;
SELECT T.platform_name FROM ( 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 = 'Europe' ORDER BY T2.num_sales DESC LIMIT 1 ) t
video_games
Who is the publisher of the game 2002 FIFA World Cup?
who is the publisher refers to publisher_name; 2002 FIFA World Cup refers to game_name = '2002 FIFA World Cup';
SELECT T2.publisher_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 WHERE T3.game_name = '2002 FIFA World Cup'
video_games
What platform is the game 3Xtreme available on?
what platform refers to platform_name; 3Xtreme refers to game_name = '3Xtreme';
SELECT T2.platform_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 T4.game_name = '3Xtreme'
video_games
What genre is the game 2010 FIFA World Cup South Africa?
genre refers to genre_name; 2010 FIFA World Cup South Africa refers to game_name = '2010 FIFA World Cup South Africa';
SELECT T2.genre_name FROM game AS T1 INNER JOIN genre AS T2 ON T1.genre_id = T2.id WHERE T1.game_name = '2010 FIFA World Cup South Africa'
video_games
How many games were sold on PS3 platform in Japan?
how many games = MULTIPLY(SUM(num_sales), 100000); PS3 refers to platform_name = 'PS3'; Japan refers to region_name = 'Japan';
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 = 'Japan' AND T4.platform_name = 'PS3'
video_games
What are the names of games that were released in 2007?
names of games refers to game_name; released in 2007 refers to release_year = 2007;
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 = 2007
video_games
How many games were published by Activision?
Activision refers to publisher_name = 'Activision';
SELECT COUNT(DISTINCT T3.id) 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 WHERE T2.publisher_name = 'Activision'
video_games
Indicate the release year of the game with more than 200000 sales in Japan.
more than 200000 sales refers to SUM(num_sales) > 2; Japan refers to region_name = 'Japan';
SELECT DISTINCT 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 > 200000 AND T1.region_name = 'Japan'
video_games
In 2010, how many PS3 games were released?
in 2010 refers to release_year = 2010; PS3 refers to platform_name = 'PS3';
SELECT 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 T1.platform_name = 'PS3' AND T2.release_year = 2010
video_games
Indicate the publisher who has published the most games of all time.
publisher refers to publisher_name; publisher who has published the most games of all time refers to MAX(COUNT(publisher_name));
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
video_games
How many shooter games are there?
shooter games refers to game_name WHERE genre_name = 'shooter';
SELECT COUNT(T1.id) FROM game AS T1 INNER JOIN genre AS T2 ON T1.genre_id = T2.id WHERE T2.genre_name = 'Shooter'
video_games
What is the percentage of games that were released on PS4 in 2014 among all platforms?
percentage - MULTIPLY(DIVIDE(SUM(platform_name = 'PS4'), COUNT(game_id)), 100); in 2014 refers to release_year = 2014;
SELECT CAST(COUNT(CASE WHEN T2.platform_name = 'PS4' THEN T3.game_id ELSE NULL END) AS REAL) * 100 / COUNT(T3.game_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 WHERE T1.release_year = 2014
video_games
How much are the sales of the games in region ID 4?
how much are the sales = SUM(num_sales);
SELECT SUM(T.num_sales) * 100000 FROM region_sales AS T WHERE T.region_id = 4