db_id
stringclasses
69 values
schema
stringclasses
69 values
m_schema
stringclasses
69 values
question
stringlengths
24
325
sql
stringlengths
23
804
evidence
stringlengths
0
673
donor
CREATE TABLE sqlite_sequence(name,seq); CREATE TABLE "essays" ( projectid TEXT, teacher_acctid TEXT, title TEXT, short_description TEXT, need_statement TEXT, essay TEXT ); CREATE TABLE "projects" ( projectid TEXT not null ...
【DB_ID】 donor 【Schema】 # Table: main.donations [ (donationid:TEXT, Primary Key, Examples: [000000a91a14ed37bef82e125c102e77]), (projectid:TEXT, Examples: [ffffac55ee02a49d1abc87ba6fc61135]), (donor_acctid:TEXT, Examples: [22cbc920c9b5fa08dfb331422f5926b5]), (donor_city:TEXT, Examples: [Peachtree City, Rockville, Salem]...
What are the coordinates of the school with the project "Wiping Away Bad Grades"?
SELECT T1.school_longitude, T1.school_latitude FROM projects AS T1 INNER JOIN essays AS T2 ON T1.projectid = T2.projectid WHERE T2.title LIKE 'Wiping Away Bad Grades'
project "Wiping Away Bad Grades" title = 'Wiping Away Bad Grades'; coordinates refers to school_longitude, school_latitude
donor
CREATE TABLE sqlite_sequence(name,seq); CREATE TABLE "essays" ( projectid TEXT, teacher_acctid TEXT, title TEXT, short_description TEXT, need_statement TEXT, essay TEXT ); CREATE TABLE "projects" ( projectid TEXT not null ...
【DB_ID】 donor 【Schema】 # Table: main.donations [ (donationid:TEXT, Primary Key, Examples: [000000a91a14ed37bef82e125c102e77]), (projectid:TEXT, Examples: [ffffac55ee02a49d1abc87ba6fc61135]), (donor_acctid:TEXT, Examples: [22cbc920c9b5fa08dfb331422f5926b5]), (donor_city:TEXT, Examples: [Peachtree City, Rockville, Salem]...
List the primary subject of all the donations with a corporate sponsored giftcard.
SELECT DISTINCT T2.primary_focus_subject FROM donations AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T1.payment_included_campaign_gift_card = 't'
corporate sponsored giftcard refers to payment_included_campaign_gift_card = 't'; primary subject refers to primary_focus_subject
donor
CREATE TABLE sqlite_sequence(name,seq); CREATE TABLE "essays" ( projectid TEXT, teacher_acctid TEXT, title TEXT, short_description TEXT, need_statement TEXT, essay TEXT ); CREATE TABLE "projects" ( projectid TEXT not null ...
【DB_ID】 donor 【Schema】 # Table: main.donations [ (donationid:TEXT, Primary Key, Examples: [000000a91a14ed37bef82e125c102e77]), (projectid:TEXT, Examples: [ffffac55ee02a49d1abc87ba6fc61135]), (donor_acctid:TEXT, Examples: [22cbc920c9b5fa08dfb331422f5926b5]), (donor_city:TEXT, Examples: [Peachtree City, Rockville, Salem]...
What is the most expensive book item? Please provide a short description of projects related to those.
SELECT T1.item_name, T2.short_description FROM resources AS T1 INNER JOIN essays AS T2 ON T1.projectid = T2.projectid WHERE T1.project_resource_type = 'Books' ORDER BY T1.item_unit_price DESC LIMIT 1
book item refers to project_resource_type = 'Books'; most expensive refers to MAX(item_unit_price)
donor
CREATE TABLE sqlite_sequence(name,seq); CREATE TABLE "essays" ( projectid TEXT, teacher_acctid TEXT, title TEXT, short_description TEXT, need_statement TEXT, essay TEXT ); CREATE TABLE "projects" ( projectid TEXT not null ...
【DB_ID】 donor 【Schema】 # Table: main.donations [ (donationid:TEXT, Primary Key, Examples: [000000a91a14ed37bef82e125c102e77]), (projectid:TEXT, Examples: [ffffac55ee02a49d1abc87ba6fc61135]), (donor_acctid:TEXT, Examples: [22cbc920c9b5fa08dfb331422f5926b5]), (donor_city:TEXT, Examples: [Peachtree City, Rockville, Salem]...
For what grade was the project "Too Close for Comfort" for?
SELECT T1.grade_level FROM projects AS T1 INNER JOIN essays AS T2 ON T1.projectid = T2.projectid WHERE T2.title LIKE 'Too Close for Comfort'
project "Too Close for Comfort" refers to title = 'Too Close for Comfort'; grade refers to grade_level
donor
CREATE TABLE sqlite_sequence(name,seq); CREATE TABLE "essays" ( projectid TEXT, teacher_acctid TEXT, title TEXT, short_description TEXT, need_statement TEXT, essay TEXT ); CREATE TABLE "projects" ( projectid TEXT not null ...
【DB_ID】 donor 【Schema】 # Table: main.donations [ (donationid:TEXT, Primary Key, Examples: [000000a91a14ed37bef82e125c102e77]), (projectid:TEXT, Examples: [ffffac55ee02a49d1abc87ba6fc61135]), (donor_acctid:TEXT, Examples: [22cbc920c9b5fa08dfb331422f5926b5]), (donor_city:TEXT, Examples: [Peachtree City, Rockville, Salem]...
What is the total number of students impacted by the projects with a donation from a donor with zip code "22205"?
SELECT SUM(T2.students_reached) FROM donations AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T1.donor_zip = 22205
zip code "22205" refers to donor_zip = '22205'; students impacted refers to students_reached
donor
CREATE TABLE sqlite_sequence(name,seq); CREATE TABLE "essays" ( projectid TEXT, teacher_acctid TEXT, title TEXT, short_description TEXT, need_statement TEXT, essay TEXT ); CREATE TABLE "projects" ( projectid TEXT not null ...
【DB_ID】 donor 【Schema】 # Table: main.donations [ (donationid:TEXT, Primary Key, Examples: [000000a91a14ed37bef82e125c102e77]), (projectid:TEXT, Examples: [ffffac55ee02a49d1abc87ba6fc61135]), (donor_acctid:TEXT, Examples: [22cbc920c9b5fa08dfb331422f5926b5]), (donor_city:TEXT, Examples: [Peachtree City, Rockville, Salem]...
What percentage of donations are given via a giving or campaign page? List the primary area of those donations.
SELECT CAST(SUM(CASE WHEN T1.via_giving_page = 't' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(donation_total), ( SELECT T2.primary_focus_area FROM donations AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T1.via_giving_page = 't' GROUP BY T2.primary_focus_area ORDER BY SUM(T1.donation_total) DESC LI...
given via a giving or campaign page refers to via_giving_page = 't'; percentage refers to DIVIDE(count(case when via_giving_page = 't' then donationid else null end),count(donationid))*100; primary area of donation refers to primary_focus_area
donor
CREATE TABLE sqlite_sequence(name,seq); CREATE TABLE "essays" ( projectid TEXT, teacher_acctid TEXT, title TEXT, short_description TEXT, need_statement TEXT, essay TEXT ); CREATE TABLE "projects" ( projectid TEXT not null ...
【DB_ID】 donor 【Schema】 # Table: main.donations [ (donationid:TEXT, Primary Key, Examples: [000000a91a14ed37bef82e125c102e77]), (projectid:TEXT, Examples: [ffffac55ee02a49d1abc87ba6fc61135]), (donor_acctid:TEXT, Examples: [22cbc920c9b5fa08dfb331422f5926b5]), (donor_city:TEXT, Examples: [Peachtree City, Rockville, Salem]...
Among the technology items, what percentage of them are from Best Buy for Business? Provide the date of the project related to those items.
SELECT CAST(SUM(CASE WHEN T1.vendor_name = 'Best Buy for Business' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.projectid) FROM resources AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T1.project_resource_type = 'Technology' UNION ALL SELECT DISTINCT T1.date_posted FROM projects AS T1 INNER JOIN r...
technology items refers to project_resource_type = 'Technology'; from Best Buy for Business refers to vendor_name = 'Best Buy for Business'; percentage refers to DIVIDE(count(case when vendor_name = 'Best Buy for Business'),count(projectid))
video_games
CREATE TABLE genre ( id INTEGER not null primary key, genre_name TEXT default NULL ); CREATE TABLE game ( id INTEGER not null primary key, genre_id INTEGER default NULL, game_name TEXT default NULL, foreign key (genre_id) references genre(id) ); ...
【DB_ID】 video_games 【Schema】 # Table: main.game [ (id:INTEGER, Primary Key, Examples: [44, 45, 46]), (genre_id:INTEGER, Examples: [4, 5, 11]), (game_name:TEXT, Examples: [2 Games in 1: Sonic Advance & ChuChu Rocket!]) ] # Table: main.game_platform [ (id:INTEGER, Primary Key, Examples: [1, 2, 3]), (game_publisher_id:INT...
How many more games were sold on game platform ID 50 than on game platform ID 51 in region ID 1?
SELECT (SUM(CASE WHEN T.game_platform_id = 50 THEN T.num_sales ELSE 0 END) - SUM(CASE WHEN T.game_platform_id = 51 THEN T.num_sales ELSE 0 END)) * 100000 AS nums FROM region_sales AS T WHERE T.region_id = 1
result = subtract(sum(num_sales where game_platform_id = 50), sum(num_sales where game_platform_id = 51))
video_games
CREATE TABLE genre ( id INTEGER not null primary key, genre_name TEXT default NULL ); CREATE TABLE game ( id INTEGER not null primary key, genre_id INTEGER default NULL, game_name TEXT default NULL, foreign key (genre_id) references genre(id) ); ...
【DB_ID】 video_games 【Schema】 # Table: main.game [ (id:INTEGER, Primary Key, Examples: [44, 45, 46]), (genre_id:INTEGER, Examples: [4, 5, 11]), (game_name:TEXT, Examples: [2 Games in 1: Sonic Advance & ChuChu Rocket!]) ] # Table: main.game_platform [ (id:INTEGER, Primary Key, Examples: [1, 2, 3]), (game_publisher_id:INT...
Please list all the games that have the same game genre as 3D Lemmings.
SELECT T1.game_name FROM game AS T1 WHERE T1.genre_id = ( SELECT T.genre_id FROM game AS T WHERE T.game_name = '3D Lemmings' )
game refers to game_name; 3D Lemmings refers to game_name = '3D Lemmings'
video_games
CREATE TABLE genre ( id INTEGER not null primary key, genre_name TEXT default NULL ); CREATE TABLE game ( id INTEGER not null primary key, genre_id INTEGER default NULL, game_name TEXT default NULL, foreign key (genre_id) references genre(id) ); ...
【DB_ID】 video_games 【Schema】 # Table: main.game [ (id:INTEGER, Primary Key, Examples: [44, 45, 46]), (genre_id:INTEGER, Examples: [4, 5, 11]), (game_name:TEXT, Examples: [2 Games in 1: Sonic Advance & ChuChu Rocket!]) ] # Table: main.game_platform [ (id:INTEGER, Primary Key, Examples: [1, 2, 3]), (game_publisher_id:INT...
How many action games are there in total?
SELECT COUNT(T1.id) FROM game AS T1 INNER JOIN genre AS T2 ON T1.genre_id = T2.id WHERE T2.genre_name = 'Action'
action game refers to genre_name = 'Action'
video_games
CREATE TABLE genre ( id INTEGER not null primary key, genre_name TEXT default NULL ); CREATE TABLE game ( id INTEGER not null primary key, genre_id INTEGER default NULL, game_name TEXT default NULL, foreign key (genre_id) references genre(id) ); ...
【DB_ID】 video_games 【Schema】 # Table: main.game [ (id:INTEGER, Primary Key, Examples: [44, 45, 46]), (genre_id:INTEGER, Examples: [4, 5, 11]), (game_name:TEXT, Examples: [2 Games in 1: Sonic Advance & ChuChu Rocket!]) ] # Table: main.game_platform [ (id:INTEGER, Primary Key, Examples: [1, 2, 3]), (game_publisher_id:INT...
What is the genre of 3D Lemmings?
SELECT T2.genre_name FROM game AS T1 INNER JOIN genre AS T2 ON T1.genre_id = T2.id WHERE T1.game_name = '3D Lemmings'
genre refers to genre_name; 3D Lemmings refers to game_name = '3D Lemmings'
video_games
CREATE TABLE genre ( id INTEGER not null primary key, genre_name TEXT default NULL ); CREATE TABLE game ( id INTEGER not null primary key, genre_id INTEGER default NULL, game_name TEXT default NULL, foreign key (genre_id) references genre(id) ); ...
【DB_ID】 video_games 【Schema】 # Table: main.game [ (id:INTEGER, Primary Key, Examples: [44, 45, 46]), (genre_id:INTEGER, Examples: [4, 5, 11]), (game_name:TEXT, Examples: [2 Games in 1: Sonic Advance & ChuChu Rocket!]) ] # Table: main.game_platform [ (id:INTEGER, Primary Key, Examples: [1, 2, 3]), (game_publisher_id:INT...
Who is the publisher of 3D Lemmings?
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 = '3D Lemmings'
publisher refers to publisher_name; 3D Lemmings refers to game_name = '3D Lemmings'
video_games
CREATE TABLE genre ( id INTEGER not null primary key, genre_name TEXT default NULL ); CREATE TABLE game ( id INTEGER not null primary key, genre_id INTEGER default NULL, game_name TEXT default NULL, foreign key (genre_id) references genre(id) ); ...
【DB_ID】 video_games 【Schema】 # Table: main.game [ (id:INTEGER, Primary Key, Examples: [44, 45, 46]), (genre_id:INTEGER, Examples: [4, 5, 11]), (game_name:TEXT, Examples: [2 Games in 1: Sonic Advance & ChuChu Rocket!]) ] # Table: main.game_platform [ (id:INTEGER, Primary Key, Examples: [1, 2, 3]), (game_publisher_id:INT...
Please list the names of all the games published by 10TACLE Studios.
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 = '10TACLE Studios'
name refers to game_name; published by 10TACLE Studios refers to publisher_name = '10TACLE Studios'
video_games
CREATE TABLE genre ( id INTEGER not null primary key, genre_name TEXT default NULL ); CREATE TABLE game ( id INTEGER not null primary key, genre_id INTEGER default NULL, game_name TEXT default NULL, foreign key (genre_id) references genre(id) ); ...
【DB_ID】 video_games 【Schema】 # Table: main.game [ (id:INTEGER, Primary Key, Examples: [44, 45, 46]), (genre_id:INTEGER, Examples: [4, 5, 11]), (game_name:TEXT, Examples: [2 Games in 1: Sonic Advance & ChuChu Rocket!]) ] # Table: main.game_platform [ (id:INTEGER, Primary Key, Examples: [1, 2, 3]), (game_publisher_id:INT...
Among the games published by 10TACLE Studios, how many of them are puzzles?
SELECT COUNT(T1.id) 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 INNER JOIN genre AS T4 ON T1.genre_id = T4.id WHERE T4.genre_name = 'Puzzle' AND T3.publisher_name = '10TACLE Studios'
published by 10TACLE Studios refers to publisher_name = '10TACLE Studios'; puzzle refers to genre_name = 'Puzzle'
video_games
CREATE TABLE genre ( id INTEGER not null primary key, genre_name TEXT default NULL ); CREATE TABLE game ( id INTEGER not null primary key, genre_id INTEGER default NULL, game_name TEXT default NULL, foreign key (genre_id) references genre(id) ); ...
【DB_ID】 video_games 【Schema】 # Table: main.game [ (id:INTEGER, Primary Key, Examples: [44, 45, 46]), (genre_id:INTEGER, Examples: [4, 5, 11]), (game_name:TEXT, Examples: [2 Games in 1: Sonic Advance & ChuChu Rocket!]) ] # Table: main.game_platform [ (id:INTEGER, Primary Key, Examples: [1, 2, 3]), (game_publisher_id:INT...
Please list the names of all the games published by 10TACLE Studios and are puzzles.
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 INNER JOIN genre AS T4 ON T1.genre_id = T4.id WHERE T3.publisher_name = '10TACLE Studios' AND T4.genre_name = 'Puzzle'
name refers to game_name; published by 10TACLE Studios refers to publisher_name = '10TACLE Studios'; puzzle refers to genre_name = 'Puzzle'
video_games
CREATE TABLE genre ( id INTEGER not null primary key, genre_name TEXT default NULL ); CREATE TABLE game ( id INTEGER not null primary key, genre_id INTEGER default NULL, game_name TEXT default NULL, foreign key (genre_id) references genre(id) ); ...
【DB_ID】 video_games 【Schema】 # Table: main.game [ (id:INTEGER, Primary Key, Examples: [44, 45, 46]), (genre_id:INTEGER, Examples: [4, 5, 11]), (game_name:TEXT, Examples: [2 Games in 1: Sonic Advance & ChuChu Rocket!]) ] # Table: main.game_platform [ (id:INTEGER, Primary Key, Examples: [1, 2, 3]), (game_publisher_id:INT...
Which publisher has published the most games?
SELECT T.publisher_name FROM ( SELECT T2.publisher_name, COUNT(DISTINCT T2.id) FROM game_publisher AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.id GROUP BY T1.publisher_id ORDER BY COUNT(T2.id) DESC LIMIT 1 ) t
publisher refers to publisher_name; the most games refers to max(count(game_id))
video_games
CREATE TABLE genre ( id INTEGER not null primary key, genre_name TEXT default NULL ); CREATE TABLE game ( id INTEGER not null primary key, genre_id INTEGER default NULL, game_name TEXT default NULL, foreign key (genre_id) references genre(id) ); ...
【DB_ID】 video_games 【Schema】 # Table: main.game [ (id:INTEGER, Primary Key, Examples: [44, 45, 46]), (genre_id:INTEGER, Examples: [4, 5, 11]), (game_name:TEXT, Examples: [2 Games in 1: Sonic Advance & ChuChu Rocket!]) ] # Table: main.game_platform [ (id:INTEGER, Primary Key, Examples: [1, 2, 3]), (game_publisher_id:INT...
On which platform was Panzer Tactics released in 2007?
SELECT T5.platform_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 INNER JOIN game_platform AS T4 ON T1.id = T4.game_publisher_id INNER JOIN platform AS T5 ON T4.platform_id = T5.id WHERE T3.game_name = 'Panzer Tactics' AND T4.release_year...
platform refers to platform_name; Panzer Tactics refers to game_name = 'Panzer Tactics'; released in 2007 refers to release_year = 2007
video_games
CREATE TABLE genre ( id INTEGER not null primary key, genre_name TEXT default NULL ); CREATE TABLE game ( id INTEGER not null primary key, genre_id INTEGER default NULL, game_name TEXT default NULL, foreign key (genre_id) references genre(id) ); ...
【DB_ID】 video_games 【Schema】 # Table: main.game [ (id:INTEGER, Primary Key, Examples: [44, 45, 46]), (genre_id:INTEGER, Examples: [4, 5, 11]), (game_name:TEXT, Examples: [2 Games in 1: Sonic Advance & ChuChu Rocket!]) ] # Table: main.game_platform [ (id:INTEGER, Primary Key, Examples: [1, 2, 3]), (game_publisher_id:INT...
In which year was Panzer Tactics released on DS?
SELECT T4.release_year 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 INNER JOIN game_platform AS T4 ON T1.id = T4.game_publisher_id INNER JOIN platform AS T5 ON T4.platform_id = T5.id WHERE T3.game_name = 'Panzer Tactics' AND T5.platform_name...
year refers to release_year; Panzer Tactics refers to game_name = 'Panzer Tactics'; on DS refers to platform_name = 'DS'
video_games
CREATE TABLE genre ( id INTEGER not null primary key, genre_name TEXT default NULL ); CREATE TABLE game ( id INTEGER not null primary key, genre_id INTEGER default NULL, game_name TEXT default NULL, foreign key (genre_id) references genre(id) ); ...
【DB_ID】 video_games 【Schema】 # Table: main.game [ (id:INTEGER, Primary Key, Examples: [44, 45, 46]), (genre_id:INTEGER, Examples: [4, 5, 11]), (game_name:TEXT, Examples: [2 Games in 1: Sonic Advance & ChuChu Rocket!]) ] # Table: main.game_platform [ (id:INTEGER, Primary Key, Examples: [1, 2, 3]), (game_publisher_id:INT...
Please list the names of the publishers of all the puzzle games.
SELECT DISTINCT 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 INNER JOIN genre AS T4 ON T1.genre_id = T4.id WHERE T4.genre_name = 'Puzzle'
name of publisher refers to publisher_name; puzzle refers to genre_name = 'Puzzle'
video_games
CREATE TABLE genre ( id INTEGER not null primary key, genre_name TEXT default NULL ); CREATE TABLE game ( id INTEGER not null primary key, genre_id INTEGER default NULL, game_name TEXT default NULL, foreign key (genre_id) references genre(id) ); ...
【DB_ID】 video_games 【Schema】 # Table: main.game [ (id:INTEGER, Primary Key, Examples: [44, 45, 46]), (genre_id:INTEGER, Examples: [4, 5, 11]), (game_name:TEXT, Examples: [2 Games in 1: Sonic Advance & ChuChu Rocket!]) ] # Table: main.game_platform [ (id:INTEGER, Primary Key, Examples: [1, 2, 3]), (game_publisher_id:INT...
What is the name of the publisher that has published the most puzzle games?
SELECT T.publisher_name FROM ( SELECT T3.publisher_name, COUNT(DISTINCT T1.id) 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 INNER JOIN genre AS T4 ON T1.genre_id = T4.id WHERE T4.genre_name = 'Puzzle' GROUP BY T3.publisher_name ORDER BY COUN...
name of publisher refers to publisher_name; puzzle refers to genre_name = 'Puzzle'; the most puzzle games refers to max(count(game_id where genre_name = 'Puzzle'))
video_games
CREATE TABLE genre ( id INTEGER not null primary key, genre_name TEXT default NULL ); CREATE TABLE game ( id INTEGER not null primary key, genre_id INTEGER default NULL, game_name TEXT default NULL, foreign key (genre_id) references genre(id) ); ...
【DB_ID】 video_games 【Schema】 # Table: main.game [ (id:INTEGER, Primary Key, Examples: [44, 45, 46]), (genre_id:INTEGER, Examples: [4, 5, 11]), (game_name:TEXT, Examples: [2 Games in 1: Sonic Advance & ChuChu Rocket!]) ] # Table: main.game_platform [ (id:INTEGER, Primary Key, Examples: [1, 2, 3]), (game_publisher_id:INT...
How many publishers have published more than 3 puzzle games?
SELECT COUNT(T.publisher_name) FROM ( SELECT T3.publisher_name, COUNT(DISTINCT T1.id) 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 INNER JOIN genre AS T4 ON T1.genre_id = T4.id WHERE T4.genre_name = 'Puzzle' GROUP BY T3.publisher_name HAVING...
puzzle refers to genre_name = 'Puzzle'; more than 3 puzzle games refers to count(game_id where genre_name = 'Puzzle') > 3
video_games
CREATE TABLE genre ( id INTEGER not null primary key, genre_name TEXT default NULL ); CREATE TABLE game ( id INTEGER not null primary key, genre_id INTEGER default NULL, game_name TEXT default NULL, foreign key (genre_id) references genre(id) ); ...
【DB_ID】 video_games 【Schema】 # Table: main.game [ (id:INTEGER, Primary Key, Examples: [44, 45, 46]), (genre_id:INTEGER, Examples: [4, 5, 11]), (game_name:TEXT, Examples: [2 Games in 1: Sonic Advance & ChuChu Rocket!]) ] # Table: main.game_platform [ (id:INTEGER, Primary Key, Examples: [1, 2, 3]), (game_publisher_id:INT...
Among the games published by Nintendo, what is the percentage of those in the genre of sports?
SELECT CAST(COUNT(CASE WHEN T4.genre_name = 'Sports' THEN T1.id ELSE NULL END) AS REAL) * 100/ COUNT(T1.id) 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 INNER JOIN genre AS T4 ON T1.genre_id = T4.id WHERE T3.publisher_name = 'Nintendo'
published by Nintendo refers to publisher_name = 'Nintendo'; in the genre of sports refers to genre_name = 'Sports'; percentage = divide(count(game_id where genre_name = 'Sports'), count(game_id)) * 100% where publisher_name = 'Nintendo'
video_games
CREATE TABLE genre ( id INTEGER not null primary key, genre_name TEXT default NULL ); CREATE TABLE game ( id INTEGER not null primary key, genre_id INTEGER default NULL, game_name TEXT default NULL, foreign key (genre_id) references genre(id) ); ...
【DB_ID】 video_games 【Schema】 # Table: main.game [ (id:INTEGER, Primary Key, Examples: [44, 45, 46]), (genre_id:INTEGER, Examples: [4, 5, 11]), (game_name:TEXT, Examples: [2 Games in 1: Sonic Advance & ChuChu Rocket!]) ] # Table: main.game_platform [ (id:INTEGER, Primary Key, Examples: [1, 2, 3]), (game_publisher_id:INT...
How many games were sold on the DS platform on average in the 4 different regions?
SELECT SUM(T1.num_sales) * 100000 / 4 FROM region_sales AS T1 INNER JOIN game_platform AS T2 ON T1.game_platform_id = T2.id INNER JOIN platform AS T3 ON T2.platform_id = T3.id WHERE T3.platform_name = 'DS'
on the DS platform refers to platform_name = 'DS'; number of games sold on average = divide(sum(multiply(num_sales, 100000)), 4) where platform_name = 'DS'
video_games
CREATE TABLE genre ( id INTEGER not null primary key, genre_name TEXT default NULL ); CREATE TABLE game ( id INTEGER not null primary key, genre_id INTEGER default NULL, game_name TEXT default NULL, foreign key (genre_id) references genre(id) ); ...
【DB_ID】 video_games 【Schema】 # Table: main.game [ (id:INTEGER, Primary Key, Examples: [44, 45, 46]), (genre_id:INTEGER, Examples: [4, 5, 11]), (game_name:TEXT, Examples: [2 Games in 1: Sonic Advance & ChuChu Rocket!]) ] # Table: main.game_platform [ (id:INTEGER, Primary Key, Examples: [1, 2, 3]), (game_publisher_id:INT...
Tell the number of games whose publisher id is 352.
SELECT DISTINCT T.game_id FROM game_publisher AS T WHERE T.publisher_id = 352
number of games refers to count(game_id)
video_games
CREATE TABLE genre ( id INTEGER not null primary key, genre_name TEXT default NULL ); CREATE TABLE game ( id INTEGER not null primary key, genre_id INTEGER default NULL, game_name TEXT default NULL, foreign key (genre_id) references genre(id) ); ...
【DB_ID】 video_games 【Schema】 # Table: main.game [ (id:INTEGER, Primary Key, Examples: [44, 45, 46]), (genre_id:INTEGER, Examples: [4, 5, 11]), (game_name:TEXT, Examples: [2 Games in 1: Sonic Advance & ChuChu Rocket!]) ] # Table: main.game_platform [ (id:INTEGER, Primary Key, Examples: [1, 2, 3]), (game_publisher_id:INT...
List the genre id of the game Pro Evolution Soccer 2012.
SELECT T.genre_id FROM game AS T WHERE T.game_name = 'Pro Evolution Soccer 2012'
Pro Evolution Soccer 2012 refers to game_name = 'Pro Evolution Soccer 2012'
video_games
CREATE TABLE genre ( id INTEGER not null primary key, genre_name TEXT default NULL ); CREATE TABLE game ( id INTEGER not null primary key, genre_id INTEGER default NULL, game_name TEXT default NULL, foreign key (genre_id) references genre(id) ); ...
【DB_ID】 video_games 【Schema】 # Table: main.game [ (id:INTEGER, Primary Key, Examples: [44, 45, 46]), (genre_id:INTEGER, Examples: [4, 5, 11]), (game_name:TEXT, Examples: [2 Games in 1: Sonic Advance & ChuChu Rocket!]) ] # Table: main.game_platform [ (id:INTEGER, Primary Key, Examples: [1, 2, 3]), (game_publisher_id:INT...
State the region id of Japan.
SELECT T.id FROM region AS T WHERE T.region_name = 'Japan'
region id refers to region.id; Japan refers to region_name = 'Japan'
video_games
CREATE TABLE genre ( id INTEGER not null primary key, genre_name TEXT default NULL ); CREATE TABLE game ( id INTEGER not null primary key, genre_id INTEGER default NULL, game_name TEXT default NULL, foreign key (genre_id) references genre(id) ); ...
【DB_ID】 video_games 【Schema】 # Table: main.game [ (id:INTEGER, Primary Key, Examples: [44, 45, 46]), (genre_id:INTEGER, Examples: [4, 5, 11]), (game_name:TEXT, Examples: [2 Games in 1: Sonic Advance & ChuChu Rocket!]) ] # Table: main.game_platform [ (id:INTEGER, Primary Key, Examples: [1, 2, 3]), (game_publisher_id:INT...
Show the id of the game platform with the most sales in region 2.
SELECT T1.game_platform_id FROM ( SELECT T.game_platform_id, SUM(T.num_sales) FROM region_sales AS T WHERE T.region_id = 2 GROUP BY T.game_platform_id ORDER BY SUM(T.num_sales) DESC LIMIT 1 ) T1
id of the game platform refers to game_platform_id; the most sales refers to max(num_sales); region 2 refers to region_id = '2'
video_games
CREATE TABLE genre ( id INTEGER not null primary key, genre_name TEXT default NULL ); CREATE TABLE game ( id INTEGER not null primary key, genre_id INTEGER default NULL, game_name TEXT default NULL, foreign key (genre_id) references genre(id) ); ...
【DB_ID】 video_games 【Schema】 # Table: main.game [ (id:INTEGER, Primary Key, Examples: [44, 45, 46]), (genre_id:INTEGER, Examples: [4, 5, 11]), (game_name:TEXT, Examples: [2 Games in 1: Sonic Advance & ChuChu Rocket!]) ] # Table: main.game_platform [ (id:INTEGER, Primary Key, Examples: [1, 2, 3]), (game_publisher_id:INT...
Which genre has the most games? Show its id.
SELECT genre_id FROM ( SELECT T.genre_id, COUNT(T.id) FROM game AS T GROUP BY T.genre_id ORDER BY COUNT(T.id) DESC LIMIT 1 )
the most games refers to max(game_id); genre id refers to genre_id
video_games
CREATE TABLE genre ( id INTEGER not null primary key, genre_name TEXT default NULL ); CREATE TABLE game ( id INTEGER not null primary key, genre_id INTEGER default NULL, game_name TEXT default NULL, foreign key (genre_id) references genre(id) ); ...
【DB_ID】 video_games 【Schema】 # Table: main.game [ (id:INTEGER, Primary Key, Examples: [44, 45, 46]), (genre_id:INTEGER, Examples: [4, 5, 11]), (game_name:TEXT, Examples: [2 Games in 1: Sonic Advance & ChuChu Rocket!]) ] # Table: main.game_platform [ (id:INTEGER, Primary Key, Examples: [1, 2, 3]), (game_publisher_id:INT...
What is the id of the game "Resident Evil Archives: Resident Evil"?
SELECT T.genre_id FROM game AS T WHERE T.game_name = 'Resident Evil Archives: Resident Evil'
id of game refers to game.id; "Resident Evil Archives: Resident Evil" refers to game_name = 'Resident Evil Archives: Resident Evil'
video_games
CREATE TABLE genre ( id INTEGER not null primary key, genre_name TEXT default NULL ); CREATE TABLE game ( id INTEGER not null primary key, genre_id INTEGER default NULL, game_name TEXT default NULL, foreign key (genre_id) references genre(id) ); ...
【DB_ID】 video_games 【Schema】 # Table: main.game [ (id:INTEGER, Primary Key, Examples: [44, 45, 46]), (genre_id:INTEGER, Examples: [4, 5, 11]), (game_name:TEXT, Examples: [2 Games in 1: Sonic Advance & ChuChu Rocket!]) ] # Table: main.game_platform [ (id:INTEGER, Primary Key, Examples: [1, 2, 3]), (game_publisher_id:INT...
Show the number of games which were released on X360 in 2010.
SELECT 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 = 'X360' AND T2.release_year = 2010
on X360 refers to platform_name = 'X360'; in 2010 refers to release_year = '2010'
video_games
CREATE TABLE genre ( id INTEGER not null primary key, genre_name TEXT default NULL ); CREATE TABLE game ( id INTEGER not null primary key, genre_id INTEGER default NULL, game_name TEXT default NULL, foreign key (genre_id) references genre(id) ); ...
【DB_ID】 video_games 【Schema】 # Table: main.game [ (id:INTEGER, Primary Key, Examples: [44, 45, 46]), (genre_id:INTEGER, Examples: [4, 5, 11]), (game_name:TEXT, Examples: [2 Games in 1: Sonic Advance & ChuChu Rocket!]) ] # Table: main.game_platform [ (id:INTEGER, Primary Key, Examples: [1, 2, 3]), (game_publisher_id:INT...
State the publisher name of the game "ModNation Racers".
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 = 'ModNation Racers'
game "ModNation Racers" refers to game_name = 'ModNation Racers'
video_games
CREATE TABLE genre ( id INTEGER not null primary key, genre_name TEXT default NULL ); CREATE TABLE game ( id INTEGER not null primary key, genre_id INTEGER default NULL, game_name TEXT default NULL, foreign key (genre_id) references genre(id) ); ...
【DB_ID】 video_games 【Schema】 # Table: main.game [ (id:INTEGER, Primary Key, Examples: [44, 45, 46]), (genre_id:INTEGER, Examples: [4, 5, 11]), (game_name:TEXT, Examples: [2 Games in 1: Sonic Advance & ChuChu Rocket!]) ] # Table: main.game_platform [ (id:INTEGER, Primary Key, Examples: [1, 2, 3]), (game_publisher_id:INT...
Show the id of game platform which makes the most sales in Japan.
SELECT T.game_platform_id FROM ( SELECT T2.game_platform_id, MAX(T2.num_sales) FROM region AS T1 INNER JOIN region_sales AS T2 ON T1.id = T2.region_id WHERE T1.region_name = 'Japan' ) t
id of game platform refers to game_platform_id; the most sales refers to max(num_sales); in Japan refers to region_name = 'Japan'
video_games
CREATE TABLE genre ( id INTEGER not null primary key, genre_name TEXT default NULL ); CREATE TABLE game ( id INTEGER not null primary key, genre_id INTEGER default NULL, game_name TEXT default NULL, foreign key (genre_id) references genre(id) ); ...
【DB_ID】 video_games 【Schema】 # Table: main.game [ (id:INTEGER, Primary Key, Examples: [44, 45, 46]), (genre_id:INTEGER, Examples: [4, 5, 11]), (game_name:TEXT, Examples: [2 Games in 1: Sonic Advance & ChuChu Rocket!]) ] # Table: main.game_platform [ (id:INTEGER, Primary Key, Examples: [1, 2, 3]), (game_publisher_id:INT...
How many platforms are available for the game Pro Evolution Soccer 2016?
SELECT COUNT(T2.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 INNER JOIN game AS T4 ON T3.game_id = T4.id WHERE T4.game_name = 'Pro Evolution Soccer 2016'
game Pro Evolution Soccer 2016 refers to game_name = 'Pro Evolution Soccer 2016'
video_games
CREATE TABLE genre ( id INTEGER not null primary key, genre_name TEXT default NULL ); CREATE TABLE game ( id INTEGER not null primary key, genre_id INTEGER default NULL, game_name TEXT default NULL, foreign key (genre_id) references genre(id) ); ...
【DB_ID】 video_games 【Schema】 # Table: main.game [ (id:INTEGER, Primary Key, Examples: [44, 45, 46]), (genre_id:INTEGER, Examples: [4, 5, 11]), (game_name:TEXT, Examples: [2 Games in 1: Sonic Advance & ChuChu Rocket!]) ] # Table: main.game_platform [ (id:INTEGER, Primary Key, Examples: [1, 2, 3]), (game_publisher_id:INT...
How many games in the database belong to the genre of sports?
SELECT COUNT(T1.id) FROM game AS T1 INNER JOIN genre AS T2 ON T1.genre_id = T2.id WHERE T2.genre_name = 'Sports'
the genre of sports refers to genre_name = 'Sports'
video_games
CREATE TABLE genre ( id INTEGER not null primary key, genre_name TEXT default NULL ); CREATE TABLE game ( id INTEGER not null primary key, genre_id INTEGER default NULL, game_name TEXT default NULL, foreign key (genre_id) references genre(id) ); ...
【DB_ID】 video_games 【Schema】 # Table: main.game [ (id:INTEGER, Primary Key, Examples: [44, 45, 46]), (genre_id:INTEGER, Examples: [4, 5, 11]), (game_name:TEXT, Examples: [2 Games in 1: Sonic Advance & ChuChu Rocket!]) ] # Table: main.game_platform [ (id:INTEGER, Primary Key, Examples: [1, 2, 3]), (game_publisher_id:INT...
Name of the publisher of the game id 10031.
SELECT T2.publisher_name FROM game_publisher AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.id WHERE T1.game_id = 10031
name of publisher refers to publisher_name; the game id 10031 refers to game_id = '10031'
video_games
CREATE TABLE genre ( id INTEGER not null primary key, genre_name TEXT default NULL ); CREATE TABLE game ( id INTEGER not null primary key, genre_id INTEGER default NULL, game_name TEXT default NULL, foreign key (genre_id) references genre(id) ); ...
【DB_ID】 video_games 【Schema】 # Table: main.game [ (id:INTEGER, Primary Key, Examples: [44, 45, 46]), (genre_id:INTEGER, Examples: [4, 5, 11]), (game_name:TEXT, Examples: [2 Games in 1: Sonic Advance & ChuChu Rocket!]) ] # Table: main.game_platform [ (id:INTEGER, Primary Key, Examples: [1, 2, 3]), (game_publisher_id:INT...
State the name of the publisher with the most games.
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
name of publisher refers to publisher_name; the most games refers to max(game_id)
video_games
CREATE TABLE genre ( id INTEGER not null primary key, genre_name TEXT default NULL ); CREATE TABLE game ( id INTEGER not null primary key, genre_id INTEGER default NULL, game_name TEXT default NULL, foreign key (genre_id) references genre(id) ); ...
【DB_ID】 video_games 【Schema】 # Table: main.game [ (id:INTEGER, Primary Key, Examples: [44, 45, 46]), (genre_id:INTEGER, Examples: [4, 5, 11]), (game_name:TEXT, Examples: [2 Games in 1: Sonic Advance & ChuChu Rocket!]) ] # Table: main.game_platform [ (id:INTEGER, Primary Key, Examples: [1, 2, 3]), (game_publisher_id:INT...
How many more sports games than simulation games?
SELECT COUNT(CASE WHEN T1.genre_name = 'Sports' THEN T2.id ELSE NULL END) - COUNT(CASE WHEN T1.genre_name = 'Simulation' THEN T2.id ELSE NULL END) FROM genre AS T1 INNER JOIN game AS T2 ON T1.id = T2.genre_id
sports game refers to genre_name = 'Sports'; simulation game refers to genre_name = 'Simulation'; how many more = subtract(sum(game_id where genre_name = 'Sports'), sum(game_id where genre_name = 'Simulation'))
video_games
CREATE TABLE genre ( id INTEGER not null primary key, genre_name TEXT default NULL ); CREATE TABLE game ( id INTEGER not null primary key, genre_id INTEGER default NULL, game_name TEXT default NULL, foreign key (genre_id) references genre(id) ); ...
【DB_ID】 video_games 【Schema】 # Table: main.game [ (id:INTEGER, Primary Key, Examples: [44, 45, 46]), (genre_id:INTEGER, Examples: [4, 5, 11]), (game_name:TEXT, Examples: [2 Games in 1: Sonic Advance & ChuChu Rocket!]) ] # Table: main.game_platform [ (id:INTEGER, Primary Key, Examples: [1, 2, 3]), (game_publisher_id:INT...
Tell the genre of the game "Resident Evil: Revelations".
SELECT T2.genre_name FROM game AS T1 INNER JOIN genre AS T2 ON T1.genre_id = T2.id WHERE T1.game_name = 'Resident Evil: Revelations'
genre refers to genre_name; game "Resident Evil: Revelations" refers to game_name = 'Resident Evil: Revelations'
video_games
CREATE TABLE genre ( id INTEGER not null primary key, genre_name TEXT default NULL ); CREATE TABLE game ( id INTEGER not null primary key, genre_id INTEGER default NULL, game_name TEXT default NULL, foreign key (genre_id) references genre(id) ); ...
【DB_ID】 video_games 【Schema】 # Table: main.game [ (id:INTEGER, Primary Key, Examples: [44, 45, 46]), (genre_id:INTEGER, Examples: [4, 5, 11]), (game_name:TEXT, Examples: [2 Games in 1: Sonic Advance & ChuChu Rocket!]) ] # Table: main.game_platform [ (id:INTEGER, Primary Key, Examples: [1, 2, 3]), (game_publisher_id:INT...
How many sales does game platform id 3871 make in Europe?
SELECT T2.num_sales * 100000 FROM region AS T1 INNER JOIN region_sales AS T2 ON T1.id = T2.region_id WHERE T1.region_name = 'Europe' AND T2.game_platform_id = 3871
number of sales = multiply(num_sales, 100000); in Europe refers to region_name = 'Europe'
video_games
CREATE TABLE genre ( id INTEGER not null primary key, genre_name TEXT default NULL ); CREATE TABLE game ( id INTEGER not null primary key, genre_id INTEGER default NULL, game_name TEXT default NULL, foreign key (genre_id) references genre(id) ); ...
【DB_ID】 video_games 【Schema】 # Table: main.game [ (id:INTEGER, Primary Key, Examples: [44, 45, 46]), (genre_id:INTEGER, Examples: [4, 5, 11]), (game_name:TEXT, Examples: [2 Games in 1: Sonic Advance & ChuChu Rocket!]) ] # Table: main.game_platform [ (id:INTEGER, Primary Key, Examples: [1, 2, 3]), (game_publisher_id:INT...
Give the number of games which were published by Ascaron Entertainment GmbH.
SELECT COUNT(T2.game_id) FROM publisher AS T1 INNER JOIN game_publisher AS T2 ON T1.id = T2.publisher_id WHERE T1.publisher_name = 'Ascaron Entertainment GmbH'
published by Ascaron Entertainment GmbH refers to publisher_name = 'Ascaron Entertainment GmbH'
video_games
CREATE TABLE genre ( id INTEGER not null primary key, genre_name TEXT default NULL ); CREATE TABLE game ( id INTEGER not null primary key, genre_id INTEGER default NULL, game_name TEXT default NULL, foreign key (genre_id) references genre(id) ); ...
【DB_ID】 video_games 【Schema】 # Table: main.game [ (id:INTEGER, Primary Key, Examples: [44, 45, 46]), (genre_id:INTEGER, Examples: [4, 5, 11]), (game_name:TEXT, Examples: [2 Games in 1: Sonic Advance & ChuChu Rocket!]) ] # Table: main.game_platform [ (id:INTEGER, Primary Key, Examples: [1, 2, 3]), (game_publisher_id:INT...
Show the name of the earliest platform in the database.
SELECT T2.platform_name FROM game_platform AS T1 INNER JOIN platform AS T2 ON T1.platform_id = T2.id ORDER BY T1.release_year ASC LIMIT 1
the earliest refers to min(release_year); name of platform refers to platform_name
video_games
CREATE TABLE genre ( id INTEGER not null primary key, genre_name TEXT default NULL ); CREATE TABLE game ( id INTEGER not null primary key, genre_id INTEGER default NULL, game_name TEXT default NULL, foreign key (genre_id) references genre(id) ); ...
【DB_ID】 video_games 【Schema】 # Table: main.game [ (id:INTEGER, Primary Key, Examples: [44, 45, 46]), (genre_id:INTEGER, Examples: [4, 5, 11]), (game_name:TEXT, Examples: [2 Games in 1: Sonic Advance & ChuChu Rocket!]) ] # Table: main.game_platform [ (id:INTEGER, Primary Key, Examples: [1, 2, 3]), (game_publisher_id:INT...
For all the games which were published by Namco Bandai Games, what percentage of them were adventure games?
SELECT CAST(COUNT(CASE WHEN T4.genre_name = 'Adventure' THEN T1.id ELSE NULL END) AS REAL) * 100 / COUNT(T1.id) 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 INNER JOIN genre AS T4 ON T1.genre_id = T4.id WHERE T3.publisher_name = 'Namco Banda...
published by Namco Bandai Games refers to publisher_name = 'Namco Bandai Games'; adventure game refers to genre_name = 'Adventure'; percentage = divide(sum(game_id where genre_name = 'Adventure'), count(game_id)) * 100% where publisher_name = 'Namco Bandai Games'
video_games
CREATE TABLE genre ( id INTEGER not null primary key, genre_name TEXT default NULL ); CREATE TABLE game ( id INTEGER not null primary key, genre_id INTEGER default NULL, game_name TEXT default NULL, foreign key (genre_id) references genre(id) ); ...
【DB_ID】 video_games 【Schema】 # Table: main.game [ (id:INTEGER, Primary Key, Examples: [44, 45, 46]), (genre_id:INTEGER, Examples: [4, 5, 11]), (game_name:TEXT, Examples: [2 Games in 1: Sonic Advance & ChuChu Rocket!]) ] # Table: main.game_platform [ (id:INTEGER, Primary Key, Examples: [1, 2, 3]), (game_publisher_id:INT...
How many times more is the number of games which were published by Atari than Athena?
SELECT CAST(COUNT(CASE WHEN T1.publisher_name = 'Atari' THEN T2.game_id ELSE NULL END) AS REAL) / COUNT(CASE WHEN T1.publisher_name = 'Athena' THEN T2.game_id ELSE NULL END) FROM publisher AS T1 INNER JOIN game_publisher AS T2 ON T1.id = T2.publisher_id
published by Atari refers to publisher_name = 'Atari'; published by  Athena refers to publisher_name = 'Athena'; times = divide(sum(publisher_id where publisher_name = 'Atari'), sum(publisher_id where publisher_name = 'Athena'))
video_games
CREATE TABLE genre ( id INTEGER not null primary key, genre_name TEXT default NULL ); CREATE TABLE game ( id INTEGER not null primary key, genre_id INTEGER default NULL, game_name TEXT default NULL, foreign key (genre_id) references genre(id) ); ...
【DB_ID】 video_games 【Schema】 # Table: main.game [ (id:INTEGER, Primary Key, Examples: [44, 45, 46]), (genre_id:INTEGER, Examples: [4, 5, 11]), (game_name:TEXT, Examples: [2 Games in 1: Sonic Advance & ChuChu Rocket!]) ] # Table: main.game_platform [ (id:INTEGER, Primary Key, Examples: [1, 2, 3]), (game_publisher_id:INT...
How many games did Electronic Arts publish?
SELECT COUNT(DISTINCT T2.game_id) FROM publisher AS T1 INNER JOIN game_publisher AS T2 ON T1.id = T2.publisher_id WHERE T1.publisher_name = 'Electronic Arts'
Electronic Arts refers to publisher_name = 'Electronic Arts'
video_games
CREATE TABLE genre ( id INTEGER not null primary key, genre_name TEXT default NULL ); CREATE TABLE game ( id INTEGER not null primary key, genre_id INTEGER default NULL, game_name TEXT default NULL, foreign key (genre_id) references genre(id) ); ...
【DB_ID】 video_games 【Schema】 # Table: main.game [ (id:INTEGER, Primary Key, Examples: [44, 45, 46]), (genre_id:INTEGER, Examples: [4, 5, 11]), (game_name:TEXT, Examples: [2 Games in 1: Sonic Advance & ChuChu Rocket!]) ] # Table: main.game_platform [ (id:INTEGER, Primary Key, Examples: [1, 2, 3]), (game_publisher_id:INT...
What is the genre of the Advent Rising game?
SELECT T2.genre_name FROM game AS T1 INNER JOIN genre AS T2 ON T1.genre_id = T2.id WHERE T1.game_name = 'Advent Rising'
genre refers to genre_name; Advent Rising game refers to game_name = 'Advent Rising'
video_games
CREATE TABLE genre ( id INTEGER not null primary key, genre_name TEXT default NULL ); CREATE TABLE game ( id INTEGER not null primary key, genre_id INTEGER default NULL, game_name TEXT default NULL, foreign key (genre_id) references genre(id) ); ...
【DB_ID】 video_games 【Schema】 # Table: main.game [ (id:INTEGER, Primary Key, Examples: [44, 45, 46]), (genre_id:INTEGER, Examples: [4, 5, 11]), (game_name:TEXT, Examples: [2 Games in 1: Sonic Advance & ChuChu Rocket!]) ] # Table: main.game_platform [ (id:INTEGER, Primary Key, Examples: [1, 2, 3]), (game_publisher_id:INT...
How many role-playing games did Microsoft Game Studios publish?
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 = 'Role-Playing' AND T1.publisher_name = 'Microsoft Game Studios'
role-playing game refers to genre_name = 'Role-Playing'; Microsoft Game Studios refers to publisher_name = 'Microsoft Game Studios'
video_games
CREATE TABLE genre ( id INTEGER not null primary key, genre_name TEXT default NULL ); CREATE TABLE game ( id INTEGER not null primary key, genre_id INTEGER default NULL, game_name TEXT default NULL, foreign key (genre_id) references genre(id) ); ...
【DB_ID】 video_games 【Schema】 # Table: main.game [ (id:INTEGER, Primary Key, Examples: [44, 45, 46]), (genre_id:INTEGER, Examples: [4, 5, 11]), (game_name:TEXT, Examples: [2 Games in 1: Sonic Advance & ChuChu Rocket!]) ] # Table: main.game_platform [ (id:INTEGER, Primary Key, Examples: [1, 2, 3]), (game_publisher_id:INT...
Which publisher published the most games?
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
publisher refers to publisher_name; the most games refers to max(count(publisher_id))
video_games
CREATE TABLE genre ( id INTEGER not null primary key, genre_name TEXT default NULL ); CREATE TABLE game ( id INTEGER not null primary key, genre_id INTEGER default NULL, game_name TEXT default NULL, foreign key (genre_id) references genre(id) ); ...
【DB_ID】 video_games 【Schema】 # Table: main.game [ (id:INTEGER, Primary Key, Examples: [44, 45, 46]), (genre_id:INTEGER, Examples: [4, 5, 11]), (game_name:TEXT, Examples: [2 Games in 1: Sonic Advance & ChuChu Rocket!]) ] # Table: main.game_platform [ (id:INTEGER, Primary Key, Examples: [1, 2, 3]), (game_publisher_id:INT...
In 2004, what are the names of the platforms where Codemasters publish its games?
SELECT T4.platform_name 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 INNER JOIN platform AS T4 ON T3.platform_id = T4.id WHERE T3.release_year = 2004 AND T1.publisher_name = 'Codemasters'
name of platform refers to platform_name; Codemasters refers to publisher_name = 'Codemasters'; in 2004 refers to release_year = 2004
video_games
CREATE TABLE genre ( id INTEGER not null primary key, genre_name TEXT default NULL ); CREATE TABLE game ( id INTEGER not null primary key, genre_id INTEGER default NULL, game_name TEXT default NULL, foreign key (genre_id) references genre(id) ); ...
【DB_ID】 video_games 【Schema】 # Table: main.game [ (id:INTEGER, Primary Key, Examples: [44, 45, 46]), (genre_id:INTEGER, Examples: [4, 5, 11]), (game_name:TEXT, Examples: [2 Games in 1: Sonic Advance & ChuChu Rocket!]) ] # Table: main.game_platform [ (id:INTEGER, Primary Key, Examples: [1, 2, 3]), (game_publisher_id:INT...
How many games were released on PS4 in 2014?
SELECT 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 = 'PS4' AND T2.release_year = 2014
on PS4 refers to platform_name = 'PS4'; in 2014 refers to release_year = 2014
video_games
CREATE TABLE genre ( id INTEGER not null primary key, genre_name TEXT default NULL ); CREATE TABLE game ( id INTEGER not null primary key, genre_id INTEGER default NULL, game_name TEXT default NULL, foreign key (genre_id) references genre(id) ); ...
【DB_ID】 video_games 【Schema】 # Table: main.game [ (id:INTEGER, Primary Key, Examples: [44, 45, 46]), (genre_id:INTEGER, Examples: [4, 5, 11]), (game_name:TEXT, Examples: [2 Games in 1: Sonic Advance & ChuChu Rocket!]) ] # Table: main.game_platform [ (id:INTEGER, Primary Key, Examples: [1, 2, 3]), (game_publisher_id:INT...
What are the names of the publishers who published the oldest games?
SELECT DISTINCT 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 ORDER BY T1.release_year LIMIT 1
name of publisher refers to publisher_name; the oldest game refers to min(release_year)
video_games
CREATE TABLE genre ( id INTEGER not null primary key, genre_name TEXT default NULL ); CREATE TABLE game ( id INTEGER not null primary key, genre_id INTEGER default NULL, game_name TEXT default NULL, foreign key (genre_id) references genre(id) ); ...
【DB_ID】 video_games 【Schema】 # Table: main.game [ (id:INTEGER, Primary Key, Examples: [44, 45, 46]), (genre_id:INTEGER, Examples: [4, 5, 11]), (game_name:TEXT, Examples: [2 Games in 1: Sonic Advance & ChuChu Rocket!]) ] # Table: main.game_platform [ (id:INTEGER, Primary Key, Examples: [1, 2, 3]), (game_publisher_id:INT...
How many publishers in Japan released a game on X360 in 2011?
SELECT COUNT(T3.game_publisher_id) 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 T4.platform_name = 'X360' AND T3.release_year = 2011 AND T1.region_name = 'Japan'
in Japan refers to region_name = 'Japan'; on X360 refers to platform_name = 'X360'; in 2011 refers to release_year = 2011
video_games
CREATE TABLE genre ( id INTEGER not null primary key, genre_name TEXT default NULL ); CREATE TABLE game ( id INTEGER not null primary key, genre_id INTEGER default NULL, game_name TEXT default NULL, foreign key (genre_id) references genre(id) ); ...
【DB_ID】 video_games 【Schema】 # Table: main.game [ (id:INTEGER, Primary Key, Examples: [44, 45, 46]), (genre_id:INTEGER, Examples: [4, 5, 11]), (game_name:TEXT, Examples: [2 Games in 1: Sonic Advance & ChuChu Rocket!]) ] # Table: main.game_platform [ (id:INTEGER, Primary Key, Examples: [1, 2, 3]), (game_publisher_id:INT...
Which game platform is the most popular in Europe?
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 LI...
game platform refers to game_platform_id; the most popular refers to max(num_sales); in Europe refers to region_name = 'Europe'
video_games
CREATE TABLE genre ( id INTEGER not null primary key, genre_name TEXT default NULL ); CREATE TABLE game ( id INTEGER not null primary key, genre_id INTEGER default NULL, game_name TEXT default NULL, foreign key (genre_id) references genre(id) ); ...
【DB_ID】 video_games 【Schema】 # Table: main.game [ (id:INTEGER, Primary Key, Examples: [44, 45, 46]), (genre_id:INTEGER, Examples: [4, 5, 11]), (game_name:TEXT, Examples: [2 Games in 1: Sonic Advance & ChuChu Rocket!]) ] # Table: main.game_platform [ (id:INTEGER, Primary Key, Examples: [1, 2, 3]), (game_publisher_id:INT...
Which year has the most number of PC games releases?
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 LIM...
year refers to release_year; the most number of releases refers to max(count(game_id))
video_games
CREATE TABLE genre ( id INTEGER not null primary key, genre_name TEXT default NULL ); CREATE TABLE game ( id INTEGER not null primary key, genre_id INTEGER default NULL, game_name TEXT default NULL, foreign key (genre_id) references genre(id) ); ...
【DB_ID】 video_games 【Schema】 # Table: main.game [ (id:INTEGER, Primary Key, Examples: [44, 45, 46]), (genre_id:INTEGER, Examples: [4, 5, 11]), (game_name:TEXT, Examples: [2 Games in 1: Sonic Advance & ChuChu Rocket!]) ] # Table: main.game_platform [ (id:INTEGER, Primary Key, Examples: [1, 2, 3]), (game_publisher_id:INT...
List the names of all the publishers who published one game only.
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
name of publisher refers to publisher_name; published one game only refers to count(publisher_id) = 1
video_games
CREATE TABLE genre ( id INTEGER not null primary key, genre_name TEXT default NULL ); CREATE TABLE game ( id INTEGER not null primary key, genre_id INTEGER default NULL, game_name TEXT default NULL, foreign key (genre_id) references genre(id) ); ...
【DB_ID】 video_games 【Schema】 # Table: main.game [ (id:INTEGER, Primary Key, Examples: [44, 45, 46]), (genre_id:INTEGER, Examples: [4, 5, 11]), (game_name:TEXT, Examples: [2 Games in 1: Sonic Advance & ChuChu Rocket!]) ] # Table: main.game_platform [ (id:INTEGER, Primary Key, Examples: [1, 2, 3]), (game_publisher_id:INT...
What are the names of the games that were published by 505 Games?
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'
name of game refers to game_name; published by 505 Games refers to publisher_name = '505 Games'
video_games
CREATE TABLE genre ( id INTEGER not null primary key, genre_name TEXT default NULL ); CREATE TABLE game ( id INTEGER not null primary key, genre_id INTEGER default NULL, game_name TEXT default NULL, foreign key (genre_id) references genre(id) ); ...
【DB_ID】 video_games 【Schema】 # Table: main.game [ (id:INTEGER, Primary Key, Examples: [44, 45, 46]), (genre_id:INTEGER, Examples: [4, 5, 11]), (game_name:TEXT, Examples: [2 Games in 1: Sonic Advance & ChuChu Rocket!]) ] # Table: main.game_platform [ (id:INTEGER, Primary Key, Examples: [1, 2, 3]), (game_publisher_id:INT...
What is the genre ID of the game named 25 to Life?
SELECT T.genre_id FROM game AS T WHERE T.game_name = '25 to Life'
the game named 25 to Life refers to game_name = '25 to Life'
video_games
CREATE TABLE genre ( id INTEGER not null primary key, genre_name TEXT default NULL ); CREATE TABLE game ( id INTEGER not null primary key, genre_id INTEGER default NULL, game_name TEXT default NULL, foreign key (genre_id) references genre(id) ); ...
【DB_ID】 video_games 【Schema】 # Table: main.game [ (id:INTEGER, Primary Key, Examples: [44, 45, 46]), (genre_id:INTEGER, Examples: [4, 5, 11]), (game_name:TEXT, Examples: [2 Games in 1: Sonic Advance & ChuChu Rocket!]) ] # Table: main.game_platform [ (id:INTEGER, Primary Key, Examples: [1, 2, 3]), (game_publisher_id:INT...
List down the game ID of games with genre ID 2.
SELECT T.id FROM game AS T WHERE T.genre_id = 2
game ID refers to game.id; genre ID 2 refers to genre_id = 2
video_games
CREATE TABLE genre ( id INTEGER not null primary key, genre_name TEXT default NULL ); CREATE TABLE game ( id INTEGER not null primary key, genre_id INTEGER default NULL, game_name TEXT default NULL, foreign key (genre_id) references genre(id) ); ...
【DB_ID】 video_games 【Schema】 # Table: main.game [ (id:INTEGER, Primary Key, Examples: [44, 45, 46]), (genre_id:INTEGER, Examples: [4, 5, 11]), (game_name:TEXT, Examples: [2 Games in 1: Sonic Advance & ChuChu Rocket!]) ] # Table: main.game_platform [ (id:INTEGER, Primary Key, Examples: [1, 2, 3]), (game_publisher_id:INT...
Provide the release year of record ID 1 to 10.
SELECT T.release_year FROM game_platform AS T WHERE T.id BETWEEN 1 AND 10
record ID 1 to 10 refers to game.id BETWEEN 1 AND 10
video_games
CREATE TABLE genre ( id INTEGER not null primary key, genre_name TEXT default NULL ); CREATE TABLE game ( id INTEGER not null primary key, genre_id INTEGER default NULL, game_name TEXT default NULL, foreign key (genre_id) references genre(id) ); ...
【DB_ID】 video_games 【Schema】 # Table: main.game [ (id:INTEGER, Primary Key, Examples: [44, 45, 46]), (genre_id:INTEGER, Examples: [4, 5, 11]), (game_name:TEXT, Examples: [2 Games in 1: Sonic Advance & ChuChu Rocket!]) ] # Table: main.game_platform [ (id:INTEGER, Primary Key, Examples: [1, 2, 3]), (game_publisher_id:INT...
Give the game publisher ID of records with platform ID 15.
SELECT T.game_publisher_id FROM game_platform AS T WHERE T.platform_id = 15
platform ID 15 refers to platform_id = 15
video_games
CREATE TABLE genre ( id INTEGER not null primary key, genre_name TEXT default NULL ); CREATE TABLE game ( id INTEGER not null primary key, genre_id INTEGER default NULL, game_name TEXT default NULL, foreign key (genre_id) references genre(id) ); ...
【DB_ID】 video_games 【Schema】 # Table: main.game [ (id:INTEGER, Primary Key, Examples: [44, 45, 46]), (genre_id:INTEGER, Examples: [4, 5, 11]), (game_name:TEXT, Examples: [2 Games in 1: Sonic Advance & ChuChu Rocket!]) ] # Table: main.game_platform [ (id:INTEGER, Primary Key, Examples: [1, 2, 3]), (game_publisher_id:INT...
List down the record ID of records released between 2000 to 2003.
SELECT T.id FROM game_platform AS T WHERE T.release_year BETWEEN 2000 AND 2003
record ID refers to game.id; released between 2000 to 2003 refers to release_year BETWEEN 2000 AND 2003
video_games
CREATE TABLE genre ( id INTEGER not null primary key, genre_name TEXT default NULL ); CREATE TABLE game ( id INTEGER not null primary key, genre_id INTEGER default NULL, game_name TEXT default NULL, foreign key (genre_id) references genre(id) ); ...
【DB_ID】 video_games 【Schema】 # Table: main.game [ (id:INTEGER, Primary Key, Examples: [44, 45, 46]), (genre_id:INTEGER, Examples: [4, 5, 11]), (game_name:TEXT, Examples: [2 Games in 1: Sonic Advance & ChuChu Rocket!]) ] # Table: main.game_platform [ (id:INTEGER, Primary Key, Examples: [1, 2, 3]), (game_publisher_id:INT...
What is the number of sales in region ID 2 with game platform ID 9615?
SELECT T.num_sales * 100000 FROM region_sales AS T WHERE T.region_id = 2 AND T.game_platform_id = 9615
number of sales refers to multiply(num_sales, 100000)
video_games
CREATE TABLE genre ( id INTEGER not null primary key, genre_name TEXT default NULL ); CREATE TABLE game ( id INTEGER not null primary key, genre_id INTEGER default NULL, game_name TEXT default NULL, foreign key (genre_id) references genre(id) ); ...
【DB_ID】 video_games 【Schema】 # Table: main.game [ (id:INTEGER, Primary Key, Examples: [44, 45, 46]), (genre_id:INTEGER, Examples: [4, 5, 11]), (game_name:TEXT, Examples: [2 Games in 1: Sonic Advance & ChuChu Rocket!]) ] # Table: main.game_platform [ (id:INTEGER, Primary Key, Examples: [1, 2, 3]), (game_publisher_id:INT...
List down the names of platform where the games released in 2016 can be played on.
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
name of platform refers to platform_name; released in 2016 refers to release_year = 2016
video_games
CREATE TABLE genre ( id INTEGER not null primary key, genre_name TEXT default NULL ); CREATE TABLE game ( id INTEGER not null primary key, genre_id INTEGER default NULL, game_name TEXT default NULL, foreign key (genre_id) references genre(id) ); ...
【DB_ID】 video_games 【Schema】 # Table: main.game [ (id:INTEGER, Primary Key, Examples: [44, 45, 46]), (genre_id:INTEGER, Examples: [4, 5, 11]), (game_name:TEXT, Examples: [2 Games in 1: Sonic Advance & ChuChu Rocket!]) ] # Table: main.game_platform [ (id:INTEGER, Primary Key, Examples: [1, 2, 3]), (game_publisher_id:INT...
When was the game titled 3DS Classic Collection released?
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'
when refers to release_year; the game titled 3DS Classic Collection refers to game_name = '3DS Classic Collection'
video_games
CREATE TABLE genre ( id INTEGER not null primary key, genre_name TEXT default NULL ); CREATE TABLE game ( id INTEGER not null primary key, genre_id INTEGER default NULL, game_name TEXT default NULL, foreign key (genre_id) references genre(id) ); ...
【DB_ID】 video_games 【Schema】 # Table: main.game [ (id:INTEGER, Primary Key, Examples: [44, 45, 46]), (genre_id:INTEGER, Examples: [4, 5, 11]), (game_name:TEXT, Examples: [2 Games in 1: Sonic Advance & ChuChu Rocket!]) ] # Table: main.game_platform [ (id:INTEGER, Primary Key, Examples: [1, 2, 3]), (game_publisher_id:INT...
What is the average number of sales in 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'
in Japan refers to region_name = 'Japan'; average number of sales = multiply(avg(num_sales), 100000) where region_name = 'Japan'
video_games
CREATE TABLE genre ( id INTEGER not null primary key, genre_name TEXT default NULL ); CREATE TABLE game ( id INTEGER not null primary key, genre_id INTEGER default NULL, game_name TEXT default NULL, foreign key (genre_id) references genre(id) ); ...
【DB_ID】 video_games 【Schema】 # Table: main.game [ (id:INTEGER, Primary Key, Examples: [44, 45, 46]), (genre_id:INTEGER, Examples: [4, 5, 11]), (game_name:TEXT, Examples: [2 Games in 1: Sonic Advance & ChuChu Rocket!]) ] # Table: main.game_platform [ (id:INTEGER, Primary Key, Examples: [1, 2, 3]), (game_publisher_id:INT...
Give the genre of the games released from 2000 to 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
genre refers to genre_name; released from 2000 to 2002 refers to release_year BETWEEN 2000 AND 2002
video_games
CREATE TABLE genre ( id INTEGER not null primary key, genre_name TEXT default NULL ); CREATE TABLE game ( id INTEGER not null primary key, genre_id INTEGER default NULL, game_name TEXT default NULL, foreign key (genre_id) references genre(id) ); ...
【DB_ID】 video_games 【Schema】 # Table: main.game [ (id:INTEGER, Primary Key, Examples: [44, 45, 46]), (genre_id:INTEGER, Examples: [4, 5, 11]), (game_name:TEXT, Examples: [2 Games in 1: Sonic Advance & ChuChu Rocket!]) ] # Table: main.game_platform [ (id:INTEGER, Primary Key, Examples: [1, 2, 3]), (game_publisher_id:INT...
List down the name of games published by 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'
name of game refers to game_name; published by 3DO refers to publisher_name = '3DO'
video_games
CREATE TABLE genre ( id INTEGER not null primary key, genre_name TEXT default NULL ); CREATE TABLE game ( id INTEGER not null primary key, genre_id INTEGER default NULL, game_name TEXT default NULL, foreign key (genre_id) references genre(id) ); ...
【DB_ID】 video_games 【Schema】 # Table: main.game [ (id:INTEGER, Primary Key, Examples: [44, 45, 46]), (genre_id:INTEGER, Examples: [4, 5, 11]), (game_name:TEXT, Examples: [2 Games in 1: Sonic Advance & ChuChu Rocket!]) ] # Table: main.game_platform [ (id:INTEGER, Primary Key, Examples: [1, 2, 3]), (game_publisher_id:INT...
How many role-playing games are there?
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'
role-playing game refers to genre_name = 'Role-Playing'
video_games
CREATE TABLE genre ( id INTEGER not null primary key, genre_name TEXT default NULL ); CREATE TABLE game ( id INTEGER not null primary key, genre_id INTEGER default NULL, game_name TEXT default NULL, foreign key (genre_id) references genre(id) ); ...
【DB_ID】 video_games 【Schema】 # Table: main.game [ (id:INTEGER, Primary Key, Examples: [44, 45, 46]), (genre_id:INTEGER, Examples: [4, 5, 11]), (game_name:TEXT, Examples: [2 Games in 1: Sonic Advance & ChuChu Rocket!]) ] # Table: main.game_platform [ (id:INTEGER, Primary Key, Examples: [1, 2, 3]), (game_publisher_id:INT...
List the region name where games reached 300000 sales and above.
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
reached 300000 sales and above refers to num_sales > 3
video_games
CREATE TABLE genre ( id INTEGER not null primary key, genre_name TEXT default NULL ); CREATE TABLE game ( id INTEGER not null primary key, genre_id INTEGER default NULL, game_name TEXT default NULL, foreign key (genre_id) references genre(id) ); ...
【DB_ID】 video_games 【Schema】 # Table: main.game [ (id:INTEGER, Primary Key, Examples: [44, 45, 46]), (genre_id:INTEGER, Examples: [4, 5, 11]), (game_name:TEXT, Examples: [2 Games in 1: Sonic Advance & ChuChu Rocket!]) ] # Table: main.game_platform [ (id:INTEGER, Primary Key, Examples: [1, 2, 3]), (game_publisher_id:INT...
Which company published the game with the most sales in 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.publi...
company refers to publisher_name; the most sales refers to max(num_sales); in North America refers to region_name = 'North America'
video_games
CREATE TABLE genre ( id INTEGER not null primary key, genre_name TEXT default NULL ); CREATE TABLE game ( id INTEGER not null primary key, genre_id INTEGER default NULL, game_name TEXT default NULL, foreign key (genre_id) references genre(id) ); ...
【DB_ID】 video_games 【Schema】 # Table: main.game [ (id:INTEGER, Primary Key, Examples: [44, 45, 46]), (genre_id:INTEGER, Examples: [4, 5, 11]), (game_name:TEXT, Examples: [2 Games in 1: Sonic Advance & ChuChu Rocket!]) ] # Table: main.game_platform [ (id:INTEGER, Primary Key, Examples: [1, 2, 3]), (game_publisher_id:INT...
What is the release year of the game that gained 350000 sales in 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'
gained 350000 sales refers to num_sales = 3.5; in North America refers to region_name = 'North America'
video_games
CREATE TABLE genre ( id INTEGER not null primary key, genre_name TEXT default NULL ); CREATE TABLE game ( id INTEGER not null primary key, genre_id INTEGER default NULL, game_name TEXT default NULL, foreign key (genre_id) references genre(id) ); ...
【DB_ID】 video_games 【Schema】 # Table: main.game [ (id:INTEGER, Primary Key, Examples: [44, 45, 46]), (genre_id:INTEGER, Examples: [4, 5, 11]), (game_name:TEXT, Examples: [2 Games in 1: Sonic Advance & ChuChu Rocket!]) ] # Table: main.game_platform [ (id:INTEGER, Primary Key, Examples: [1, 2, 3]), (game_publisher_id:INT...
In which platform does the game titled 15 Days available?
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'
platform refers to platform_name; the game titled 15 Days refers to game_name = '15 Days'
video_games
CREATE TABLE genre ( id INTEGER not null primary key, genre_name TEXT default NULL ); CREATE TABLE game ( id INTEGER not null primary key, genre_id INTEGER default NULL, game_name TEXT default NULL, foreign key (genre_id) references genre(id) ); ...
【DB_ID】 video_games 【Schema】 # Table: main.game [ (id:INTEGER, Primary Key, Examples: [44, 45, 46]), (genre_id:INTEGER, Examples: [4, 5, 11]), (game_name:TEXT, Examples: [2 Games in 1: Sonic Advance & ChuChu Rocket!]) ] # Table: main.game_platform [ (id:INTEGER, Primary Key, Examples: [1, 2, 3]), (game_publisher_id:INT...
Give the name of the publisher of the 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
name of publisher refers to publisher_name; the game ID 75 refers to game_id = 75
video_games
CREATE TABLE genre ( id INTEGER not null primary key, genre_name TEXT default NULL ); CREATE TABLE game ( id INTEGER not null primary key, genre_id INTEGER default NULL, game_name TEXT default NULL, foreign key (genre_id) references genre(id) ); ...
【DB_ID】 video_games 【Schema】 # Table: main.game [ (id:INTEGER, Primary Key, Examples: [44, 45, 46]), (genre_id:INTEGER, Examples: [4, 5, 11]), (game_name:TEXT, Examples: [2 Games in 1: Sonic Advance & ChuChu Rocket!]) ] # Table: main.game_platform [ (id:INTEGER, Primary Key, Examples: [1, 2, 3]), (game_publisher_id:INT...
What is the title of the game that gained the most sales in 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' O...
title of the game refers to game_name; gained the most sales refers to max(num_sales); in Japan refers to region_name = 'Japan'
video_games
CREATE TABLE genre ( id INTEGER not null primary key, genre_name TEXT default NULL ); CREATE TABLE game ( id INTEGER not null primary key, genre_id INTEGER default NULL, game_name TEXT default NULL, foreign key (genre_id) references genre(id) ); ...
【DB_ID】 video_games 【Schema】 # Table: main.game [ (id:INTEGER, Primary Key, Examples: [44, 45, 46]), (genre_id:INTEGER, Examples: [4, 5, 11]), (game_name:TEXT, Examples: [2 Games in 1: Sonic Advance & ChuChu Rocket!]) ] # Table: main.game_platform [ (id:INTEGER, Primary Key, Examples: [1, 2, 3]), (game_publisher_id:INT...
Provide the game publisher's name of the game with sales greater than 90% of the average sales in 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 > ( ...
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'
video_games
CREATE TABLE genre ( id INTEGER not null primary key, genre_name TEXT default NULL ); CREATE TABLE game ( id INTEGER not null primary key, genre_id INTEGER default NULL, game_name TEXT default NULL, foreign key (genre_id) references genre(id) ); ...
【DB_ID】 video_games 【Schema】 # Table: main.game [ (id:INTEGER, Primary Key, Examples: [44, 45, 46]), (genre_id:INTEGER, Examples: [4, 5, 11]), (game_name:TEXT, Examples: [2 Games in 1: Sonic Advance & ChuChu Rocket!]) ] # Table: main.game_platform [ (id:INTEGER, Primary Key, Examples: [1, 2, 3]), (game_publisher_id:INT...
Among the games released in 2004, what is the percentage of games on PSP?
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
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
video_games
CREATE TABLE genre ( id INTEGER not null primary key, genre_name TEXT default NULL ); CREATE TABLE game ( id INTEGER not null primary key, genre_id INTEGER default NULL, game_name TEXT default NULL, foreign key (genre_id) references genre(id) ); ...
【DB_ID】 video_games 【Schema】 # Table: main.game [ (id:INTEGER, Primary Key, Examples: [44, 45, 46]), (genre_id:INTEGER, Examples: [4, 5, 11]), (game_name:TEXT, Examples: [2 Games in 1: Sonic Advance & ChuChu Rocket!]) ] # Table: main.game_platform [ (id:INTEGER, Primary Key, Examples: [1, 2, 3]), (game_publisher_id:INT...
How many games were released in 1981?
SELECT COUNT(T.id) FROM game_platform AS T WHERE T.release_year = 1981
released in 1981 refers to release_year = 1981
video_games
CREATE TABLE genre ( id INTEGER not null primary key, genre_name TEXT default NULL ); CREATE TABLE game ( id INTEGER not null primary key, genre_id INTEGER default NULL, game_name TEXT default NULL, foreign key (genre_id) references genre(id) ); ...
【DB_ID】 video_games 【Schema】 # Table: main.game [ (id:INTEGER, Primary Key, Examples: [44, 45, 46]), (genre_id:INTEGER, Examples: [4, 5, 11]), (game_name:TEXT, Examples: [2 Games in 1: Sonic Advance & ChuChu Rocket!]) ] # Table: main.game_platform [ (id:INTEGER, Primary Key, Examples: [1, 2, 3]), (game_publisher_id:INT...
What is the genre ID of the '2Xtreme' game?
SELECT T.genre_id FROM game AS T WHERE T.game_name = '2Xtreme'
the '2Xtreme' game refers to game_name = '2Xtreme'
video_games
CREATE TABLE genre ( id INTEGER not null primary key, genre_name TEXT default NULL ); CREATE TABLE game ( id INTEGER not null primary key, genre_id INTEGER default NULL, game_name TEXT default NULL, foreign key (genre_id) references genre(id) ); ...
【DB_ID】 video_games 【Schema】 # Table: main.game [ (id:INTEGER, Primary Key, Examples: [44, 45, 46]), (genre_id:INTEGER, Examples: [4, 5, 11]), (game_name:TEXT, Examples: [2 Games in 1: Sonic Advance & ChuChu Rocket!]) ] # Table: main.game_platform [ (id:INTEGER, Primary Key, Examples: [1, 2, 3]), (game_publisher_id:INT...
Sum the total game sales in every region for platform ID 9658.
SELECT SUM(T.num_sales) * 100000 FROM region_sales AS T WHERE T.game_platform_id = 9658
total game sales refers to multiply(sum(num_sales), 100000); platform ID 9658 refers to game_platform_id = 9658
video_games
CREATE TABLE genre ( id INTEGER not null primary key, genre_name TEXT default NULL ); CREATE TABLE game ( id INTEGER not null primary key, genre_id INTEGER default NULL, game_name TEXT default NULL, foreign key (genre_id) references genre(id) ); ...
【DB_ID】 video_games 【Schema】 # Table: main.game [ (id:INTEGER, Primary Key, Examples: [44, 45, 46]), (genre_id:INTEGER, Examples: [4, 5, 11]), (game_name:TEXT, Examples: [2 Games in 1: Sonic Advance & ChuChu Rocket!]) ] # Table: main.game_platform [ (id:INTEGER, Primary Key, Examples: [1, 2, 3]), (game_publisher_id:INT...
Provide the ID of 1C Company.
SELECT T.id FROM publisher AS T WHERE T.publisher_name = '1C Company'
ID refers to publisher.id; 1C Company refers to publisher_name = '1C Company'
video_games
CREATE TABLE genre ( id INTEGER not null primary key, genre_name TEXT default NULL ); CREATE TABLE game ( id INTEGER not null primary key, genre_id INTEGER default NULL, game_name TEXT default NULL, foreign key (genre_id) references genre(id) ); ...
【DB_ID】 video_games 【Schema】 # Table: main.game [ (id:INTEGER, Primary Key, Examples: [44, 45, 46]), (genre_id:INTEGER, Examples: [4, 5, 11]), (game_name:TEXT, Examples: [2 Games in 1: Sonic Advance & ChuChu Rocket!]) ] # Table: main.game_platform [ (id:INTEGER, Primary Key, Examples: [1, 2, 3]), (game_publisher_id:INT...
Provide the genre name of the genre ID 3.
SELECT T.genre_name FROM genre AS T WHERE T.id = 3
genre ID 3 refers to genre.id = 3
video_games
CREATE TABLE genre ( id INTEGER not null primary key, genre_name TEXT default NULL ); CREATE TABLE game ( id INTEGER not null primary key, genre_id INTEGER default NULL, game_name TEXT default NULL, foreign key (genre_id) references genre(id) ); ...
【DB_ID】 video_games 【Schema】 # Table: main.game [ (id:INTEGER, Primary Key, Examples: [44, 45, 46]), (genre_id:INTEGER, Examples: [4, 5, 11]), (game_name:TEXT, Examples: [2 Games in 1: Sonic Advance & ChuChu Rocket!]) ] # Table: main.game_platform [ (id:INTEGER, Primary Key, Examples: [1, 2, 3]), (game_publisher_id:INT...
List the game IDs that were released in 2017.
SELECT T.id FROM game_platform AS T WHERE T.release_year = 2017
game ID refers to game.id; released in 2017 refers to release_year = 2017
video_games
CREATE TABLE genre ( id INTEGER not null primary key, genre_name TEXT default NULL ); CREATE TABLE game ( id INTEGER not null primary key, genre_id INTEGER default NULL, game_name TEXT default NULL, foreign key (genre_id) references genre(id) ); ...
【DB_ID】 video_games 【Schema】 # Table: main.game [ (id:INTEGER, Primary Key, Examples: [44, 45, 46]), (genre_id:INTEGER, Examples: [4, 5, 11]), (game_name:TEXT, Examples: [2 Games in 1: Sonic Advance & ChuChu Rocket!]) ] # Table: main.game_platform [ (id:INTEGER, Primary Key, Examples: [1, 2, 3]), (game_publisher_id:INT...
When was the "Adventure Island" game released?
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'
when refers to release_year; the "Adventure Island" game refers to game_name = 'Adventure Island'
video_games
CREATE TABLE genre ( id INTEGER not null primary key, genre_name TEXT default NULL ); CREATE TABLE game ( id INTEGER not null primary key, genre_id INTEGER default NULL, game_name TEXT default NULL, foreign key (genre_id) references genre(id) ); ...
【DB_ID】 video_games 【Schema】 # Table: main.game [ (id:INTEGER, Primary Key, Examples: [44, 45, 46]), (genre_id:INTEGER, Examples: [4, 5, 11]), (game_name:TEXT, Examples: [2 Games in 1: Sonic Advance & ChuChu Rocket!]) ] # Table: main.game_platform [ (id:INTEGER, Primary Key, Examples: [1, 2, 3]), (game_publisher_id:INT...
How many games are puzzle genre?
SELECT COUNT(T1.id) FROM game AS T1 INNER JOIN genre AS T2 ON T1.genre_id = T2.id WHERE T2.genre_name = 'Puzzle'
puzzle genre refers to genre_name = 'Puzzle'
video_games
CREATE TABLE genre ( id INTEGER not null primary key, genre_name TEXT default NULL ); CREATE TABLE game ( id INTEGER not null primary key, genre_id INTEGER default NULL, game_name TEXT default NULL, foreign key (genre_id) references genre(id) ); ...
【DB_ID】 video_games 【Schema】 # Table: main.game [ (id:INTEGER, Primary Key, Examples: [44, 45, 46]), (genre_id:INTEGER, Examples: [4, 5, 11]), (game_name:TEXT, Examples: [2 Games in 1: Sonic Advance & ChuChu Rocket!]) ] # Table: main.game_platform [ (id:INTEGER, Primary Key, Examples: [1, 2, 3]), (game_publisher_id:INT...
Provide the games that can be played on the SCD platform.
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'
game refers to game_name; on the SCD platform refers to platform_name = 'SCD'
video_games
CREATE TABLE genre ( id INTEGER not null primary key, genre_name TEXT default NULL ); CREATE TABLE game ( id INTEGER not null primary key, genre_id INTEGER default NULL, game_name TEXT default NULL, foreign key (genre_id) references genre(id) ); ...
【DB_ID】 video_games 【Schema】 # Table: main.game [ (id:INTEGER, Primary Key, Examples: [44, 45, 46]), (genre_id:INTEGER, Examples: [4, 5, 11]), (game_name:TEXT, Examples: [2 Games in 1: Sonic Advance & ChuChu Rocket!]) ] # Table: main.game_platform [ (id:INTEGER, Primary Key, Examples: [1, 2, 3]), (game_publisher_id:INT...
How many games were published by 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'
published by Acclaim Entertainment refers to publisher_name = 'Acclaim Entertainment'
video_games
CREATE TABLE genre ( id INTEGER not null primary key, genre_name TEXT default NULL ); CREATE TABLE game ( id INTEGER not null primary key, genre_id INTEGER default NULL, game_name TEXT default NULL, foreign key (genre_id) references genre(id) ); ...
【DB_ID】 video_games 【Schema】 # Table: main.game [ (id:INTEGER, Primary Key, Examples: [44, 45, 46]), (genre_id:INTEGER, Examples: [4, 5, 11]), (game_name:TEXT, Examples: [2 Games in 1: Sonic Advance & ChuChu Rocket!]) ] # Table: main.game_platform [ (id:INTEGER, Primary Key, Examples: [1, 2, 3]), (game_publisher_id:INT...
Name the publisher of the Chronicles of the Sword game.
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'
publisher refers to publisher_name; the Chronicles of the Sword game refers to game_name = 'Chronicles of the Sword'
video_games
CREATE TABLE genre ( id INTEGER not null primary key, genre_name TEXT default NULL ); CREATE TABLE game ( id INTEGER not null primary key, genre_id INTEGER default NULL, game_name TEXT default NULL, foreign key (genre_id) references genre(id) ); ...
【DB_ID】 video_games 【Schema】 # Table: main.game [ (id:INTEGER, Primary Key, Examples: [44, 45, 46]), (genre_id:INTEGER, Examples: [4, 5, 11]), (game_name:TEXT, Examples: [2 Games in 1: Sonic Advance & ChuChu Rocket!]) ] # Table: main.game_platform [ (id:INTEGER, Primary Key, Examples: [1, 2, 3]), (game_publisher_id:INT...
Provide the number of games sold in North America on the PS4 platform.
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'
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'
video_games
CREATE TABLE genre ( id INTEGER not null primary key, genre_name TEXT default NULL ); CREATE TABLE game ( id INTEGER not null primary key, genre_id INTEGER default NULL, game_name TEXT default NULL, foreign key (genre_id) references genre(id) ); ...
【DB_ID】 video_games 【Schema】 # Table: main.game [ (id:INTEGER, Primary Key, Examples: [44, 45, 46]), (genre_id:INTEGER, Examples: [4, 5, 11]), (game_name:TEXT, Examples: [2 Games in 1: Sonic Advance & ChuChu Rocket!]) ] # Table: main.game_platform [ (id:INTEGER, Primary Key, Examples: [1, 2, 3]), (game_publisher_id:INT...
Provide the ID of the most popular platform in 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
ID refers to game_platform_id; the most popular refers to max(num_sales); in Europe refers to region_name = 'Europe'
video_games
CREATE TABLE genre ( id INTEGER not null primary key, genre_name TEXT default NULL ); CREATE TABLE game ( id INTEGER not null primary key, genre_id INTEGER default NULL, game_name TEXT default NULL, foreign key (genre_id) references genre(id) ); ...
【DB_ID】 video_games 【Schema】 # Table: main.game [ (id:INTEGER, Primary Key, Examples: [44, 45, 46]), (genre_id:INTEGER, Examples: [4, 5, 11]), (game_name:TEXT, Examples: [2 Games in 1: Sonic Advance & ChuChu Rocket!]) ] # Table: main.game_platform [ (id:INTEGER, Primary Key, Examples: [1, 2, 3]), (game_publisher_id:INT...
Name the game released in 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
game refers to game_name; released in 2011 refers to release_year = 2011
video_games
CREATE TABLE genre ( id INTEGER not null primary key, genre_name TEXT default NULL ); CREATE TABLE game ( id INTEGER not null primary key, genre_id INTEGER default NULL, game_name TEXT default NULL, foreign key (genre_id) references genre(id) ); ...
【DB_ID】 video_games 【Schema】 # Table: main.game [ (id:INTEGER, Primary Key, Examples: [44, 45, 46]), (genre_id:INTEGER, Examples: [4, 5, 11]), (game_name:TEXT, Examples: [2 Games in 1: Sonic Advance & ChuChu Rocket!]) ] # Table: main.game_platform [ (id:INTEGER, Primary Key, Examples: [1, 2, 3]), (game_publisher_id:INT...
How many games can be played on the Wii platform?
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'
on the Wii platform refers to platform_name = 'Wii'
video_games
CREATE TABLE genre ( id INTEGER not null primary key, genre_name TEXT default NULL ); CREATE TABLE game ( id INTEGER not null primary key, genre_id INTEGER default NULL, game_name TEXT default NULL, foreign key (genre_id) references genre(id) ); ...
【DB_ID】 video_games 【Schema】 # Table: main.game [ (id:INTEGER, Primary Key, Examples: [44, 45, 46]), (genre_id:INTEGER, Examples: [4, 5, 11]), (game_name:TEXT, Examples: [2 Games in 1: Sonic Advance & ChuChu Rocket!]) ] # Table: main.game_platform [ (id:INTEGER, Primary Key, Examples: [1, 2, 3]), (game_publisher_id:INT...
Provide any five games and release year under the sports genre.
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
game refers to game_name; under the sports genre refers to genre_name = 'Sports'
video_games
CREATE TABLE genre ( id INTEGER not null primary key, genre_name TEXT default NULL ); CREATE TABLE game ( id INTEGER not null primary key, genre_id INTEGER default NULL, game_name TEXT default NULL, foreign key (genre_id) references genre(id) ); ...
【DB_ID】 video_games 【Schema】 # Table: main.game [ (id:INTEGER, Primary Key, Examples: [44, 45, 46]), (genre_id:INTEGER, Examples: [4, 5, 11]), (game_name:TEXT, Examples: [2 Games in 1: Sonic Advance & ChuChu Rocket!]) ] # Table: main.game_platform [ (id:INTEGER, Primary Key, Examples: [1, 2, 3]), (game_publisher_id:INT...
Mention the genre of the 2Xtreme.
SELECT T2.id FROM game AS T1 INNER JOIN genre AS T2 ON T1.genre_id = T2.id WHERE T1.game_name = '2Xtreme'
genre refers to genre_name; the 2Xtreme game refers to game_name = '2Xtreme'
video_games
CREATE TABLE genre ( id INTEGER not null primary key, genre_name TEXT default NULL ); CREATE TABLE game ( id INTEGER not null primary key, genre_id INTEGER default NULL, game_name TEXT default NULL, foreign key (genre_id) references genre(id) ); ...
【DB_ID】 video_games 【Schema】 # Table: main.game [ (id:INTEGER, Primary Key, Examples: [44, 45, 46]), (genre_id:INTEGER, Examples: [4, 5, 11]), (game_name:TEXT, Examples: [2 Games in 1: Sonic Advance & ChuChu Rocket!]) ] # Table: main.game_platform [ (id:INTEGER, Primary Key, Examples: [1, 2, 3]), (game_publisher_id:INT...
Provide the platform where the Panzer Tactics can be played.
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'
platform refers to platform_name; the Panzer Tactics is a game name.
video_games
CREATE TABLE genre ( id INTEGER not null primary key, genre_name TEXT default NULL ); CREATE TABLE game ( id INTEGER not null primary key, genre_id INTEGER default NULL, game_name TEXT default NULL, foreign key (genre_id) references genre(id) ); ...
【DB_ID】 video_games 【Schema】 # Table: main.game [ (id:INTEGER, Primary Key, Examples: [44, 45, 46]), (genre_id:INTEGER, Examples: [4, 5, 11]), (game_name:TEXT, Examples: [2 Games in 1: Sonic Advance & ChuChu Rocket!]) ] # Table: main.game_platform [ (id:INTEGER, Primary Key, Examples: [1, 2, 3]), (game_publisher_id:INT...
Calculate how many percent of sales in North America is higher than the average sale per region for platform ID 9577.
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
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%
video_games
CREATE TABLE genre ( id INTEGER not null primary key, genre_name TEXT default NULL ); CREATE TABLE game ( id INTEGER not null primary key, genre_id INTEGER default NULL, game_name TEXT default NULL, foreign key (genre_id) references genre(id) ); ...
【DB_ID】 video_games 【Schema】 # Table: main.game [ (id:INTEGER, Primary Key, Examples: [44, 45, 46]), (genre_id:INTEGER, Examples: [4, 5, 11]), (game_name:TEXT, Examples: [2 Games in 1: Sonic Advance & ChuChu Rocket!]) ] # Table: main.game_platform [ (id:INTEGER, Primary Key, Examples: [1, 2, 3]), (game_publisher_id:INT...
Which game has the longest name?
SELECT T.game_name FROM game AS T ORDER BY LENGTH(T.game_name) DESC LIMIT 1
game refers to game_name; the longest name refers to max(length(game_name))
video_games
CREATE TABLE genre ( id INTEGER not null primary key, genre_name TEXT default NULL ); CREATE TABLE game ( id INTEGER not null primary key, genre_id INTEGER default NULL, game_name TEXT default NULL, foreign key (genre_id) references genre(id) ); ...
【DB_ID】 video_games 【Schema】 # Table: main.game [ (id:INTEGER, Primary Key, Examples: [44, 45, 46]), (genre_id:INTEGER, Examples: [4, 5, 11]), (game_name:TEXT, Examples: [2 Games in 1: Sonic Advance & ChuChu Rocket!]) ] # Table: main.game_platform [ (id:INTEGER, Primary Key, Examples: [1, 2, 3]), (game_publisher_id:INT...
How many games were released in 2001?
SELECT COUNT(T.id) FROM game_platform AS T WHERE T.release_year = 2001
released in 2001 refers to release_year = 2001
video_games
CREATE TABLE genre ( id INTEGER not null primary key, genre_name TEXT default NULL ); CREATE TABLE game ( id INTEGER not null primary key, genre_id INTEGER default NULL, game_name TEXT default NULL, foreign key (genre_id) references genre(id) ); ...
【DB_ID】 video_games 【Schema】 # Table: main.game [ (id:INTEGER, Primary Key, Examples: [44, 45, 46]), (genre_id:INTEGER, Examples: [4, 5, 11]), (game_name:TEXT, Examples: [2 Games in 1: Sonic Advance & ChuChu Rocket!]) ] # Table: main.game_platform [ (id:INTEGER, Primary Key, Examples: [1, 2, 3]), (game_publisher_id:INT...
What is the total number of sales across all regions?
SELECT SUM(T.num_sales) * 100000 FROM region_sales t
total number of sales = sum(num_sales)
video_games
CREATE TABLE genre ( id INTEGER not null primary key, genre_name TEXT default NULL ); CREATE TABLE game ( id INTEGER not null primary key, genre_id INTEGER default NULL, game_name TEXT default NULL, foreign key (genre_id) references genre(id) ); ...
【DB_ID】 video_games 【Schema】 # Table: main.game [ (id:INTEGER, Primary Key, Examples: [44, 45, 46]), (genre_id:INTEGER, Examples: [4, 5, 11]), (game_name:TEXT, Examples: [2 Games in 1: Sonic Advance & ChuChu Rocket!]) ] # Table: main.game_platform [ (id:INTEGER, Primary Key, Examples: [1, 2, 3]), (game_publisher_id:INT...
What is the average number of games published by a publisher?
SELECT CAST(COUNT(T.game_id) AS REAL) / COUNT(DISTINCT T.publisher_id) FROM game_publisher AS T
average number = divide(count(game_id), count(publisher_id))
video_games
CREATE TABLE genre ( id INTEGER not null primary key, genre_name TEXT default NULL ); CREATE TABLE game ( id INTEGER not null primary key, genre_id INTEGER default NULL, game_name TEXT default NULL, foreign key (genre_id) references genre(id) ); ...
【DB_ID】 video_games 【Schema】 # Table: main.game [ (id:INTEGER, Primary Key, Examples: [44, 45, 46]), (genre_id:INTEGER, Examples: [4, 5, 11]), (game_name:TEXT, Examples: [2 Games in 1: Sonic Advance & ChuChu Rocket!]) ] # Table: main.game_platform [ (id:INTEGER, Primary Key, Examples: [1, 2, 3]), (game_publisher_id:INT...
What is the first year a game is released?
SELECT MIN(T.release_year) FROM game_platform t
the first year refers to min(release_year)
video_games
CREATE TABLE genre ( id INTEGER not null primary key, genre_name TEXT default NULL ); CREATE TABLE game ( id INTEGER not null primary key, genre_id INTEGER default NULL, game_name TEXT default NULL, foreign key (genre_id) references genre(id) ); ...
【DB_ID】 video_games 【Schema】 # Table: main.game [ (id:INTEGER, Primary Key, Examples: [44, 45, 46]), (genre_id:INTEGER, Examples: [4, 5, 11]), (game_name:TEXT, Examples: [2 Games in 1: Sonic Advance & ChuChu Rocket!]) ] # Table: main.game_platform [ (id:INTEGER, Primary Key, Examples: [1, 2, 3]), (game_publisher_id:INT...
What is the least common game genre?
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
the least common game genre refers to min(count(genre_id)); genre refers to genre_name