input
stringlengths
122
2.7k
output
stringlengths
24
805
[INST] Here is a database schema: essays : projectid [ TEXT ] teacher_acctid [ TEXT ] title [ TEXT ] short_description [ TEXT ] need_statement [ TEXT ] essay [ TEXT ] projects : projectid [ TEXT ] primary_key teacher_acctid [ TEXT ] schoolid [ TEXT ] school_ncesid [ TEXT ] school_latitude [ REAL ] school_longitude [ RE...
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';
[INST] Here is a database schema: projects : projectid [ TEXT ] primary_key teacher_acctid [ TEXT ] schoolid [ TEXT ] school_ncesid [ TEXT ] school_latitude [ REAL ] school_longitude [ REAL ] school_city [ TEXT ] school_state [ TEXT ] school_zip [ INTEGER ] school_metro [ TEXT ] school_district [ TEXT ] school_county [...
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';
[INST] Here is a database schema: essays : projectid [ TEXT ] teacher_acctid [ TEXT ] title [ TEXT ] short_description [ TEXT ] need_statement [ TEXT ] essay [ TEXT ] resources : resourceid [ TEXT ] primary_key projectid [ TEXT ] resources.projectid = projects.projectid vendorid [ INTEGER ] vendor_name [ TEXT ] project...
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;
[INST] Here is a database schema: essays : projectid [ TEXT ] teacher_acctid [ TEXT ] title [ TEXT ] short_description [ TEXT ] need_statement [ TEXT ] essay [ TEXT ] projects : projectid [ TEXT ] primary_key teacher_acctid [ TEXT ] schoolid [ TEXT ] school_ncesid [ TEXT ] school_latitude [ REAL ] school_longitude [ RE...
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';
[INST] Here is a database schema: projects : projectid [ TEXT ] primary_key teacher_acctid [ TEXT ] schoolid [ TEXT ] school_ncesid [ TEXT ] school_latitude [ REAL ] school_longitude [ REAL ] school_city [ TEXT ] school_state [ TEXT ] school_zip [ INTEGER ] school_metro [ TEXT ] school_district [ TEXT ] school_county [...
SELECT SUM(T2.students_reached) FROM donations AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T1.donor_zip = 22205;
[INST] Here is a database schema: projects : projectid [ TEXT ] primary_key teacher_acctid [ TEXT ] schoolid [ TEXT ] school_ncesid [ TEXT ] school_latitude [ REAL ] school_longitude [ REAL ] school_city [ TEXT ] school_state [ TEXT ] school_zip [ INTEGER ] school_metro [ TEXT ] school_district [ TEXT ] school_county [...
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...
[INST] Here is a database schema: projects : projectid [ TEXT ] primary_key teacher_acctid [ TEXT ] schoolid [ TEXT ] school_ncesid [ TEXT ] school_latitude [ REAL ] school_longitude [ REAL ] school_city [ TEXT ] school_state [ TEXT ] school_zip [ INTEGER ] school_metro [ TEXT ] school_district [ TEXT ] school_county [...
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...
[INST] Here is a database schema: region_sales : region_id [ INTEGER ] region_sales.region_id = region.id game_platform_id [ INTEGER ] region_sales.game_platform_id = game_platform.id num_sales [ REAL ] Please write me a SQL statement that answers the following question: How many more games were sold on game platform ...
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;
[INST] Here is a database schema: game : id [ INTEGER ] primary_key genre_id [ INTEGER ] game.genre_id = genre.id game_name [ TEXT ] Please write me a SQL statement that answers the following question: Please list all the games that have the same game genre as 3D Lemmings. [/INST] [/INST]
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' );
[INST] Here is a database schema: genre : id [ INTEGER ] primary_key genre_name [ TEXT ] game : id [ INTEGER ] primary_key genre_id [ INTEGER ] game.genre_id = genre.id game_name [ TEXT ] Please write me a SQL statement that answers the following question: How many action games are there in total? [/INST] [/INST]
SELECT COUNT(T1.id) FROM game AS T1 INNER JOIN genre AS T2 ON T1.genre_id = T2.id WHERE T2.genre_name = 'Action';
[INST] Here is a database schema: genre : id [ INTEGER ] primary_key genre_name [ TEXT ] game : id [ INTEGER ] primary_key genre_id [ INTEGER ] game.genre_id = genre.id game_name [ TEXT ] Please write me a SQL statement that answers the following question: What is the genre of 3D Lemmings? [/INST] [/INST]
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';
[INST] Here is a database schema: game : id [ INTEGER ] primary_key genre_id [ INTEGER ] game.genre_id = genre.id game_name [ TEXT ] publisher : id [ INTEGER ] primary_key publisher_name [ TEXT ] game_publisher : id [ INTEGER ] primary_key game_id [ INTEGER ] game_publisher.game_id = game.id publisher_id [ INTEGER ] ga...
SELECT T3.publisher_name FROM game AS T1 INNER JOIN game_publisher AS T2 ON T1.id = T2.game_id INNER JOIN publisher AS T3 ON T2.publisher_id = T3.id WHERE T1.game_name = '3D Lemmings';
[INST] Here is a database schema: game : id [ INTEGER ] primary_key genre_id [ INTEGER ] game.genre_id = genre.id game_name [ TEXT ] publisher : id [ INTEGER ] primary_key publisher_name [ TEXT ] game_publisher : id [ INTEGER ] primary_key game_id [ INTEGER ] game_publisher.game_id = game.id publisher_id [ INTEGER ] ga...
SELECT T1.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';
[INST] Here is a database schema: genre : id [ INTEGER ] primary_key genre_name [ TEXT ] game : id [ INTEGER ] primary_key genre_id [ INTEGER ] game.genre_id = genre.id game_name [ TEXT ] publisher : id [ INTEGER ] primary_key publisher_name [ TEXT ] game_publisher : id [ INTEGER ] primary_key game_id [ INTEGER ] game_...
SELECT COUNT(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';
[INST] Here is a database schema: genre : id [ INTEGER ] primary_key genre_name [ TEXT ] game : id [ INTEGER ] primary_key genre_id [ INTEGER ] game.genre_id = genre.id game_name [ TEXT ] publisher : id [ INTEGER ] primary_key publisher_name [ TEXT ] game_publisher : id [ INTEGER ] primary_key game_id [ INTEGER ] game_...
SELECT 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';
[INST] Here is a database schema: publisher : id [ INTEGER ] primary_key publisher_name [ TEXT ] game_publisher : id [ INTEGER ] primary_key game_id [ INTEGER ] game_publisher.game_id = game.id publisher_id [ INTEGER ] game_publisher.publisher_id = publisher.id Please write me a SQL statement that answers the followin...
SELECT T.publisher_name FROM ( SELECT T2.publisher_name, COUNT(DISTINCT 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;
[INST] Here is a database schema: game : id [ INTEGER ] primary_key genre_id [ INTEGER ] game.genre_id = genre.id game_name [ TEXT ] platform : id [ INTEGER ] primary_key platform_name [ TEXT ] publisher : id [ INTEGER ] primary_key publisher_name [ TEXT ] game_publisher : id [ INTEGER ] primary_key game_id [ INTEGER ]...
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...
[INST] Here is a database schema: game : id [ INTEGER ] primary_key genre_id [ INTEGER ] game.genre_id = genre.id game_name [ TEXT ] platform : id [ INTEGER ] primary_key platform_name [ TEXT ] publisher : id [ INTEGER ] primary_key publisher_name [ TEXT ] game_publisher : id [ INTEGER ] primary_key game_id [ INTEGER ]...
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...
[INST] Here is a database schema: genre : id [ INTEGER ] primary_key genre_name [ TEXT ] game : id [ INTEGER ] primary_key genre_id [ INTEGER ] game.genre_id = genre.id game_name [ TEXT ] publisher : id [ INTEGER ] primary_key publisher_name [ TEXT ] game_publisher : id [ INTEGER ] primary_key game_id [ INTEGER ] game_...
SELECT 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';
[INST] Here is a database schema: genre : id [ INTEGER ] primary_key genre_name [ TEXT ] game : id [ INTEGER ] primary_key genre_id [ INTEGER ] game.genre_id = genre.id game_name [ TEXT ] publisher : id [ INTEGER ] primary_key publisher_name [ TEXT ] game_publisher : id [ INTEGER ] primary_key game_id [ INTEGER ] game_...
SELECT T.publisher_name FROM ( SELECT 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...
[INST] Here is a database schema: genre : id [ INTEGER ] primary_key genre_name [ TEXT ] game : id [ INTEGER ] primary_key genre_id [ INTEGER ] game.genre_id = genre.id game_name [ TEXT ] publisher : id [ INTEGER ] primary_key publisher_name [ TEXT ] game_publisher : id [ INTEGER ] primary_key game_id [ INTEGER ] game_...
SELECT COUNT(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...
[INST] Here is a database schema: genre : id [ INTEGER ] primary_key genre_name [ TEXT ] game : id [ INTEGER ] primary_key genre_id [ INTEGER ] game.genre_id = genre.id game_name [ TEXT ] publisher : id [ INTEGER ] primary_key publisher_name [ TEXT ] game_publisher : id [ INTEGER ] primary_key game_id [ INTEGER ] game_...
SELECT 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';
[INST] Here is a database schema: platform : id [ INTEGER ] primary_key platform_name [ TEXT ] game_platform : id [ INTEGER ] primary_key game_publisher_id [ INTEGER ] game_platform.game_publisher_id = game_publisher.id platform_id [ INTEGER ] game_platform.platform_id = platform.id release_year [ INTEGER ] region_sale...
SELECT SUM(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';
[INST] Here is a database schema: game_publisher : id [ INTEGER ] primary_key game_id [ INTEGER ] game_publisher.game_id = game.id publisher_id [ INTEGER ] game_publisher.publisher_id = publisher.id Please write me a SQL statement that answers the following question: 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;
[INST] Here is a database schema: game : id [ INTEGER ] primary_key genre_id [ INTEGER ] game.genre_id = genre.id game_name [ TEXT ] Please write me a SQL statement that answers the following question: List the genre id of the game Pro Evolution Soccer 2012. [/INST] [/INST]
SELECT T.genre_id FROM game AS T WHERE T.game_name = 'Pro Evolution Soccer 2012';
[INST] Here is a database schema: region : id [ INTEGER ] primary_key region_name [ TEXT ] Please write me a SQL statement that answers the following question: State the region id of Japan. [/INST] [/INST]
SELECT T.id FROM region AS T WHERE T.region_name = 'Japan';
[INST] Here is a database schema: region_sales : region_id [ INTEGER ] region_sales.region_id = region.id game_platform_id [ INTEGER ] region_sales.game_platform_id = game_platform.id num_sales [ REAL ] Please write me a SQL statement that answers the following question: Show the id of the game platform with the most ...
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;
[INST] Here is a database schema: game : id [ INTEGER ] primary_key genre_id [ INTEGER ] game.genre_id = genre.id game_name [ TEXT ] Please write me a SQL statement that answers the following question: Which genre has the most games? Show its id. [/INST] [/INST]
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 );
[INST] Here is a database schema: game : id [ INTEGER ] primary_key genre_id [ INTEGER ] game.genre_id = genre.id game_name [ TEXT ] Please write me a SQL statement that answers the following question: What is the id of the game "Resident Evil Archives: Resident Evil"? [/INST] [/INST]
SELECT T.genre_id FROM game AS T WHERE T.game_name = 'Resident Evil Archives: Resident Evil';
[INST] Here is a database schema: platform : id [ INTEGER ] primary_key platform_name [ TEXT ] game_publisher : id [ INTEGER ] primary_key game_id [ INTEGER ] game_publisher.game_id = game.id publisher_id [ INTEGER ] game_publisher.publisher_id = publisher.id game_platform : id [ INTEGER ] primary_key game_publisher_id...
SELECT COUNT(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;
[INST] Here is a database schema: game : id [ INTEGER ] primary_key genre_id [ INTEGER ] game.genre_id = genre.id game_name [ TEXT ] publisher : id [ INTEGER ] primary_key publisher_name [ TEXT ] game_publisher : id [ INTEGER ] primary_key game_id [ INTEGER ] game_publisher.game_id = game.id publisher_id [ INTEGER ] ga...
SELECT T1.publisher_name FROM publisher AS T1 INNER JOIN game_publisher AS T2 ON T1.id = T2.publisher_id INNER JOIN game AS T3 ON T2.game_id = T3.id WHERE T3.game_name = 'ModNation Racers';
[INST] Here is a database schema: region : id [ INTEGER ] primary_key region_name [ TEXT ] region_sales : region_id [ INTEGER ] region_sales.region_id = region.id game_platform_id [ INTEGER ] region_sales.game_platform_id = game_platform.id num_sales [ REAL ] Please write me a SQL statement that answers the following ...
SELECT 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;
[INST] Here is a database schema: game : id [ INTEGER ] primary_key genre_id [ INTEGER ] game.genre_id = genre.id game_name [ TEXT ] platform : id [ INTEGER ] primary_key platform_name [ TEXT ] game_publisher : id [ INTEGER ] primary_key game_id [ INTEGER ] game_publisher.game_id = game.id publisher_id [ INTEGER ] game...
SELECT 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';
[INST] Here is a database schema: genre : id [ INTEGER ] primary_key genre_name [ TEXT ] game : id [ INTEGER ] primary_key genre_id [ INTEGER ] game.genre_id = genre.id game_name [ TEXT ] Please write me a SQL statement that answers the following question: How many games 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';
[INST] Here is a database schema: publisher : id [ INTEGER ] primary_key publisher_name [ TEXT ] game_publisher : id [ INTEGER ] primary_key game_id [ INTEGER ] game_publisher.game_id = game.id publisher_id [ INTEGER ] game_publisher.publisher_id = publisher.id Please write me a SQL statement that answers the followin...
SELECT T2.publisher_name FROM game_publisher AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.id WHERE T1.game_id = 10031;
[INST] Here is a database schema: publisher : id [ INTEGER ] primary_key publisher_name [ TEXT ] game_publisher : id [ INTEGER ] primary_key game_id [ INTEGER ] game_publisher.game_id = game.id publisher_id [ INTEGER ] game_publisher.publisher_id = publisher.id Please write me a SQL statement that answers the followin...
SELECT T.publisher_name FROM ( SELECT T2.publisher_name, COUNT(DISTINCT T1.game_id) FROM game_publisher AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.id GROUP BY T2.publisher_name ORDER BY COUNT(DISTINCT T1.game_id) DESC LIMIT 1 ) t;
[INST] Here is a database schema: genre : id [ INTEGER ] primary_key genre_name [ TEXT ] game : id [ INTEGER ] primary_key genre_id [ INTEGER ] game.genre_id = genre.id game_name [ TEXT ] Please write me a SQL statement that answers the following question: How many more sports games than simulation games? [/INST] [/IN...
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;
[INST] Here is a database schema: genre : id [ INTEGER ] primary_key genre_name [ TEXT ] game : id [ INTEGER ] primary_key genre_id [ INTEGER ] game.genre_id = genre.id game_name [ TEXT ] Please write me a SQL statement that answers the following question: Tell the genre of the game "Resident Evil: Revelations". [/INS...
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';
[INST] Here is a database schema: region : id [ INTEGER ] primary_key region_name [ TEXT ] region_sales : region_id [ INTEGER ] region_sales.region_id = region.id game_platform_id [ INTEGER ] region_sales.game_platform_id = game_platform.id num_sales [ REAL ] Please write me a SQL statement that answers the following ...
SELECT T2.num_sales * 100000 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;
[INST] Here is a database schema: publisher : id [ INTEGER ] primary_key publisher_name [ TEXT ] game_publisher : id [ INTEGER ] primary_key game_id [ INTEGER ] game_publisher.game_id = game.id publisher_id [ INTEGER ] game_publisher.publisher_id = publisher.id Please write me a SQL statement that answers the followin...
SELECT COUNT(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';
[INST] Here is a database schema: platform : id [ INTEGER ] primary_key platform_name [ TEXT ] game_platform : id [ INTEGER ] primary_key game_publisher_id [ INTEGER ] game_platform.game_publisher_id = game_publisher.id platform_id [ INTEGER ] game_platform.platform_id = platform.id release_year [ INTEGER ] Please wri...
SELECT T2.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;
[INST] Here is a database schema: genre : id [ INTEGER ] primary_key genre_name [ TEXT ] game : id [ INTEGER ] primary_key genre_id [ INTEGER ] game.genre_id = genre.id game_name [ TEXT ] publisher : id [ INTEGER ] primary_key publisher_name [ TEXT ] game_publisher : id [ INTEGER ] primary_key game_id [ INTEGER ] game_...
SELECT 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...
[INST] Here is a database schema: publisher : id [ INTEGER ] primary_key publisher_name [ TEXT ] game_publisher : id [ INTEGER ] primary_key game_id [ INTEGER ] game_publisher.game_id = game.id publisher_id [ INTEGER ] game_publisher.publisher_id = publisher.id Please write me a SQL statement that answers the followin...
SELECT CAST(COUNT(CASE WHEN T1.publisher_name = '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;
[INST] Here is a database schema: publisher : id [ INTEGER ] primary_key publisher_name [ TEXT ] game_publisher : id [ INTEGER ] primary_key game_id [ INTEGER ] game_publisher.game_id = game.id publisher_id [ INTEGER ] game_publisher.publisher_id = publisher.id Please write me a SQL statement that answers the followin...
SELECT COUNT(DISTINCT 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';
[INST] Here is a database schema: genre : id [ INTEGER ] primary_key genre_name [ TEXT ] game : id [ INTEGER ] primary_key genre_id [ INTEGER ] game.genre_id = genre.id game_name [ TEXT ] Please write me a SQL statement that answers the following question: What is the genre of the Advent Rising game? [/INST] [/INST]
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';
[INST] Here is a database schema: genre : id [ INTEGER ] primary_key genre_name [ TEXT ] game : id [ INTEGER ] primary_key genre_id [ INTEGER ] game.genre_id = genre.id game_name [ TEXT ] publisher : id [ INTEGER ] primary_key publisher_name [ TEXT ] game_publisher : id [ INTEGER ] primary_key game_id [ INTEGER ] game_...
SELECT COUNT(T3.id) FROM publisher AS T1 INNER JOIN game_publisher AS T2 ON T1.id = T2.publisher_id INNER JOIN game AS T3 ON T2.game_id = T3.id INNER JOIN genre AS T4 ON T3.genre_id = T4.id WHERE T4.genre_name = 'Role-Playing' AND T1.publisher_name = 'Microsoft Game Studios';
[INST] Here is a database schema: publisher : id [ INTEGER ] primary_key publisher_name [ TEXT ] game_publisher : id [ INTEGER ] primary_key game_id [ INTEGER ] game_publisher.game_id = game.id publisher_id [ INTEGER ] game_publisher.publisher_id = publisher.id Please write me a SQL statement that answers the followin...
SELECT T.publisher_name FROM ( SELECT T2.publisher_name, COUNT(DISTINCT T1.game_id) FROM game_publisher AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.id GROUP BY T2.publisher_name ORDER BY COUNT(DISTINCT T1.game_id) DESC LIMIT 1 ) t;
[INST] Here is a database schema: platform : id [ INTEGER ] primary_key platform_name [ TEXT ] publisher : id [ INTEGER ] primary_key publisher_name [ TEXT ] game_publisher : id [ INTEGER ] primary_key game_id [ INTEGER ] game_publisher.game_id = game.id publisher_id [ INTEGER ] game_publisher.publisher_id = publisher....
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';
[INST] Here is a database schema: platform : id [ INTEGER ] primary_key platform_name [ TEXT ] game_publisher : id [ INTEGER ] primary_key game_id [ INTEGER ] game_publisher.game_id = game.id publisher_id [ INTEGER ] game_publisher.publisher_id = publisher.id game_platform : id [ INTEGER ] primary_key game_publisher_id...
SELECT COUNT(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;
[INST] Here is a database schema: publisher : id [ INTEGER ] primary_key publisher_name [ TEXT ] game_publisher : id [ INTEGER ] primary_key game_id [ INTEGER ] game_publisher.game_id = game.id publisher_id [ INTEGER ] game_publisher.publisher_id = publisher.id game_platform : id [ INTEGER ] primary_key game_publisher_...
SELECT 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;
[INST] Here is a database schema: platform : id [ INTEGER ] primary_key platform_name [ TEXT ] game_platform : id [ INTEGER ] primary_key game_publisher_id [ INTEGER ] game_platform.game_publisher_id = game_publisher.id platform_id [ INTEGER ] game_platform.platform_id = platform.id release_year [ INTEGER ] region : id...
SELECT COUNT(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';
[INST] Here is a database schema: platform : id [ INTEGER ] primary_key platform_name [ TEXT ] game_platform : id [ INTEGER ] primary_key game_publisher_id [ INTEGER ] game_platform.game_publisher_id = game_publisher.id platform_id [ INTEGER ] game_platform.platform_id = platform.id release_year [ INTEGER ] region : id...
SELECT T.platform_name FROM ( SELECT T4.platform_name, 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...
[INST] Here is a database schema: platform : id [ INTEGER ] primary_key platform_name [ TEXT ] game_publisher : id [ INTEGER ] primary_key game_id [ INTEGER ] game_publisher.game_id = game.id publisher_id [ INTEGER ] game_publisher.publisher_id = publisher.id game_platform : id [ INTEGER ] primary_key game_publisher_id...
SELECT 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...
[INST] Here is a database schema: publisher : id [ INTEGER ] primary_key publisher_name [ TEXT ] game_publisher : id [ INTEGER ] primary_key game_id [ INTEGER ] game_publisher.game_id = game.id publisher_id [ INTEGER ] game_publisher.publisher_id = publisher.id Please write me a SQL statement that answers the followin...
SELECT T.publisher_name FROM ( SELECT T2.publisher_name, COUNT(DISTINCT T1.game_id) FROM game_publisher AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.id GROUP BY T2.publisher_name HAVING COUNT(DISTINCT T1.game_id) = 1 ) t;
[INST] Here is a database schema: game : id [ INTEGER ] primary_key genre_id [ INTEGER ] game.genre_id = genre.id game_name [ TEXT ] publisher : id [ INTEGER ] primary_key publisher_name [ TEXT ] game_publisher : id [ INTEGER ] primary_key game_id [ INTEGER ] game_publisher.game_id = game.id publisher_id [ INTEGER ] ga...
SELECT 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';
[INST] Here is a database schema: game : id [ INTEGER ] primary_key genre_id [ INTEGER ] game.genre_id = genre.id game_name [ TEXT ] Please write me a SQL statement that answers the following question: What is the genre ID of the game named 25 to Life? [/INST] [/INST]
SELECT T.genre_id FROM game AS T WHERE T.game_name = '25 to Life';
[INST] Here is a database schema: game : id [ INTEGER ] primary_key genre_id [ INTEGER ] game.genre_id = genre.id game_name [ TEXT ] Please write me a SQL statement that answers the following question: List down the game ID of games with genre ID 2. [/INST] [/INST]
SELECT T.id FROM game AS T WHERE T.genre_id = 2;
[INST] Here is a database schema: game_platform : id [ INTEGER ] primary_key game_publisher_id [ INTEGER ] game_platform.game_publisher_id = game_publisher.id platform_id [ INTEGER ] game_platform.platform_id = platform.id release_year [ INTEGER ] Please write me a SQL statement that answers the following question: Pr...
SELECT T.release_year FROM game_platform AS T WHERE T.id BETWEEN 1 AND 10;
[INST] Here is a database schema: game_platform : id [ INTEGER ] primary_key game_publisher_id [ INTEGER ] game_platform.game_publisher_id = game_publisher.id platform_id [ INTEGER ] game_platform.platform_id = platform.id release_year [ INTEGER ] Please write me a SQL statement that answers the following question: Gi...
SELECT T.game_publisher_id FROM game_platform AS T WHERE T.platform_id = 15;
[INST] Here is a database schema: game_platform : id [ INTEGER ] primary_key game_publisher_id [ INTEGER ] game_platform.game_publisher_id = game_publisher.id platform_id [ INTEGER ] game_platform.platform_id = platform.id release_year [ INTEGER ] Please write me a SQL statement that answers the following question: Li...
SELECT T.id FROM game_platform AS T WHERE T.release_year BETWEEN 2000 AND 2003;
[INST] Here is a database schema: region_sales : region_id [ INTEGER ] region_sales.region_id = region.id game_platform_id [ INTEGER ] region_sales.game_platform_id = game_platform.id num_sales [ REAL ] Please write me a SQL statement that answers the following question: What is the number of sales in region ID 2 with...
SELECT T.num_sales * 100000 FROM region_sales AS T WHERE T.region_id = 2 AND T.game_platform_id = 9615;
[INST] Here is a database schema: platform : id [ INTEGER ] primary_key platform_name [ TEXT ] game_platform : id [ INTEGER ] primary_key game_publisher_id [ INTEGER ] game_platform.game_publisher_id = game_publisher.id platform_id [ INTEGER ] game_platform.platform_id = platform.id release_year [ INTEGER ] Please wri...
SELECT DISTINCT T1.platform_name FROM platform AS T1 INNER JOIN game_platform AS T2 ON T1.id = T2.platform_id WHERE T2.release_year = 2016;
[INST] Here is a database schema: game : id [ INTEGER ] primary_key genre_id [ INTEGER ] game.genre_id = genre.id game_name [ TEXT ] game_publisher : id [ INTEGER ] primary_key game_id [ INTEGER ] game_publisher.game_id = game.id publisher_id [ INTEGER ] game_publisher.publisher_id = publisher.id game_platform : id [ I...
SELECT T1.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';
[INST] Here is a database schema: region : id [ INTEGER ] primary_key region_name [ TEXT ] region_sales : region_id [ INTEGER ] region_sales.region_id = region.id game_platform_id [ INTEGER ] region_sales.game_platform_id = game_platform.id num_sales [ REAL ] Please write me a SQL statement that answers the following ...
SELECT 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';
[INST] Here is a database schema: genre : id [ INTEGER ] primary_key genre_name [ TEXT ] game : id [ INTEGER ] primary_key genre_id [ INTEGER ] game.genre_id = genre.id game_name [ TEXT ] game_publisher : id [ INTEGER ] primary_key game_id [ INTEGER ] game_publisher.game_id = game.id publisher_id [ INTEGER ] game_publi...
SELECT DISTINCT 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;
[INST] Here is a database schema: game : id [ INTEGER ] primary_key genre_id [ INTEGER ] game.genre_id = genre.id game_name [ TEXT ] publisher : id [ INTEGER ] primary_key publisher_name [ TEXT ] game_publisher : id [ INTEGER ] primary_key game_id [ INTEGER ] game_publisher.game_id = game.id publisher_id [ INTEGER ] ga...
SELECT T1.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';
[INST] Here is a database schema: genre : id [ INTEGER ] primary_key genre_name [ TEXT ] game : id [ INTEGER ] primary_key genre_id [ INTEGER ] game.genre_id = genre.id game_name [ TEXT ] Please write me a SQL statement that answers the following question: How many role-playing games are there? [/INST] [/INST]
SELECT COUNT(T1.id) FROM game AS T1 INNER JOIN genre AS T2 ON T1.genre_id = T2.id WHERE T2.genre_name = 'Role-Playing';
[INST] Here is a database schema: region : id [ INTEGER ] primary_key region_name [ TEXT ] region_sales : region_id [ INTEGER ] region_sales.region_id = region.id game_platform_id [ INTEGER ] region_sales.game_platform_id = game_platform.id num_sales [ REAL ] Please write me a SQL statement that answers the following ...
SELECT DISTINCT T1.region_name FROM region AS T1 INNER JOIN region_sales AS T2 ON T1.id = T2.region_id WHERE T2.num_sales * 100000 > 300000;
[INST] Here is a database schema: publisher : id [ INTEGER ] primary_key publisher_name [ TEXT ] game_publisher : id [ INTEGER ] primary_key game_id [ INTEGER ] game_publisher.game_id = game.id publisher_id [ INTEGER ] game_publisher.publisher_id = publisher.id game_platform : id [ INTEGER ] primary_key game_publisher_...
SELECT 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...
[INST] Here is a database schema: game_platform : id [ INTEGER ] primary_key game_publisher_id [ INTEGER ] game_platform.game_publisher_id = game_publisher.id platform_id [ INTEGER ] game_platform.platform_id = platform.id release_year [ INTEGER ] region : id [ INTEGER ] primary_key region_name [ TEXT ] region_sales : ...
SELECT 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';
[INST] Here is a database schema: game : id [ INTEGER ] primary_key genre_id [ INTEGER ] game.genre_id = genre.id game_name [ TEXT ] platform : id [ INTEGER ] primary_key platform_name [ TEXT ] game_publisher : id [ INTEGER ] primary_key game_id [ INTEGER ] game_publisher.game_id = game.id publisher_id [ INTEGER ] game...
SELECT T1.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';
[INST] Here is a database schema: publisher : id [ INTEGER ] primary_key publisher_name [ TEXT ] game_publisher : id [ INTEGER ] primary_key game_id [ INTEGER ] game_publisher.game_id = game.id publisher_id [ INTEGER ] game_publisher.publisher_id = publisher.id Please write me a SQL statement that answers the followin...
SELECT T2.publisher_name FROM game_publisher AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.id WHERE T1.game_id = 75;
[INST] Here is a database schema: game : id [ INTEGER ] primary_key genre_id [ INTEGER ] game.genre_id = genre.id game_name [ TEXT ] game_publisher : id [ INTEGER ] primary_key game_id [ INTEGER ] game_publisher.game_id = game.id publisher_id [ INTEGER ] game_publisher.publisher_id = publisher.id game_platform : id [ I...
SELECT T.game_name FROM ( SELECT 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...
[INST] Here is a database schema: publisher : id [ INTEGER ] primary_key publisher_name [ TEXT ] game_publisher : id [ INTEGER ] primary_key game_id [ INTEGER ] game_publisher.game_id = game.id publisher_id [ INTEGER ] game_publisher.publisher_id = publisher.id game_platform : id [ INTEGER ] primary_key game_publisher_...
SELECT 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 > ( ...
[INST] Here is a database schema: platform : id [ INTEGER ] primary_key platform_name [ TEXT ] game_publisher : id [ INTEGER ] primary_key game_id [ INTEGER ] game_publisher.game_id = game.id publisher_id [ INTEGER ] game_publisher.publisher_id = publisher.id game_platform : id [ INTEGER ] primary_key game_publisher_id...
SELECT CAST(COUNT(CASE WHEN 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;
[INST] Here is a database schema: game_platform : id [ INTEGER ] primary_key game_publisher_id [ INTEGER ] game_platform.game_publisher_id = game_publisher.id platform_id [ INTEGER ] game_platform.platform_id = platform.id release_year [ INTEGER ] Please write me a SQL statement that answers the following question: Ho...
SELECT COUNT(T.id) FROM game_platform AS T WHERE T.release_year = 1981;
[INST] Here is a database schema: game : id [ INTEGER ] primary_key genre_id [ INTEGER ] game.genre_id = genre.id game_name [ TEXT ] Please write me a SQL statement that answers the following question: What is the genre ID of the '2Xtreme' game? [/INST] [/INST]
SELECT T.genre_id FROM game AS T WHERE T.game_name = '2Xtreme';
[INST] Here is a database schema: region_sales : region_id [ INTEGER ] region_sales.region_id = region.id game_platform_id [ INTEGER ] region_sales.game_platform_id = game_platform.id num_sales [ REAL ] Please write me a SQL statement that answers the following question: Sum the total game sales in every region for pl...
SELECT SUM(T.num_sales) * 100000 FROM region_sales AS T WHERE T.game_platform_id = 9658;
[INST] Here is a database schema: publisher : id [ INTEGER ] primary_key publisher_name [ TEXT ] Please write me a SQL statement that answers the following question: Provide the ID of 1C Company. [/INST] [/INST]
SELECT T.id FROM publisher AS T WHERE T.publisher_name = '1C Company';
[INST] Here is a database schema: genre : id [ INTEGER ] primary_key genre_name [ TEXT ] Please write me a SQL statement that answers the following question: Provide the genre name of the genre ID 3. [/INST] [/INST]
SELECT T.genre_name FROM genre AS T WHERE T.id = 3;
[INST] Here is a database schema: game_platform : id [ INTEGER ] primary_key game_publisher_id [ INTEGER ] game_platform.game_publisher_id = game_publisher.id platform_id [ INTEGER ] game_platform.platform_id = platform.id release_year [ INTEGER ] Please write me a SQL statement that answers the following question: Li...
SELECT T.id FROM game_platform AS T WHERE T.release_year = 2017;
[INST] Here is a database schema: game : id [ INTEGER ] primary_key genre_id [ INTEGER ] game.genre_id = genre.id game_name [ TEXT ] game_publisher : id [ INTEGER ] primary_key game_id [ INTEGER ] game_publisher.game_id = game.id publisher_id [ INTEGER ] game_publisher.publisher_id = publisher.id game_platform : id [ I...
SELECT T3.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';
[INST] Here is a database schema: genre : id [ INTEGER ] primary_key genre_name [ TEXT ] game : id [ INTEGER ] primary_key genre_id [ INTEGER ] game.genre_id = genre.id game_name [ TEXT ] Please write me a SQL statement that answers the following question: How many games are puzzle genre? [/INST] [/INST]
SELECT COUNT(T1.id) FROM game AS T1 INNER JOIN genre AS T2 ON T1.genre_id = T2.id WHERE T2.genre_name = 'Puzzle';
[INST] Here is a database schema: game : id [ INTEGER ] primary_key genre_id [ INTEGER ] game.genre_id = genre.id game_name [ TEXT ] platform : id [ INTEGER ] primary_key platform_name [ TEXT ] game_publisher : id [ INTEGER ] primary_key game_id [ INTEGER ] game_publisher.game_id = game.id publisher_id [ INTEGER ] game...
SELECT T4.game_name FROM 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';
[INST] Here is a database schema: publisher : id [ INTEGER ] primary_key publisher_name [ TEXT ] game_publisher : id [ INTEGER ] primary_key game_id [ INTEGER ] game_publisher.game_id = game.id publisher_id [ INTEGER ] game_publisher.publisher_id = publisher.id Please write me a SQL statement that answers the followin...
SELECT COUNT(DISTINCT T1.game_id) FROM game_publisher AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.id WHERE T2.publisher_name = 'Acclaim Entertainment';
[INST] Here is a database schema: game : id [ INTEGER ] primary_key genre_id [ INTEGER ] game.genre_id = genre.id game_name [ TEXT ] publisher : id [ INTEGER ] primary_key publisher_name [ TEXT ] game_publisher : id [ INTEGER ] primary_key game_id [ INTEGER ] game_publisher.game_id = game.id publisher_id [ INTEGER ] ga...
SELECT T3.publisher_name FROM game AS T1 INNER JOIN game_publisher AS T2 ON T1.id = T2.game_id INNER JOIN publisher AS T3 ON T2.publisher_id = T3.id WHERE T1.game_name = 'Chronicles of the Sword';
[INST] Here is a database schema: platform : id [ INTEGER ] primary_key platform_name [ TEXT ] game_platform : id [ INTEGER ] primary_key game_publisher_id [ INTEGER ] game_platform.game_publisher_id = game_publisher.id platform_id [ INTEGER ] game_platform.platform_id = platform.id release_year [ INTEGER ] region : id...
SELECT SUM(T1.num_sales * 100000) FROM region_sales AS T1 INNER JOIN region AS T2 ON T1.region_id = T2.id INNER JOIN game_platform AS T3 ON T1.game_platform_id = T3.id INNER JOIN platform AS T4 ON T3.platform_id = T4.id WHERE T2.region_name = 'North America' AND T4.platform_name = 'PS4';
[INST] Here is a database schema: region : id [ INTEGER ] primary_key region_name [ TEXT ] region_sales : region_id [ INTEGER ] region_sales.region_id = region.id game_platform_id [ INTEGER ] region_sales.game_platform_id = game_platform.id num_sales [ REAL ] Please write me a SQL statement that answers the following ...
SELECT 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;
[INST] Here is a database schema: game : id [ INTEGER ] primary_key genre_id [ INTEGER ] game.genre_id = genre.id game_name [ TEXT ] game_publisher : id [ INTEGER ] primary_key game_id [ INTEGER ] game_publisher.game_id = game.id publisher_id [ INTEGER ] game_publisher.publisher_id = publisher.id game_platform : id [ I...
SELECT T3.game_name FROM game_platform AS T1 INNER JOIN game_publisher AS T2 ON T1.game_publisher_id = T2.id INNER JOIN game AS T3 ON T2.game_id = T3.id WHERE T1.release_year = 2011;
[INST] Here is a database schema: platform : id [ INTEGER ] primary_key platform_name [ TEXT ] game_platform : id [ INTEGER ] primary_key game_publisher_id [ INTEGER ] game_platform.game_publisher_id = game_publisher.id platform_id [ INTEGER ] game_platform.platform_id = platform.id release_year [ INTEGER ] Please wri...
SELECT COUNT(T1.id) FROM game_platform AS T1 INNER JOIN platform AS T2 ON T1.platform_id = T2.id WHERE T2.platform_name = 'Wii';
[INST] Here is a database schema: genre : id [ INTEGER ] primary_key genre_name [ TEXT ] game : id [ INTEGER ] primary_key genre_id [ INTEGER ] game.genre_id = genre.id game_name [ TEXT ] game_publisher : id [ INTEGER ] primary_key game_id [ INTEGER ] game_publisher.game_id = game.id publisher_id [ INTEGER ] game_publi...
SELECT 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;
[INST] Here is a database schema: genre : id [ INTEGER ] primary_key genre_name [ TEXT ] game : id [ INTEGER ] primary_key genre_id [ INTEGER ] game.genre_id = genre.id game_name [ TEXT ] Please write me a SQL statement that answers the following question: Mention the genre of the 2Xtreme. [/INST] [/INST]
SELECT T2.id FROM game AS T1 INNER JOIN genre AS T2 ON T1.genre_id = T2.id WHERE T1.game_name = '2Xtreme';
[INST] Here is a database schema: game : id [ INTEGER ] primary_key genre_id [ INTEGER ] game.genre_id = genre.id game_name [ TEXT ] platform : id [ INTEGER ] primary_key platform_name [ TEXT ] game_publisher : id [ INTEGER ] primary_key game_id [ INTEGER ] game_publisher.game_id = game.id publisher_id [ INTEGER ] game...
SELECT T4.platform_name FROM game AS T1 INNER JOIN game_publisher AS T2 ON T1.id = T2.game_id INNER JOIN game_platform AS T3 ON T2.id = T3.game_publisher_id INNER JOIN platform AS T4 ON T3.platform_id = T4.id WHERE T1.game_name = 'Panzer Tactics';
[INST] Here is a database schema: region : id [ INTEGER ] primary_key region_name [ TEXT ] region_sales : region_id [ INTEGER ] region_sales.region_id = region.id game_platform_id [ INTEGER ] region_sales.game_platform_id = game_platform.id num_sales [ REAL ] Please write me a SQL statement that answers the following ...
SELECT (SUM(CASE WHEN T2.region_name = 'North America' THEN T1.num_sales ELSE 0 END) - 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;
[INST] Here is a database schema: game : id [ INTEGER ] primary_key genre_id [ INTEGER ] game.genre_id = genre.id game_name [ TEXT ] Please write me a SQL statement that answers the following question: Which game has the longest name? [/INST] [/INST]
SELECT T.game_name FROM game AS T ORDER BY LENGTH(T.game_name) DESC LIMIT 1;
[INST] Here is a database schema: game_platform : id [ INTEGER ] primary_key game_publisher_id [ INTEGER ] game_platform.game_publisher_id = game_publisher.id platform_id [ INTEGER ] game_platform.platform_id = platform.id release_year [ INTEGER ] Please write me a SQL statement that answers the following question: Ho...
SELECT COUNT(T.id) FROM game_platform AS T WHERE T.release_year = 2001;
[INST] Here is a database schema: region_sales : region_id [ INTEGER ] region_sales.region_id = region.id game_platform_id [ INTEGER ] region_sales.game_platform_id = game_platform.id num_sales [ REAL ] Please write me a SQL statement that answers the following question: What is the total number of sales across all re...
SELECT SUM(T.num_sales) * 100000 FROM region_sales t;
[INST] Here is a database schema: game_publisher : id [ INTEGER ] primary_key game_id [ INTEGER ] game_publisher.game_id = game.id publisher_id [ INTEGER ] game_publisher.publisher_id = publisher.id Please write me a SQL statement that answers the following question: What is the average number of games published by a ...
SELECT CAST(COUNT(T.game_id) AS REAL) / COUNT(DISTINCT T.publisher_id) FROM game_publisher AS T;
[INST] Here is a database schema: game_platform : id [ INTEGER ] primary_key game_publisher_id [ INTEGER ] game_platform.game_publisher_id = game_publisher.id platform_id [ INTEGER ] game_platform.platform_id = platform.id release_year [ INTEGER ] Please write me a SQL statement that answers the following question: Wh...
SELECT MIN(T.release_year) FROM game_platform t;
[INST] Here is a database schema: genre : id [ INTEGER ] primary_key genre_name [ TEXT ] game : id [ INTEGER ] primary_key genre_id [ INTEGER ] game.genre_id = genre.id game_name [ TEXT ] Please write me a SQL statement that answers the following question: What is the least common game genre? [/INST] [/INST]
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;