input stringlengths 122 2.7k | output stringlengths 24 805 |
|---|---|
[INST] Here is a database schema:
game :
id [ INTEGER ] primary_key
genre_id [ INTEGER ] game.genre_id = genre.id
game_name [ TEXT ]
publisher :
id [ INTEGER ] primary_key
publisher_name [ TEXT ]
game_publisher :
id [ INTEGER ] primary_key
game_id [ INTEGER ] game_publisher.game_id = game.id
publisher_id [ INTEGER ] ga... | 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'; |
[INST] Here is a database schema:
platform :
id [ INTEGER ] primary_key
platform_name [ TEXT ]
game_publisher :
id [ INTEGER ] primary_key
game_id [ INTEGER ] game_publisher.game_id = game.id
publisher_id [ INTEGER ] game_publisher.publisher_id = publisher.id
game_platform :
id [ INTEGER ] primary_key
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; |
[INST] Here is a database schema:
region :
id [ INTEGER ] primary_key
region_name [ TEXT ]
region_sales :
region_id [ INTEGER ] region_sales.region_id = region.id
game_platform_id [ INTEGER ] region_sales.game_platform_id = game_platform.id
num_sales [ REAL ]
Please write me a SQL statement that answers the following ... | 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; |
[INST] Here is a database schema:
game :
id [ INTEGER ] primary_key
genre_id [ INTEGER ] game.genre_id = genre.id
game_name [ TEXT ]
game_publisher :
id [ INTEGER ] primary_key
game_id [ INTEGER ] game_publisher.game_id = game.id
publisher_id [ INTEGER ] game_publisher.publisher_id = publisher.id
game_platform :
id [ I... | 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; |
[INST] Here is a database schema:
genre :
id [ INTEGER ] primary_key
genre_name [ TEXT ]
game :
id [ INTEGER ] primary_key
genre_id [ INTEGER ] game.genre_id = genre.id
game_name [ TEXT ]
Please write me a SQL statement that answers the following question: What is the genre of the game "Mario vs. Donkey Kong"? [/INST]... | 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'; |
[INST] Here is a database schema:
publisher :
id [ INTEGER ] primary_key
publisher_name [ TEXT ]
game_publisher :
id [ INTEGER ] primary_key
game_id [ INTEGER ] game_publisher.game_id = game.id
publisher_id [ INTEGER ] game_publisher.publisher_id = publisher.id
Please write me a SQL statement that answers the followin... | 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; |
[INST] Here is a database schema:
genre :
id [ INTEGER ] primary_key
genre_name [ TEXT ]
game :
id [ INTEGER ] primary_key
genre_id [ INTEGER ] game.genre_id = genre.id
game_name [ TEXT ]
Please write me a SQL statement that answers the following question: List all the platform games. [/INST] [/INST] | SELECT T2.game_name FROM genre AS T1 INNER JOIN game AS T2 ON T1.id = T2.genre_id WHERE T1.genre_name = 'Platform'; |
[INST] Here is a database schema:
platform :
id [ INTEGER ] primary_key
platform_name [ TEXT ]
game_platform :
id [ INTEGER ] primary_key
game_publisher_id [ INTEGER ] game_platform.game_publisher_id = game_publisher.id
platform_id [ INTEGER ] game_platform.platform_id = platform.id
release_year [ INTEGER ]
Please wri... | 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; |
[INST] Here is a database schema:
game :
id [ INTEGER ] primary_key
genre_id [ INTEGER ] game.genre_id = genre.id
game_name [ TEXT ]
game_publisher :
id [ INTEGER ] primary_key
game_id [ INTEGER ] game_publisher.game_id = game.id
publisher_id [ INTEGER ] game_publisher.publisher_id = publisher.id
game_platform :
id [ I... | 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 ... |
[INST] Here is a database schema:
game :
id [ INTEGER ] primary_key
genre_id [ INTEGER ] game.genre_id = genre.id
game_name [ TEXT ]
publisher :
id [ INTEGER ] primary_key
publisher_name [ TEXT ]
game_publisher :
id [ INTEGER ] primary_key
game_id [ INTEGER ] game_publisher.game_id = game.id
publisher_id [ INTEGER ] ga... | 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'; |
[INST] Here is a database schema:
game :
id [ INTEGER ] primary_key
genre_id [ INTEGER ] game.genre_id = genre.id
game_name [ TEXT ]
game_publisher :
id [ INTEGER ] primary_key
game_id [ INTEGER ] game_publisher.game_id = game.id
publisher_id [ INTEGER ] game_publisher.publisher_id = publisher.id
Please write me a 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%'; |
[INST] Here is a database schema:
genre :
id [ INTEGER ] primary_key
genre_name [ TEXT ]
game :
id [ INTEGER ] primary_key
genre_id [ INTEGER ] game.genre_id = genre.id
game_name [ TEXT ]
Please write me a SQL statement that answers the following question: What percentage of games are sports? [/INST] [/INST] | 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; |
[INST] Here is a database schema:
region :
id [ INTEGER ] primary_key
region_name [ TEXT ]
region_sales :
region_id [ INTEGER ] region_sales.region_id = region.id
game_platform_id [ INTEGER ] region_sales.game_platform_id = game_platform.id
num_sales [ REAL ]
Please write me a SQL statement that answers the following ... | 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; |
[INST] Here is a database schema:
game_platform :
id [ INTEGER ] primary_key
game_publisher_id [ INTEGER ] game_platform.game_publisher_id = game_publisher.id
platform_id [ INTEGER ] game_platform.platform_id = platform.id
release_year [ INTEGER ]
Please write me a SQL statement that answers the following question: Wh... | 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; |
[INST] Here is a database schema:
publisher :
id [ INTEGER ] primary_key
publisher_name [ TEXT ]
Please write me a SQL statement that answers the following question: How many video game publishers have Interactive in their names? [/INST] [/INST] | SELECT COUNT(T.id) FROM publisher AS T WHERE T.publisher_name LIKE '%Interactive%'; |
[INST] Here is a database schema:
platform :
id [ INTEGER ] primary_key
platform_name [ TEXT ]
game_platform :
id [ INTEGER ] primary_key
game_publisher_id [ INTEGER ] game_platform.game_publisher_id = game_publisher.id
platform_id [ INTEGER ] game_platform.platform_id = platform.id
release_year [ INTEGER ]
region :
id... | 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; |
[INST] Here is a database schema:
publisher :
id [ INTEGER ] primary_key
publisher_name [ TEXT ]
game_publisher :
id [ INTEGER ] primary_key
game_id [ INTEGER ] game_publisher.game_id = game.id
publisher_id [ INTEGER ] game_publisher.publisher_id = publisher.id
game_platform :
id [ INTEGER ] primary_key
game_publisher_... | 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; |
[INST] Here is a database schema:
publisher :
id [ INTEGER ] primary_key
publisher_name [ TEXT ]
game_publisher :
id [ INTEGER ] primary_key
game_id [ INTEGER ] game_publisher.game_id = game.id
publisher_id [ INTEGER ] game_publisher.publisher_id = publisher.id
game_platform :
id [ INTEGER ] primary_key
game_publisher_... | 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; |
[INST] Here is a database schema:
game :
id [ INTEGER ] primary_key
genre_id [ INTEGER ] game.genre_id = genre.id
game_name [ TEXT ]
game_publisher :
id [ INTEGER ] primary_key
game_id [ INTEGER ] game_publisher.game_id = game.id
publisher_id [ INTEGER ] game_publisher.publisher_id = publisher.id
Please write me a SQL... | 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'; |
[INST] Here is a database schema:
genre :
id [ INTEGER ] primary_key
genre_name [ TEXT ]
game :
id [ INTEGER ] primary_key
genre_id [ INTEGER ] game.genre_id = genre.id
game_name [ TEXT ]
publisher :
id [ INTEGER ] primary_key
publisher_name [ TEXT ]
game_publisher :
id [ INTEGER ] primary_key
game_id [ INTEGER ] game_... | 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 COUN... |
[INST] Here is a database schema:
genre :
id [ INTEGER ] primary_key
genre_name [ TEXT ]
game :
id [ INTEGER ] primary_key
genre_id [ INTEGER ] game.genre_id = genre.id
game_name [ TEXT ]
publisher :
id [ INTEGER ] primary_key
publisher_name [ TEXT ]
game_publisher :
id [ INTEGER ] primary_key
game_id [ INTEGER ] game_... | 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'; |
[INST] Here is a database schema:
genre :
id [ INTEGER ] primary_key
genre_name [ TEXT ]
game :
id [ INTEGER ] primary_key
genre_id [ INTEGER ] game.genre_id = genre.id
game_name [ TEXT ]
Please write me a SQL statement that answers the following question: What is the genre of the game '2 Games in 1: Sonic Advance & C... | 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!'; |
[INST] Here is a database schema:
platform :
id [ INTEGER ] primary_key
platform_name [ TEXT ]
game_platform :
id [ INTEGER ] primary_key
game_publisher_id [ INTEGER ] game_platform.game_publisher_id = game_publisher.id
platform_id [ INTEGER ] game_platform.platform_id = platform.id
release_year [ INTEGER ]
region :
id... | 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; |
[INST] Here is a database schema:
game :
id [ INTEGER ] primary_key
genre_id [ INTEGER ] game.genre_id = genre.id
game_name [ TEXT ]
publisher :
id [ INTEGER ] primary_key
publisher_name [ TEXT ]
game_publisher :
id [ INTEGER ] primary_key
game_id [ INTEGER ] game_publisher.game_id = game.id
publisher_id [ INTEGER ] ga... | 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'; |
[INST] Here is a database schema:
genre :
id [ INTEGER ] primary_key
genre_name [ TEXT ]
game :
id [ INTEGER ] primary_key
genre_id [ INTEGER ] game.genre_id = genre.id
game_name [ TEXT ]
Please write me a SQL statement that answers the following question: How many strategy games are there? [/INST] [/INST] | 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; |
[INST] Here is a database schema:
game :
id [ INTEGER ] primary_key
genre_id [ INTEGER ] game.genre_id = genre.id
game_name [ TEXT ]
publisher :
id [ INTEGER ] primary_key
publisher_name [ TEXT ]
game_publisher :
id [ INTEGER ] primary_key
game_id [ INTEGER ] game_publisher.game_id = game.id
publisher_id [ INTEGER ] ga... | 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'; |
[INST] Here is a database schema:
genre :
id [ INTEGER ] primary_key
genre_name [ TEXT ]
game :
id [ INTEGER ] primary_key
genre_id [ INTEGER ] game.genre_id = genre.id
game_name [ TEXT ]
Please write me a SQL statement that answers the following question: What is the name of the genre with the most number of video ga... | 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; |
[INST] Here is a database schema:
region :
id [ INTEGER ] primary_key
region_name [ TEXT ]
region_sales :
region_id [ INTEGER ] region_sales.region_id = region.id
game_platform_id [ INTEGER ] region_sales.game_platform_id = game_platform.id
num_sales [ REAL ]
Please write me a SQL statement that answers the following ... | 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'; |
[INST] Here is a database schema:
game_platform :
id [ INTEGER ] primary_key
game_publisher_id [ INTEGER ] game_platform.game_publisher_id = game_publisher.id
platform_id [ INTEGER ] game_platform.platform_id = platform.id
release_year [ INTEGER ]
Please write me a SQL statement that answers the following question: Ho... | SELECT COUNT(id) FROM game_platform AS T WHERE T.release_year = 2001; |
[INST] Here is a database schema:
game :
id [ INTEGER ] primary_key
genre_id [ INTEGER ] game.genre_id = genre.id
game_name [ TEXT ]
Please write me a SQL statement that answers the following question: How many games include the word 'Box' in their name? [/INST] [/INST] | SELECT COUNT(*) FROM ( SELECT T.game_name FROM game AS T WHERE T.game_name LIKE '%Box%' ); |
[INST] Here is a database schema:
region_sales :
region_id [ INTEGER ] region_sales.region_id = region.id
game_platform_id [ INTEGER ] region_sales.game_platform_id = game_platform.id
num_sales [ REAL ]
Please write me a SQL statement that answers the following question: What are the three largest numbers of games sol... | 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; |
[INST] Here is a database schema:
game_platform :
id [ INTEGER ] primary_key
game_publisher_id [ INTEGER ] game_platform.game_publisher_id = game_publisher.id
platform_id [ INTEGER ] game_platform.platform_id = platform.id
release_year [ INTEGER ]
Please write me a SQL statement that answers the following question: Wh... | SELECT T.release_year FROM game_platform AS T ORDER BY T.release_year ASC LIMIT 1; |
[INST] Here is a database schema:
publisher :
id [ INTEGER ] primary_key
publisher_name [ TEXT ]
Please write me a SQL statement that answers the following question: What publishers have the word 'Entertainment' in their name? [/INST] [/INST] | SELECT T.publisher_name FROM publisher AS T WHERE T.publisher_name LIKE '%Entertainment%'; |
[INST] Here is a database schema:
genre :
id [ INTEGER ] primary_key
genre_name [ TEXT ]
game :
id [ INTEGER ] primary_key
genre_id [ INTEGER ] game.genre_id = genre.id
game_name [ TEXT ]
Please write me a SQL statement that answers the following question: Indicate the name of all adventure games. [/INST] [/INST] | SELECT T2.game_name FROM genre AS T1 INNER JOIN game AS T2 ON T1.id = T2.genre_id WHERE T1.genre_name = 'Adventure'; |
[INST] Here is a database schema:
game :
id [ INTEGER ] primary_key
genre_id [ INTEGER ] game.genre_id = genre.id
game_name [ TEXT ]
publisher :
id [ INTEGER ] primary_key
publisher_name [ TEXT ]
game_publisher :
id [ INTEGER ] primary_key
game_id [ INTEGER ] game_publisher.game_id = game.id
publisher_id [ INTEGER ] ga... | 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'; |
[INST] Here is a database schema:
game :
id [ INTEGER ] primary_key
genre_id [ INTEGER ] game.genre_id = genre.id
game_name [ TEXT ]
platform :
id [ INTEGER ] primary_key
platform_name [ TEXT ]
game_publisher :
id [ INTEGER ] primary_key
game_id [ INTEGER ] game_publisher.game_id = game.id
publisher_id [ INTEGER ] game... | 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'; |
[INST] Here is a database schema:
game :
id [ INTEGER ] primary_key
genre_id [ INTEGER ] game.genre_id = genre.id
game_name [ TEXT ]
game_publisher :
id [ INTEGER ] primary_key
game_id [ INTEGER ] game_publisher.game_id = game.id
publisher_id [ INTEGER ] game_publisher.publisher_id = publisher.id
game_platform :
id [ I... | 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'; |
[INST] Here is a database schema:
genre :
id [ INTEGER ] primary_key
genre_name [ TEXT ]
game :
id [ INTEGER ] primary_key
genre_id [ INTEGER ] game.genre_id = genre.id
game_name [ TEXT ]
publisher :
id [ INTEGER ] primary_key
publisher_name [ TEXT ]
game_publisher :
id [ INTEGER ] primary_key
game_id [ INTEGER ] game_... | 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'; |
[INST] Here is a database schema:
genre :
id [ INTEGER ] primary_key
genre_name [ TEXT ]
game :
id [ INTEGER ] primary_key
genre_id [ INTEGER ] game.genre_id = genre.id
game_name [ TEXT ]
Please write me a SQL statement that answers the following question: How many games are not of the genres 'Role-Playing', 'Shooter'... | 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'); |
[INST] Here is a database schema:
platform :
id [ INTEGER ] primary_key
platform_name [ TEXT ]
game_platform :
id [ INTEGER ] primary_key
game_publisher_id [ INTEGER ] game_platform.game_publisher_id = game_publisher.id
platform_id [ INTEGER ] game_platform.platform_id = platform.id
release_year [ INTEGER ]
region :
id... | 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... |
[INST] Here is a database schema:
genre :
id [ INTEGER ] primary_key
genre_name [ TEXT ]
game :
id [ INTEGER ] primary_key
genre_id [ INTEGER ] game.genre_id = genre.id
game_name [ TEXT ]
publisher :
id [ INTEGER ] primary_key
publisher_name [ TEXT ]
game_publisher :
id [ INTEGER ] primary_key
game_id [ INTEGER ] game_... | 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) ... |
[INST] Here is a database schema:
game :
id [ INTEGER ] primary_key
genre_id [ INTEGER ] game.genre_id = genre.id
game_name [ TEXT ]
game_publisher :
id [ INTEGER ] primary_key
game_id [ INTEGER ] game_publisher.game_id = game.id
publisher_id [ INTEGER ] game_publisher.publisher_id = publisher.id
game_platform :
id [ I... | 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; |
[INST] Here is a database schema:
game :
id [ INTEGER ] primary_key
genre_id [ INTEGER ] game.genre_id = genre.id
game_name [ TEXT ]
publisher :
id [ INTEGER ] primary_key
publisher_name [ TEXT ]
game_publisher :
id [ INTEGER ] primary_key
game_id [ INTEGER ] game_publisher.game_id = game.id
publisher_id [ INTEGER ] ga... | 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'; |
[INST] Here is a database schema:
game :
id [ INTEGER ] primary_key
genre_id [ INTEGER ] game.genre_id = genre.id
game_name [ TEXT ]
game_publisher :
id [ INTEGER ] primary_key
game_id [ INTEGER ] game_publisher.game_id = game.id
publisher_id [ INTEGER ] game_publisher.publisher_id = publisher.id
game_platform :
id [ I... | 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'; |
[INST] Here is a database schema:
game :
id [ INTEGER ] primary_key
genre_id [ INTEGER ] game.genre_id = genre.id
game_name [ TEXT ]
game_publisher :
id [ INTEGER ] primary_key
game_id [ INTEGER ] game_publisher.game_id = game.id
publisher_id [ INTEGER ] game_publisher.publisher_id = publisher.id
game_platform :
id [ I... | 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'; |
[INST] Here is a database schema:
platform :
id [ INTEGER ] primary_key
platform_name [ TEXT ]
game_platform :
id [ INTEGER ] primary_key
game_publisher_id [ INTEGER ] game_platform.game_publisher_id = game_publisher.id
platform_id [ INTEGER ] game_platform.platform_id = platform.id
release_year [ INTEGER ]
region_sale... | 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'; |
[INST] Here is a database schema:
publisher :
id [ INTEGER ] primary_key
publisher_name [ TEXT ]
game_publisher :
id [ INTEGER ] primary_key
game_id [ INTEGER ] game_publisher.game_id = game.id
publisher_id [ INTEGER ] game_publisher.publisher_id = publisher.id
Please write me a SQL statement that answers the followin... | 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; |
[INST] Here is a database schema:
region_sales :
region_id [ INTEGER ] region_sales.region_id = region.id
game_platform_id [ INTEGER ] region_sales.game_platform_id = game_platform.id
num_sales [ REAL ]
Please write me a SQL statement that answers the following question: What is the total number of games sold in regio... | SELECT SUM(T.num_sales * 100000) FROM region_sales AS T WHERE T.region_id = 1; |
[INST] Here is a database schema:
game :
id [ INTEGER ] primary_key
genre_id [ INTEGER ] game.genre_id = genre.id
game_name [ TEXT ]
Please write me a SQL statement that answers the following question: How many FIFA games are there across all platforms? [/INST] [/INST] | SELECT COUNT(*) FROM ( SELECT T.game_name FROM game AS T WHERE T.game_name LIKE '%FIFA%' ); |
[INST] Here is a database schema:
platform :
id [ INTEGER ] primary_key
platform_name [ TEXT ]
game_platform :
id [ INTEGER ] primary_key
game_publisher_id [ INTEGER ] game_platform.game_publisher_id = game_publisher.id
platform_id [ INTEGER ] game_platform.platform_id = platform.id
release_year [ INTEGER ]
region :
id... | 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; |
[INST] Here is a database schema:
game :
id [ INTEGER ] primary_key
genre_id [ INTEGER ] game.genre_id = genre.id
game_name [ TEXT ]
publisher :
id [ INTEGER ] primary_key
publisher_name [ TEXT ]
game_publisher :
id [ INTEGER ] primary_key
game_id [ INTEGER ] game_publisher.game_id = game.id
publisher_id [ INTEGER ] ga... | 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'; |
[INST] Here is a database schema:
game :
id [ INTEGER ] primary_key
genre_id [ INTEGER ] game.genre_id = genre.id
game_name [ TEXT ]
platform :
id [ INTEGER ] primary_key
platform_name [ TEXT ]
game_publisher :
id [ INTEGER ] primary_key
game_id [ INTEGER ] game_publisher.game_id = game.id
publisher_id [ INTEGER ] game... | 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'; |
[INST] Here is a database schema:
genre :
id [ INTEGER ] primary_key
genre_name [ TEXT ]
game :
id [ INTEGER ] primary_key
genre_id [ INTEGER ] game.genre_id = genre.id
game_name [ TEXT ]
Please write me a SQL statement that answers the following question: What genre is the game 2010 FIFA World Cup South Africa? [/INS... | 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'; |
[INST] Here is a database schema:
platform :
id [ INTEGER ] primary_key
platform_name [ TEXT ]
game_platform :
id [ INTEGER ] primary_key
game_publisher_id [ INTEGER ] game_platform.game_publisher_id = game_publisher.id
platform_id [ INTEGER ] game_platform.platform_id = platform.id
release_year [ INTEGER ]
region :
id... | SELECT T.region_name FROM ( SELECT T2.region_name, SUM(T1.num_sales) 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 GROUP BY T4.platform_name ORDER BY SUM(T1.num_sales) DESC LIMIT 1... |
[INST] Here is a database schema:
platform :
id [ INTEGER ] primary_key
platform_name [ TEXT ]
game_platform :
id [ INTEGER ] primary_key
game_publisher_id [ INTEGER ] game_platform.game_publisher_id = game_publisher.id
platform_id [ INTEGER ] game_platform.platform_id = platform.id
release_year [ INTEGER ]
region :
id... | 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'; |
[INST] Here is a database schema:
game :
id [ INTEGER ] primary_key
genre_id [ INTEGER ] game.genre_id = genre.id
game_name [ TEXT ]
game_publisher :
id [ INTEGER ] primary_key
game_id [ INTEGER ] game_publisher.game_id = game.id
publisher_id [ INTEGER ] game_publisher.publisher_id = publisher.id
game_platform :
id [ I... | 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; |
[INST] Here is a database schema:
game :
id [ INTEGER ] primary_key
genre_id [ INTEGER ] game.genre_id = genre.id
game_name [ TEXT ]
publisher :
id [ INTEGER ] primary_key
publisher_name [ TEXT ]
game_publisher :
id [ INTEGER ] primary_key
game_id [ INTEGER ] game_publisher.game_id = game.id
publisher_id [ INTEGER ] ga... | 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'; |
[INST] Here is a database schema:
game_platform :
id [ INTEGER ] primary_key
game_publisher_id [ INTEGER ] game_platform.game_publisher_id = game_publisher.id
platform_id [ INTEGER ] game_platform.platform_id = platform.id
release_year [ INTEGER ]
region :
id [ INTEGER ] primary_key
region_name [ TEXT ]
region_sales :
... | 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'; |
[INST] Here is a database schema:
platform :
id [ INTEGER ] primary_key
platform_name [ TEXT ]
game_publisher :
id [ INTEGER ] primary_key
game_id [ INTEGER ] game_publisher.game_id = game.id
publisher_id [ INTEGER ] game_publisher.publisher_id = publisher.id
game_platform :
id [ INTEGER ] primary_key
game_publisher_id... | 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; |
[INST] Here is a database schema:
publisher :
id [ INTEGER ] primary_key
publisher_name [ TEXT ]
game_publisher :
id [ INTEGER ] primary_key
game_id [ INTEGER ] game_publisher.game_id = game.id
publisher_id [ INTEGER ] game_publisher.publisher_id = publisher.id
Please write me a SQL statement that answers the followin... | 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; |
[INST] Here is a database schema:
genre :
id [ INTEGER ] primary_key
genre_name [ TEXT ]
game :
id [ INTEGER ] primary_key
genre_id [ INTEGER ] game.genre_id = genre.id
game_name [ TEXT ]
Please write me a SQL statement that answers the following question: How many shooter games are there? [/INST] [/INST] | SELECT COUNT(T1.id) FROM game AS T1 INNER JOIN genre AS T2 ON T1.genre_id = T2.id WHERE T2.genre_name = 'Shooter'; |
[INST] Here is a database schema:
platform :
id [ INTEGER ] primary_key
platform_name [ TEXT ]
game_publisher :
id [ INTEGER ] primary_key
game_id [ INTEGER ] game_publisher.game_id = game.id
publisher_id [ INTEGER ] game_publisher.publisher_id = publisher.id
game_platform :
id [ INTEGER ] primary_key
game_publisher_id... | 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; |
[INST] Here is a database schema:
region_sales :
region_id [ INTEGER ] region_sales.region_id = region.id
game_platform_id [ INTEGER ] region_sales.game_platform_id = game_platform.id
num_sales [ REAL ]
Please write me a SQL statement that answers the following question: How much are the sales of the games in region I... | SELECT SUM(T.num_sales) * 100000 FROM region_sales AS T WHERE T.region_id = 4; |
[INST] Here is a database schema:
region_sales :
region_id [ INTEGER ] region_sales.region_id = region.id
game_platform_id [ INTEGER ] region_sales.game_platform_id = game_platform.id
num_sales [ REAL ]
Please write me a SQL statement that answers the following question: List down the game platform IDs of games with a... | SELECT T.game_platform_id FROM region_sales AS T WHERE T.region_id = 1; |
[INST] Here is a database schema:
region_sales :
region_id [ INTEGER ] region_sales.region_id = region.id
game_platform_id [ INTEGER ] region_sales.game_platform_id = game_platform.id
num_sales [ REAL ]
Please write me a SQL statement that answers the following question: Calculate the difference between sales of games... | 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; |
[INST] Here is a database schema:
game_platform :
id [ INTEGER ] primary_key
game_publisher_id [ INTEGER ] game_platform.game_publisher_id = game_publisher.id
platform_id [ INTEGER ] game_platform.platform_id = platform.id
release_year [ INTEGER ]
Please write me a SQL statement that answers the following question: Li... | SELECT DISTINCT T.platform_id FROM game_platform AS T WHERE T.release_year = 2007; |
[INST] Here is a database schema:
game_platform :
id [ INTEGER ] primary_key
game_publisher_id [ INTEGER ] game_platform.game_publisher_id = game_publisher.id
platform_id [ INTEGER ] game_platform.platform_id = platform.id
release_year [ INTEGER ]
Please write me a SQL statement that answers the following question: St... | SELECT T.game_publisher_id FROM game_platform AS T WHERE T.platform_id = 16; |
[INST] Here is a database schema:
game_platform :
id [ INTEGER ] primary_key
game_publisher_id [ INTEGER ] game_platform.game_publisher_id = game_publisher.id
platform_id [ INTEGER ] game_platform.platform_id = platform.id
release_year [ INTEGER ]
Please write me a SQL statement that answers the following question: Ca... | SELECT COUNT(T.game_publisher_id) FROM game_platform AS T WHERE T.release_year = 1984; |
[INST] Here is a database schema:
game_platform :
id [ INTEGER ] primary_key
game_publisher_id [ INTEGER ] game_platform.game_publisher_id = game_publisher.id
platform_id [ INTEGER ] game_platform.platform_id = platform.id
release_year [ INTEGER ]
region_sales :
region_id [ INTEGER ] region_sales.region_id = region.id
... | SELECT T2.id FROM region_sales AS T1 INNER JOIN game_platform AS T2 ON T1.game_platform_id = T2.id WHERE T1.region_id = 3; |
[INST] Here is a database schema:
region :
id [ INTEGER ] primary_key
region_name [ TEXT ]
region_sales :
region_id [ INTEGER ] region_sales.region_id = region.id
game_platform_id [ INTEGER ] region_sales.game_platform_id = game_platform.id
num_sales [ REAL ]
Please write me a SQL statement that answers the following ... | SELECT SUM(CASE WHEN T2.region_name = 'Japan' THEN T1.num_sales ELSE 0 END) AS nums FROM region_sales AS T1 INNER JOIN region AS T2 ON T1.region_id = T2.id; |
[INST] Here is a database schema:
platform :
id [ INTEGER ] primary_key
platform_name [ TEXT ]
game_platform :
id [ INTEGER ] primary_key
game_publisher_id [ INTEGER ] game_platform.game_publisher_id = game_publisher.id
platform_id [ INTEGER ] game_platform.platform_id = platform.id
release_year [ INTEGER ]
Please wri... | SELECT COUNT(T1.game_publisher_id) FROM game_platform AS T1 INNER JOIN platform AS T2 ON T1.platform_id = T2.id WHERE T2.platform_name = 'X360'; |
[INST] Here is a database schema:
platform :
id [ INTEGER ] primary_key
platform_name [ TEXT ]
game_platform :
id [ INTEGER ] primary_key
game_publisher_id [ INTEGER ] game_platform.game_publisher_id = game_publisher.id
platform_id [ INTEGER ] game_platform.platform_id = platform.id
release_year [ INTEGER ]
Please wri... | SELECT DISTINCT T2.platform_name FROM game_platform AS T1 INNER JOIN platform AS T2 ON T1.platform_id = T2.id WHERE T1.release_year = 2000; |
[INST] Here is a database schema:
platform :
id [ INTEGER ] primary_key
platform_name [ TEXT ]
game_platform :
id [ INTEGER ] primary_key
game_publisher_id [ INTEGER ] game_platform.game_publisher_id = game_publisher.id
platform_id [ INTEGER ] game_platform.platform_id = platform.id
release_year [ INTEGER ]
Please wri... | SELECT COUNT(CASE WHEN T2.platform_name = 'PS3' THEN T1.game_publisher_id ELSE NULL END) - COUNT(CASE WHEN T2.platform_name = 'X360' THEN T1.game_publisher_id ELSE NULL END) FROM game_platform AS T1 INNER JOIN platform AS T2 ON T1.platform_id = T2.id; |
[INST] Here is a database schema:
publisher :
id [ INTEGER ] primary_key
publisher_name [ TEXT ]
game_publisher :
id [ INTEGER ] primary_key
game_id [ INTEGER ] game_publisher.game_id = game.id
publisher_id [ INTEGER ] game_publisher.publisher_id = publisher.id
Please write me a SQL statement that answers the followin... | SELECT T1.game_id FROM game_publisher AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.id WHERE T2.publisher_name = 'Bethesda Softworks'; |
[INST] Here is a database schema:
publisher :
id [ INTEGER ] primary_key
publisher_name [ TEXT ]
game_publisher :
id [ INTEGER ] primary_key
game_id [ INTEGER ] game_publisher.game_id = game.id
publisher_id [ INTEGER ] game_publisher.publisher_id = publisher.id
Please write me a SQL statement that answers the followin... | 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 IN ('Capcom', 'Sony Computer Entertainment'); |
[INST] Here is a database schema:
genre :
id [ INTEGER ] primary_key
genre_name [ TEXT ]
game :
id [ INTEGER ] primary_key
genre_id [ INTEGER ] game.genre_id = genre.id
game_name [ TEXT ]
Please write me a SQL statement that answers the following question: What is the genre of the game "Grand Theft Auto V"? [/INST] [/... | SELECT T2.genre_name FROM game AS T1 INNER JOIN genre AS T2 ON T1.genre_id = T2.id WHERE T1.game_name = 'Grand Theft Auto V'; |
[INST] Here is a database schema:
genre :
id [ INTEGER ] primary_key
genre_name [ TEXT ]
game :
id [ INTEGER ] primary_key
genre_id [ INTEGER ] game.genre_id = genre.id
game_name [ TEXT ]
Please write me a SQL statement that answers the following question: List down the names of the games in the racing genre. [/INST] ... | SELECT T1.game_name FROM game AS T1 INNER JOIN genre AS T2 ON T1.genre_id = T2.id WHERE T2.genre_name = 'Racing'; |
[INST] Here is a database schema:
genre :
id [ INTEGER ] primary_key
genre_name [ TEXT ]
game :
id [ INTEGER ] primary_key
genre_id [ INTEGER ] game.genre_id = genre.id
game_name [ TEXT ]
Please write me a SQL statement that answers the following question: Calculate the number of games in the fighting genre. [/INST] [... | SELECT COUNT(T1.id) FROM game AS T1 INNER JOIN genre AS T2 ON T1.genre_id = T2.id WHERE T2.genre_name = 'Fighting'; |
[INST] Here is a database schema:
genre :
id [ INTEGER ] primary_key
genre_name [ TEXT ]
game :
id [ INTEGER ] primary_key
genre_id [ INTEGER ] game.genre_id = genre.id
game_name [ TEXT ]
game_publisher :
id [ INTEGER ] primary_key
game_id [ INTEGER ] game_publisher.game_id = game.id
publisher_id [ INTEGER ] game_publi... | SELECT DISTINCT T2.genre_name FROM game AS T1 INNER JOIN genre AS T2 ON T1.genre_id = T2.id INNER JOIN game_publisher AS T3 ON T1.id = T3.game_id WHERE T3.publisher_id = 464; |
[INST] Here is a database schema:
game :
id [ INTEGER ] primary_key
genre_id [ INTEGER ] game.genre_id = genre.id
game_name [ TEXT ]
platform :
id [ INTEGER ] primary_key
platform_name [ TEXT ]
game_publisher :
id [ INTEGER ] primary_key
game_id [ INTEGER ] game_publisher.game_id = game.id
publisher_id [ INTEGER ] game... | 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 = 'Final Fantasy XIII-2'; |
[INST] Here is a database schema:
game_platform :
id [ INTEGER ] primary_key
game_publisher_id [ INTEGER ] game_platform.game_publisher_id = game_publisher.id
platform_id [ INTEGER ] game_platform.platform_id = platform.id
release_year [ INTEGER ]
region_sales :
region_id [ INTEGER ] region_sales.region_id = region.id
... | SELECT SUM(T1.num_sales) FROM region_sales AS T1 INNER JOIN game_platform AS T2 ON T1.game_platform_id = T2.id WHERE T2.release_year = 2000; |
[INST] Here is a database schema:
game_platform :
id [ INTEGER ] primary_key
game_publisher_id [ INTEGER ] game_platform.game_publisher_id = game_publisher.id
platform_id [ INTEGER ] game_platform.platform_id = platform.id
release_year [ INTEGER ]
region_sales :
region_id [ INTEGER ] region_sales.region_id = region.id
... | SELECT SUM(CASE WHEN T2.release_year = 2000 THEN T1.num_sales ELSE 0 END) - SUM(CASE WHEN T2.release_year = 1990 THEN T1.num_sales ELSE 0 END) FROM region_sales AS T1 INNER JOIN game_platform AS T2 ON T1.game_platform_id = T2.id; |
[INST] Here is a database schema:
game_platform :
id [ INTEGER ] primary_key
game_publisher_id [ INTEGER ] game_platform.game_publisher_id = game_publisher.id
platform_id [ INTEGER ] game_platform.platform_id = platform.id
release_year [ INTEGER ]
Please write me a SQL statement that answers the following question: Wh... | SELECT DISTINCT T.platform_id FROM game_platform AS T WHERE T.release_year = 2006; |
[INST] Here is a database schema:
region_sales :
region_id [ INTEGER ] region_sales.region_id = region.id
game_platform_id [ INTEGER ] region_sales.game_platform_id = game_platform.id
num_sales [ REAL ]
Please write me a SQL statement that answers the following question: Compute the average number of sales in region I... | SELECT AVG(T.num_sales * 100000) FROM region_sales AS T WHERE T.region_id = 3; |
[INST] Here is a database schema:
game_platform :
id [ INTEGER ] primary_key
game_publisher_id [ INTEGER ] game_platform.game_publisher_id = game_publisher.id
platform_id [ INTEGER ] game_platform.platform_id = platform.id
release_year [ INTEGER ]
Please write me a SQL statement that answers the following question: In... | SELECT T.release_year FROM game_platform AS T WHERE T.game_publisher_id = 6657 AND T.id = 19; |
[INST] Here is a database schema:
region_sales :
region_id [ INTEGER ] region_sales.region_id = region.id
game_platform_id [ INTEGER ] region_sales.game_platform_id = game_platform.id
num_sales [ REAL ]
Please write me a SQL statement that answers the following question: Calculate the total sales in all regions with g... | SELECT SUM(T.num_sales) * 100000 FROM region_sales AS T WHERE T.game_platform_id = 66; |
[INST] Here is a database schema:
game :
id [ INTEGER ] primary_key
genre_id [ INTEGER ] game.genre_id = genre.id
game_name [ TEXT ]
Please write me a SQL statement that answers the following question: Give the game name of the game ID 44. [/INST] [/INST] | SELECT T.game_name FROM game AS T WHERE T.id = 44; |
[INST] Here is a database schema:
game :
id [ INTEGER ] primary_key
genre_id [ INTEGER ] game.genre_id = genre.id
game_name [ TEXT ]
platform :
id [ INTEGER ] primary_key
platform_name [ TEXT ]
game_publisher :
id [ INTEGER ] primary_key
game_id [ INTEGER ] game_publisher.game_id = game.id
publisher_id [ INTEGER ] game... | SELECT T4.game_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 T1.platform_name = 'Wii'; |
[INST] Here is a database schema:
game :
id [ INTEGER ] primary_key
genre_id [ INTEGER ] game.genre_id = genre.id
game_name [ TEXT ]
game_publisher :
id [ INTEGER ] primary_key
game_id [ INTEGER ] game_publisher.game_id = game.id
publisher_id [ INTEGER ] game_publisher.publisher_id = publisher.id
game_platform :
id [ I... | 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 = 2015; |
[INST] Here is a database schema:
genre :
id [ INTEGER ] primary_key
genre_name [ TEXT ]
game :
id [ INTEGER ] primary_key
genre_id [ INTEGER ] game.genre_id = genre.id
game_name [ TEXT ]
game_publisher :
id [ INTEGER ] primary_key
game_id [ INTEGER ] game_publisher.game_id = game.id
publisher_id [ INTEGER ] game_publi... | SELECT COUNT(DISTINCT T3.id) 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 = 'Adventure' AND T1.release_year = 2005; |
[INST] Here is a database schema:
game :
id [ INTEGER ] primary_key
genre_id [ INTEGER ] game.genre_id = genre.id
game_name [ TEXT ]
publisher :
id [ INTEGER ] primary_key
publisher_name [ TEXT ]
game_publisher :
id [ INTEGER ] primary_key
game_id [ INTEGER ] game_publisher.game_id = game.id
publisher_id [ INTEGER ] ga... | 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 = 'Adventure Time: Explore the Dungeon Because I Don''t Know!'; |
[INST] Here is a database schema:
region :
id [ INTEGER ] primary_key
region_name [ TEXT ]
region_sales :
region_id [ INTEGER ] region_sales.region_id = region.id
game_platform_id [ INTEGER ] region_sales.game_platform_id = game_platform.id
num_sales [ REAL ]
Please write me a SQL statement that answers the following ... | SELECT T2.game_platform_id, T1.region_name FROM region AS T1 INNER JOIN region_sales AS T2 ON T1.id = T2.region_id WHERE T2.num_sales * 100000 <= 20000; |
[INST] Here is a database schema:
game :
id [ INTEGER ] primary_key
genre_id [ INTEGER ] game.genre_id = genre.id
game_name [ TEXT ]
publisher :
id [ INTEGER ] primary_key
publisher_name [ TEXT ]
game_publisher :
id [ INTEGER ] primary_key
game_id [ INTEGER ] game_publisher.game_id = game.id
publisher_id [ INTEGER ] ga... | 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 INNER JOIN publisher AS T4 ON T2.publisher_id = T4.id WHERE T4.publisher_name = '505 Games' AND T1.release_year = 2006; |
[INST] Here is a database schema:
genre :
id [ INTEGER ] primary_key
genre_name [ TEXT ]
game :
id [ INTEGER ] primary_key
genre_id [ INTEGER ] game.genre_id = genre.id
game_name [ TEXT ]
Please write me a SQL statement that answers the following question: What is the genre of the game ID 119? [/INST] [/INST] | SELECT T2.genre_name FROM game AS T1 INNER JOIN genre AS T2 ON T1.genre_id = T2.id WHERE T1.id = 119; |
[INST] Here is a database schema:
publisher :
id [ INTEGER ] primary_key
publisher_name [ TEXT ]
game_publisher :
id [ INTEGER ] primary_key
game_id [ INTEGER ] game_publisher.game_id = game.id
publisher_id [ INTEGER ] game_publisher.publisher_id = publisher.id
Please write me a SQL statement that answers the followin... | SELECT T1.game_id FROM game_publisher AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.id WHERE T2.publisher_name = 'Abylight'; |
[INST] Here is a database schema:
region :
id [ INTEGER ] primary_key
region_name [ TEXT ]
region_sales :
region_id [ INTEGER ] region_sales.region_id = region.id
game_platform_id [ INTEGER ] region_sales.game_platform_id = game_platform.id
num_sales [ REAL ]
Please write me a SQL statement that answers the following ... | SELECT DISTINCT T1.region_name FROM region AS T1 INNER JOIN region_sales AS T2 ON T1.id = T2.region_id ORDER BY T2.num_sales LIMIT 1; |
[INST] Here is a database schema:
genre :
id [ INTEGER ] primary_key
genre_name [ TEXT ]
game :
id [ INTEGER ] primary_key
genre_id [ INTEGER ] game.genre_id = genre.id
game_name [ TEXT ]
Please write me a SQL statement that answers the following question: List down the name of strategy games. [/INST] [/INST] | SELECT T1.game_name FROM game AS T1 INNER JOIN genre AS T2 ON T1.genre_id = T2.id WHERE T2.genre_name = 'Strategy'; |
[INST] Here is a database schema:
platform :
id [ INTEGER ] primary_key
platform_name [ TEXT ]
game_publisher :
id [ INTEGER ] primary_key
game_id [ INTEGER ] game_publisher.game_id = game.id
publisher_id [ INTEGER ] game_publisher.publisher_id = publisher.id
game_platform :
id [ INTEGER ] primary_key
game_publisher_id... | SELECT T3.platform_name FROM game_publisher AS T1 INNER JOIN game_platform AS T2 ON T1.id = T2.game_publisher_id INNER JOIN platform AS T3 ON T2.platform_id = T3.id WHERE T1.game_id = 178; |
[INST] Here is a database schema:
genre :
id [ INTEGER ] primary_key
genre_name [ TEXT ]
game :
id [ INTEGER ] primary_key
genre_id [ INTEGER ] game.genre_id = genre.id
game_name [ TEXT ]
Please write me a SQL statement that answers the following question: Give the genre of the following game titled 'Airlock' , 'Airli... | SELECT T2.genre_name FROM game AS T1 INNER JOIN genre AS T2 ON T1.genre_id = T2.id WHERE T1.game_name IN ('Airlock', 'Airline Tycoon', 'Airblade'); |
[INST] Here is a database schema:
region :
id [ INTEGER ] primary_key
region_name [ TEXT ]
region_sales :
region_id [ INTEGER ] region_sales.region_id = region.id
game_platform_id [ INTEGER ] region_sales.game_platform_id = game_platform.id
num_sales [ REAL ]
Please write me a SQL statement that answers the following ... | SELECT SUM(T2.num_sales) * 100000 AS nums FROM region AS T1 INNER JOIN region_sales AS T2 ON T1.id = T2.region_id WHERE T1.region_name = 'North America'; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.