db_id
stringclasses
68 values
question
stringlengths
24
325
evidence
stringlengths
0
580
SQL
stringlengths
23
728
donor
What is the latitude and longitude of the school where the teacher who wrote "Smile for the Camera!!!" teaches?
wrote "Smile for the Camera!!!" refers to title = 'Smile for the Camera!!!'; latitude refers to school_latitude; longitude refers to school_longitude
SELECT T1.school_latitude, T1.school_longitude FROM projects AS T1 INNER JOIN essays AS T2 ON T1.projectid = T2.projectid WHERE T2.title = 'Smile for the Camera!!!'
donor
How many schools in urban area requested for books resources?
urban area refers to school_metro = 'urban'; books resources refers to project_resource_type = 'Books'
SELECT COUNT(T2.schoolid) FROM resources AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T2.resource_type = 'Books' AND T2.school_metro = 'urban'
donor
How many donors in Los Angeles donated to school in another city?
in Los Angeles refers to donor_city = 'Los Angeles'; school in another city refers to school_city ! = 'Los Angeles'
SELECT COUNT(T2.schoolid) FROM donations AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T1.donor_city = 'Los Angeles' AND T2.school_city NOT LIKE 'Los Angeles'
donor
What is the prefix for the teacher who handled the 'Reading About Other Cultures' project?
Reading About Other Cultures' project refers to title = 'Reading About Other Cultures'; prefix for the teacher refers to teacher_prefix
SELECT T2.teacher_prefix FROM essays AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T1.title LIKE 'Reading About Other Cultures'
donor
How many students will be impacted for the Fit Firsties! Project?
how many students refers to students_reached; Fit Firsties! project refers to title = 'Fit Firsties!'
SELECT T2.students_reached FROM essays AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T1.title LIKE 'Fit Firsties!'
donor
Among all the donors from New York, how many of them are teachers?
from New York refers to donor_city = 'New York'; donor is a teacher refers to is_teacher_acct = 't';
SELECT COUNT(donationid) FROM donations WHERE is_teacher_acct = 't' AND donor_city = 'New York'
donor
How many donors from New Jersey have made a donation for an honoree?
from New Jersey refers to donor_state = 'NJ'; for an honoree refers to for_honoree = 't';
SELECT COUNT(donationid) FROM donations WHERE for_honoree = 't' AND donor_state = 'NJ'
donor
Among the projects created by a teacher from New York, how many of them have a donor from the same city?
New York is the donor city; donor from the same city refers to donor from New York in which teacher_ny_teaching_fellow = 't';
SELECT COUNT(T1.projectid) FROM projects AS T1 INNER JOIN donations AS T2 ON T1.projectid = T2.projectid WHERE T1.teacher_ny_teaching_fellow = 't' AND T2.donor_city = 'New York'
donor
How many projects have their resources provided by the vendor Lakeshore Learning Materials and are created by a teacher with a doctor degree?
Lakeshore Learning Materials is vendor_name;  teacher with a doctor degree refers to teacher_prefix = 'Dr.';
SELECT COUNT(T1.projectid) FROM resources AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T1.vendor_name = 'Lakeshore Learning Materials' AND T2.teacher_prefix = 'Dr.'
donor
Among the donations with a portion using account credits redemption, how many of them are for projects created by teachers working in a public year-round school?
portion using account credits redemption refers to payment_included_acct_credit = 't'; year-round school refers to school_year_round = 't';
SELECT COUNT(T1.projectid) FROM projects AS T1 INNER JOIN donations AS T2 ON T1.projectid = T2.projectid WHERE T2.payment_included_acct_credit = 't' AND T1.school_year_round = 't'
donor
Have the teacher "42d43fa6f37314365d08692e08680973" acquired P.h.D or doctor degree?
teacher "42d43fa6f37314365d08692e08680973" refers to teacher_acctid = '42d43fa6f37314365d08692e08680973';
SELECT CASE WHEN teacher_prefix = 'Dr.' THEN 'Yes' ELSE 'NO' END FROM projects WHERE teacher_acctid = '42d43fa6f37314365d08692e08680973'
donor
Is teacher "42d43fa6f37314365d08692e08680973" a New York teacher?
teacher "42d43fa6f37314365d08692e08680973"refers to teacher_acctid = '42d43fa6f37314365d08692e08680973';
SELECT teacher_ny_teaching_fellow end FROM projects WHERE teacher_acctid = '42d43fa6f37314365d08692e08680973'
donor
Please list the titles of projects by which schools in Abington was donated.
Abington is school_city;
SELECT T2.title FROM projects AS T1 INNER JOIN essays AS T2 ON T1.projectid = T2.projectid WHERE T1.school_city LIKE 'Abington'
donor
Among the schools' projects whose donation didn't use account credits redemption,how many schools are public magnet schools?
donation didn't use account credits redemption refers to payment_included_acct_credit = 'f'; magnet school refers to school_magnet = 't';
SELECT COUNT(T1.schoolid) FROM projects AS T1 INNER JOIN donations AS T2 ON T1.projectid = T2.projectid WHERE T1.school_magnet = 't' AND T2.payment_included_acct_credit = 'f'
donor
In the schools donated by the project of the resources provided by ABC School Supply, how many schools are public magnet schools?
ABC School Supply is vendor_name;  public magnet school refers to school_magnet = 't';
SELECT COUNT(T2.schoolid) FROM resources AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T2.school_magnet = 't' AND T1.vendor_name = 'ABC School Supply'
donor
Among the schools donated by donor "000eebf28658900e63b538cf8a73afbd",how many schools whose poverty level are highest?
donor "000eebf28658900e63b538cf8a73afbd" refers to donor_acctid = '000eebf28658900e63b538cf8a73afbd'; highest poverty level refers to poverty_level = 'highest poverty';
SELECT COUNT(T1.schoolid) FROM projects AS T1 INNER JOIN donations AS T2 ON T1.projectid = T2.projectid WHERE T1.poverty_level = 'highest poverty' AND T2.donor_acctid = '000eebf28658900e63b538cf8a73afbd'
donor
What is the short description of the project that gives donation to school “301c9bf0a45d159d162b65a93fddd74e”?
school “301c9bf0a45d159d162b65a93fddd74e" refers to schoolid = '301c9bf0a45d159d162b65a93fddd74e';
SELECT T2.short_description FROM projects AS T1 INNER JOIN essays AS T2 ON T1.projectid = T2.projectid WHERE T1.schoolid = '301c9bf0a45d159d162b65a93fddd74e'
donor
Which city does the school that project "iMath" donated to in?
iMath is the title; city refers to school_city;
SELECT T1.school_city FROM projects AS T1 INNER JOIN essays AS T2 ON T1.projectid = T2.projectid WHERE T2.title LIKE 'iMath'
donor
How many schools which have suburban metro are there in Bethlehem?
Bethlehem is school_city; suburban metro refers to school_metro = 'suburban';
SELECT COUNT(schoolid) FROM projects WHERE school_city = 'Bethlehem' AND school_metro = 'suburban'
donor
What is the number of the year round school in Los Angeles?
Los Angeles is school_city; year-round school refers to school_year_round = 't';
SELECT COUNT(school_year_round) FROM projects WHERE school_city = 'Los Angeles' AND school_year_round = 't'
donor
State the number of public magnet schools in New York Manhattan.
public magnet school refers to school_magnet = 't'; in New York Manhattan refers to school_country = 'New York(Manhattan)';
SELECT COUNT(schoolid) FROM projects WHERE school_county = 'New York (Manhattan)' AND school_magnet = 't'
donor
How many teachers in Twin Falls have Math & Science as their primary focus area?
Twin Falls is school_country; 'Math & Science' is primary_focus_area;
SELECT COUNT(teacher_acctid) FROM projects WHERE school_county = 'Twin Falls' AND primary_focus_area = 'Math & Science'
donor
How many teachers that have Literature & Writing as their primary focus subject use 'Mr' as their teacher prefix?
Literature & Writing' is primary_focus_subject; use 'Mr' as their teacher prefix refers to teacher_prefix = 'Mr';
SELECT COUNT(teacher_acctid) FROM projects WHERE teacher_prefix = 'Mr.' AND primary_focus_subject = 'Literature & Writing'
donor
What is the total number of projects that was created by the teachers that teach 3-5 grades in Boston Public School District?
teach 3-5 grades refers to grade_level = 'Grades 3-5'; 'Boston Public School District' is school_district;
SELECT COUNT(projectid) FROM projects WHERE school_district = 'Boston Public School District' AND grade_level = 'Grades 3-5'
donor
For the teacher who wrote the project 'ABC Read', which city was he/she in?
ABC Read' is the title; city refers to school_city
SELECT T2.school_city FROM essays AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T1.title = 'ABC Read'
donor
What is the teacher prefix for the teacher who wrote the project 'Creating Memories and Inspiring Dreams'?
Creating Memories and Inspiring Dreams is title;
SELECT T2.teacher_prefix FROM essays AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T1.title LIKE 'Creating Memories and Inspiring Dreams%'
donor
Show the school id for the project 'Virtual Aquarium Needs Help!'.
Virtual Aquarium Needs Help!' is the title;
SELECT T2.schoolid FROM essays AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T1.title LIKE 'Virtual Aquarium Needs Help!'
donor
What is the short description for the title Future Einsteins Of America?
SELECT short_description FROM essays WHERE title = 'Future Einsteins Of America'
donor
How many suburban metros are there in Livingston Parish School District?
suburban metros refer to metro = 'suburban'; Livingston Parish School District refer to school_district
SELECT COUNT(projectid) FROM projects WHERE school_district = 'Livingston Parish School Dist' AND school_metro = 'suburban'
donor
Which school district was Future Einsteins Of America project located at?
Future Einsteins of America refer to title
SELECT T1.school_district FROM projects AS T1 INNER JOIN essays AS T2 ON T1.projectid = T2.projectid WHERE T2.title LIKE 'Future Einsteins Of America'
donor
How many donations were paid via credit card to Memphis City School District?
paid via credit card refer to payment method = creditcard; Memphis City School District refer to school_district
SELECT COUNT(T1.projectid) FROM donations AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T1.payment_method = 'creditcard' AND T2.school_district = 'Memphis City School District'
donor
What are the coordinates of the school where project 'Look, Look, We Need a Nook!' Was donated to and what resource type is it?
Coordinates of the school refer to school_latitude, school_longitude); Look, Look, We Need a Nook! Refer to title;
SELECT T2.school_latitude, T2.school_longitude, T2.resource_type FROM essays AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T1.title LIKE 'Look, Look, We Need a Nook!'
donor
What date did the project with he 'Lets Share Ideas essay' went live?
date refer to date_posted; Lets Share Ideas refer to title
SELECT T1.date_posted FROM projects AS T1 INNER JOIN essays AS T2 ON T1.projectid = T2.projectid WHERE T2.title LIKE 'Lets Share Ideas'
donor
How many donors who donated to the city of Pocatello are not teachers?
city of Pocatello refers to donor_city = 'Pocatello'; not teachers refers to is_teacher_acct = 'f'
SELECT COUNT(donationid) FROM donations WHERE donor_city = 'Pocatello' AND is_teacher_acct = 'f'
donor
How many schools in Suffolk County have Ph.D. teachers?
Suffolk County refers to School_county = 'Suffolk'; Ph.D. teachers refers to Teacher_prefix = 'Dr.'
SELECT COUNT(schoolid) FROM projects WHERE teacher_prefix = 'Dr.' AND school_county = 'Suffolk'
donor
How many donations of more than $100 were made for an honoree?
an honoree refers to for_honoree = 't'; more than $100 refers to dollar_amount = '100_and_up'
SELECT COUNT(donationid) FROM donations WHERE dollar_amount = '100_and_up' AND for_honoree = 't'
donor
On how many projects where the teacher has ordered between 5 to 10 items are from are from Quill.com?
ordered between 5 to 10 items refers to item_quantity between 5 and 10; are from Quill.com refers to vendor_name = 'Quill.com'
SELECT COUNT(projectid) FROM resources WHERE vendor_name = 'Quill.com' AND item_quantity BETWEEN 5 AND 10
donor
In which cities are Los Angeles County Suburban Metro Schools located?
Los Angeles County refers to school_county = 'Los Angeles'
SELECT school_city FROM projects WHERE school_metro = 'suburban' AND school_county = 'Los Angeles'
donor
What percentage of projects in the City of Santa Barbara are in suburban metro?
City of Santa Barbara refers to school_city = 'Santa Barbara'; percentage refers to DIVIDE(school_metro = 'suburban'; school_metro)*100
SELECT CAST(SUM(CASE WHEN school_metro = 'suburban' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(projectid) FROM projects WHERE school_city = 'Santa Barbara'
donor
How many schools in Brooklyn with urban metro and donations for an honoree have requested TT992 - Refill Pack for Safety Name Tags as a resource?
in Brooklyn refers to school_city = 'Brooklyn'; urban metro refers to school_metro = 'urban'; donations for an honoree refers to for_honoree = 't'; requested TT992 - Refill Pack for Safety Name Tags refers to item_name = 'TT992 - Refill Pack for Safety Name Tags'
SELECT COUNT(T2.schoolid) FROM resources AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid INNER JOIN donations AS T3 ON T2.projectid = T3.projectid WHERE T2.school_city = 'Brooklyn' AND T2.school_metro = 'urban' AND T3.for_honoree = 't' AND T1.item_name = 'TT992 - Refill Pack for Safety Name Tags'
donor
How many schools with the highest level of poverty have received a portion of a donation included corporate sponsored gift card?
highest level of poverty refers to poverty_level = 'highest'; received a portion of a donation included corporate sponsored gift card refers to payment_included_campaign_gift_card = 't'
SELECT COUNT(T1.schoolid) FROM projects AS T1 INNER JOIN donations AS T2 ON T1.projectid = T2.projectid WHERE T2.payment_included_campaign_gift_card = 't' AND T1.poverty_level = 'highest poverty'
donor
Find out if the project with the title Team More Books! has a New York teaching fellow.
title Team More Books! Refers to title = 'Team More Books!'; as a New York teaching fellow refers to teacher_ny_teaching_fellow = 't'
SELECT T2.teacher_ny_teaching_fellow FROM essays AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T1.title LIKE 'Team More Books!'
donor
How many teachers have made some type of donation for projects in Chicago?
in Chicago refers to school_city = 'Chicago'; teachers refers to is_teacher_acct = 't'
SELECT COUNT(DISTINCT T2.teacher_acctid) FROM donations AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T1.is_teacher_acct = 't' AND T2.school_city = 'Chicago'
donor
How many Rock Hill City School projects have teacher donors?
Rock Hill City School refers to school_city = 'Rock Hill'; teacher donors refers to is_teacher_acct = 't'
SELECT COUNT(DISTINCT T1.teacher_acctid) FROM projects AS T1 INNER JOIN donations AS T2 ON T1.projectid = T2.projectid WHERE T1.school_city = 'Rock Hill' AND is_teacher_acct = 't'
donor
In what percentage of counties has the ABC Read project been launched?
ABC Read project been launched refers to title = 'ABC Read'; percentage refers to DIVIDE(count(case when title = 'ABC Read' then school_county else null end),count(school_county))*100
SELECT CAST(SUM(CASE WHEN T2.title LIKE 'ABC Read' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.school_county) FROM projects AS T1 INNER JOIN essays AS T2 ON T1.projectid = T2.projectid
donor
When did the project "Photojournalists Want to Exhibit Their Best Works" go live?
project "Photojournalists Want to Exhibit Their Best Works" refers to title = 'Photojournalists Want to Exhibit Their Best Works'; when project go live refers to datePosted
SELECT T1.date_posted FROM projects AS T1 INNER JOIN essays AS T2 ON T1.projectid = T2.projectid WHERE T2.title LIKE 'Photojournalists Want to Exhibit Their Best Works'
donor
What are the coordinates of the school with the project "Wiping Away Bad Grades"?
project "Wiping Away Bad Grades" title = 'Wiping Away Bad Grades'; coordinates refers to school_longitude, school_latitude
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'
donor
For what grade was the project "Too Close for Comfort" for?
project "Too Close for Comfort" refers to title = 'Too Close for Comfort'; grade refers to grade_level
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'
donor
What percentage of donations are given via a giving or campaign page? List the primary area of those donations.
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
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 LIMIT 1 ) result FROM donations AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid
video_games
How many more games were sold on game platform ID 50 than on game platform ID 51 in region ID 1?
result = subtract(sum(num_sales where game_platform_id = 50), sum(num_sales where game_platform_id = 51))
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
video_games
Please list all the games that have the same game genre as 3D Lemmings.
game refers to game_name; 3D Lemmings refers to game_name = '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' )
video_games
How many action games are there in total?
action game refers to genre_name = 'Action'
SELECT COUNT(T1.id) FROM game AS T1 INNER JOIN genre AS T2 ON T1.genre_id = T2.id WHERE T2.genre_name = 'Action'
video_games
What is the genre of 3D Lemmings?
genre refers to genre_name; 3D Lemmings refers to game_name = '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'
video_games
Who is the publisher of 3D Lemmings?
publisher refers to publisher_name; 3D Lemmings refers to game_name = '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'
video_games
Please list the names of all the games published by 10TACLE Studios.
name refers to game_name; published by 10TACLE Studios refers to publisher_name = '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'
video_games
Among the games published by 10TACLE Studios, how many of them are puzzles?
published by 10TACLE Studios refers to publisher_name = '10TACLE Studios'; puzzle refers to genre_name = 'Puzzle'
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'
video_games
Please list the names of all the games published by 10TACLE Studios and are puzzles.
name refers to game_name; published by 10TACLE Studios refers to publisher_name = '10TACLE Studios'; puzzle refers to genre_name = 'Puzzle'
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'
video_games
On which platform was Panzer Tactics released in 2007?
platform refers to platform_name; Panzer Tactics refers to game_name = 'Panzer Tactics'; released in 2007 refers to release_year = 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 = 2007
video_games
In which year was Panzer Tactics released on DS?
year refers to release_year; Panzer Tactics refers to game_name = 'Panzer Tactics'; on DS refers to platform_name = '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 = 'DS'
video_games
Please list the names of the publishers of all the puzzle games.
name of publisher refers to publisher_name; puzzle refers to genre_name = 'Puzzle'
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'
video_games
What is the name of the publisher that has published the most puzzle games?
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'))
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 COUNT(DISTINCT T1.id) DESC LIMIT 1 ) t
video_games
How many publishers have published more than 3 puzzle games?
puzzle refers to genre_name = 'Puzzle'; more than 3 puzzle games refers to count(game_id where genre_name = 'Puzzle') > 3
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 COUNT(DISTINCT T1.id) > 3 ) t
video_games
Among the games published by Nintendo, what is the percentage of those in the genre of sports?
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'
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'
video_games
How many games were sold on the DS platform on average in the 4 different regions?
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'
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'
video_games
Tell the number of games whose publisher id is 352.
number of games refers to count(game_id)
SELECT DISTINCT T.game_id FROM game_publisher AS T WHERE T.publisher_id = 352
video_games
List the genre id of the game Pro Evolution Soccer 2012.
Pro Evolution Soccer 2012 refers to game_name = 'Pro Evolution Soccer 2012'
SELECT T.genre_id FROM game AS T WHERE T.game_name = 'Pro Evolution Soccer 2012'
video_games
State the region id of Japan.
region id refers to region.id; Japan refers to region_name = 'Japan'
SELECT T.id FROM region AS T WHERE T.region_name = 'Japan'
video_games
Show the id of the game platform with the most sales in region 2.
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'
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
video_games
Which genre has the most games? Show its id.
the most games refers to max(game_id); genre id refers to genre_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 )
video_games
What is the id of the game "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'
SELECT T.genre_id FROM game AS T WHERE T.game_name = 'Resident Evil Archives: Resident Evil'
video_games
Show the number of games which were released on X360 in 2010.
on X360 refers to platform_name = 'X360'; in 2010 refers to release_year = '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
video_games
State the publisher name of the game "ModNation Racers".
game "ModNation Racers" refers to game_name = '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'
video_games
How many platforms are available for the game Pro Evolution Soccer 2016?
game Pro Evolution Soccer 2016 refers to game_name = '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'
video_games
How many games in the database belong to the genre of sports?
the genre of sports refers to genre_name = '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'
video_games
Name of the publisher of the game id 10031.
name of publisher refers to publisher_name; the game id 10031 refers to 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
video_games
State the name of the publisher with the most games.
name of publisher refers to publisher_name; the most games refers to max(game_id)
SELECT T.publisher_name FROM ( SELECT T2.publisher_name, COUNT(DISTINCT T1.game_id) FROM game_publisher AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.id GROUP BY T2.publisher_name ORDER BY COUNT(DISTINCT T1.game_id) DESC LIMIT 1 ) t
video_games
How many more sports games than simulation games?
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'))
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
video_games
Tell the genre of the game "Resident Evil: Revelations".
genre refers to genre_name; game "Resident Evil: Revelations" refers to game_name = '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'
video_games
How many sales does game platform id 3871 make in Europe?
number of sales = multiply(num_sales, 100000); in Europe refers to region_name = '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
video_games
Give the number of games which were published by Ascaron Entertainment GmbH.
published by Ascaron Entertainment GmbH refers to publisher_name = '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'
video_games
Show the name of the earliest platform in the database.
the earliest refers to min(release_year); name of platform refers to platform_name
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
video_games
For all the games which were published by Namco Bandai Games, what percentage of them were adventure games?
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'
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 Bandai Games'
video_games
How many times more is the number of games which were published by Atari than Athena?
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'))
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
video_games
How many games did Electronic Arts publish?
Electronic Arts refers to publisher_name = 'Electronic Arts'
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'
video_games
What is the genre of the Advent Rising game?
genre refers to genre_name; Advent Rising game refers to game_name = 'Advent Rising'
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'
video_games
How many role-playing games did Microsoft Game Studios publish?
role-playing game refers to genre_name = 'Role-Playing'; Microsoft Game Studios refers to publisher_name = 'Microsoft Game Studios'
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'
video_games
Which publisher published the most games?
publisher refers to publisher_name; the most games refers to max(count(publisher_id))
SELECT T.publisher_name FROM ( SELECT T2.publisher_name, COUNT(DISTINCT T1.game_id) FROM game_publisher AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.id GROUP BY T2.publisher_name ORDER BY COUNT(DISTINCT T1.game_id) DESC LIMIT 1 ) t
video_games
In 2004, what are the names of the platforms where Codemasters publish its games?
name of platform refers to platform_name; Codemasters refers to publisher_name = 'Codemasters'; in 2004 refers to release_year = 2004
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'
video_games
How many games were released on PS4 in 2014?
on PS4 refers to platform_name = 'PS4'; in 2014 refers to release_year = 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
video_games
How many publishers in Japan released a game on X360 in 2011?
in Japan refers to region_name = 'Japan'; on X360 refers to platform_name = 'X360'; in 2011 refers to release_year = 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'
video_games
Which year has the most number of PC games releases?
year refers to release_year; the most number of releases refers to max(count(game_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 LIMIT 1 ) t
video_games
List the names of all the publishers who published one game only.
name of publisher refers to publisher_name; published one game only refers to count(publisher_id) = 1
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
video_games
What are the names of the games that were published by 505 Games?
name of game refers to game_name; published by 505 Games refers to publisher_name = '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'
video_games
What is the genre ID of the game named 25 to Life?
the game named 25 to Life refers to game_name = '25 to Life'
SELECT T.genre_id FROM game AS T WHERE T.game_name = '25 to Life'
video_games
List down the game ID of games with genre ID 2.
game ID refers to game.id; genre ID 2 refers to genre_id = 2
SELECT T.id FROM game AS T WHERE T.genre_id = 2
video_games
Provide the release year of record ID 1 to 10.
record ID 1 to 10 refers to game.id BETWEEN 1 AND 10
SELECT T.release_year FROM game_platform AS T WHERE T.id BETWEEN 1 AND 10
video_games
Give the game publisher ID of records with platform ID 15.
platform ID 15 refers to platform_id = 15
SELECT T.game_publisher_id FROM game_platform AS T WHERE T.platform_id = 15
video_games
List down the record ID of records released between 2000 to 2003.
record ID refers to game.id; released between 2000 to 2003 refers to release_year BETWEEN 2000 AND 2003
SELECT T.id FROM game_platform AS T WHERE T.release_year BETWEEN 2000 AND 2003
video_games
What is the number of sales in region ID 2 with game platform ID 9615?
number of sales refers to multiply(num_sales, 100000)
SELECT T.num_sales * 100000 FROM region_sales AS T WHERE T.region_id = 2 AND T.game_platform_id = 9615
video_games
List down the names of platform where the games released in 2016 can be played on.
name of platform refers to platform_name; released in 2016 refers to release_year = 2016
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