problem
stringlengths
121
422
db_id
stringclasses
69 values
solution
stringlengths
23
804
Write SQL query to solve given problem: What payment method was used for Needed Resource Materials For My Students?. Keep the solution inside sql tag ```sql [SQL-Query] ```
donor
SELECT T3.payment_method FROM essays AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid INNER JOIN donations AS T3 ON T2.projectid = T3.projectid WHERE T1.title = 'Needed Resource Materials For My Students'
Write SQL query to solve given problem: How many donations were paid via credit card to Memphis City School District?. Keep the solution inside sql tag ```sql [SQL-Query] ```
donor
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'
Write SQL query to solve given problem: List the school districts that have bought resources from Barnes and Noble.. Keep the solution inside sql tag ```sql [SQL-Query] ```
donor
SELECT T2.school_district FROM resources AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T1.vendor_name = 'Barnes and Noble'
Write SQL query to solve given problem: Give the coordinates of the buyer of R & A Plant Genetics from Benchmark Education.. Keep the solution inside sql tag ```sql [SQL-Query] ```
donor
SELECT T2.school_latitude, T2.school_longitude FROM resources AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T1.item_name = 'R & A Plant Genetics' AND T1.vendor_name = 'Benchmark Education'
Write SQL query to solve given problem: Which payment method is most comonly used by the schools in the state of Georgia for the payment of donations?. Keep the solution inside sql tag ```sql [SQL-Query] ```
donor
SELECT T1.payment_method FROM donations AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T2.school_state = 'GA' GROUP BY T2.school_state ORDER BY COUNT(T1.payment_method) DESC LIMIT 1
Write SQL query to solve given problem: What are the coordinates of the school where project 'Look, Look, We Need a Nook!' Was donated to and what resource type is it?. Keep the solution inside sql tag ```sql [SQL-Query] ```
donor
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!'
Write SQL query to solve given problem: Write the messages of those who donated to the Newark School District in the coordinates of 40.735332, -74.196014.. Keep the solution inside sql tag ```sql [SQL-Query] ```
donor
SELECT T1.donation_message FROM donations AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T2.school_latitude = 40.735332 AND T2.school_longitude = -74.196014 AND T2.school_district = 'Newark School District'
Write SQL query to solve given problem: What date did the project with he 'Lets Share Ideas essay' went live?. Keep the solution inside sql tag ```sql [SQL-Query] ```
donor
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'
Write SQL query to solve given problem: Write the message of the donor of the project with the title of Lets Share Ideas who paid with a credit card.. Keep the solution inside sql tag ```sql [SQL-Query] ```
donor
SELECT T3.donation_message FROM essays AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid INNER JOIN donations AS T3 ON T2.projectid = T3.projectid WHERE T1.title = 'Lets Share Ideas' AND T3.payment_method = 'creditcard'
Write SQL query to solve given problem: Which resource type is commonly bought by the Los Angeles Unified School District?. Keep the solution inside sql tag ```sql [SQL-Query] ```
donor
SELECT T1.project_resource_type FROM resources AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T2.school_district = 'Los Angeles Unif Sch Dist' GROUP BY T2.school_district ORDER BY COUNT(T1.project_resource_type) DESC LIMIT 1
Write SQL query to solve given problem: Which cities in the Los Angeles Unified School District has bought supplies from Quill.com?. Keep the solution inside sql tag ```sql [SQL-Query] ```
donor
SELECT T2.school_city FROM resources AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T2.school_district = 'Los Angeles Unif Sch Dist' AND T1.vendor_name = 'Quill.com'
Write SQL query to solve given problem: What is the total price of items brought from ABC School Supply with a listed type of Other? Also include the list of the buyers' coordinates and school districts they belong to.. Keep the solution inside sql tag ```sql [SQL-Query] ```
donor
SELECT T2.item_unit_price * T2.item_quantity price, T1.school_latitude, T1.school_longitude FROM projects AS T1 INNER JOIN resources AS T2 ON T1.projectid = T2.projectid WHERE T2.vendor_name = 'ABC School Supply' AND T2.project_resource_type = 'Other' AND T1.school_district = 'Hillsborough Co Pub Sch Dist'
Write SQL query to solve given problem: Calculate the sum of all the total amount donated to the essay project titled 'Lets Share Ideas' which were paid through paypal and indicate the city and poverty level.. Keep the solution inside sql tag ```sql [SQL-Query] ```
donor
SELECT SUM(T3.donation_total), school_city, poverty_level FROM essays AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid INNER JOIN donations AS T3 ON T2.projectid = T3.projectid WHERE T1.title = 'Lets Share Ideas' AND T3.payment_method = 'paypal'
Write SQL query to solve given problem: How many donors who donated to the city of Pocatello are not teachers?. Keep the solution inside sql tag ```sql [SQL-Query] ```
donor
SELECT COUNT(donationid) FROM donations WHERE donor_city = 'Pocatello' AND is_teacher_acct = 'f'
Write SQL query to solve given problem: How many schools in Suffolk County have Ph.D. teachers?. Keep the solution inside sql tag ```sql [SQL-Query] ```
donor
SELECT COUNT(schoolid) FROM projects WHERE teacher_prefix = 'Dr.' AND school_county = 'Suffolk'
Write SQL query to solve given problem: What is the sum of the total donated amounts paid through Amazon?. Keep the solution inside sql tag ```sql [SQL-Query] ```
donor
SELECT SUM(donation_to_project) + SUM(donation_optional_support) FROM donations WHERE payment_method = 'amazon'
Write SQL query to solve given problem: How many donations of more than $100 were made for an honoree?. Keep the solution inside sql tag ```sql [SQL-Query] ```
donor
SELECT COUNT(donationid) FROM donations WHERE dollar_amount = '100_and_up' AND for_honoree = 't'
Write SQL query to solve given problem: How many resources with a unit price less than 15 are not technology type? List them by vendor id. Keep the solution inside sql tag ```sql [SQL-Query] ```
donor
SELECT vendorid FROM resources WHERE project_resource_type = 'Technology' AND item_unit_price <= 15
Write SQL query to solve given problem: On how many projects where the teacher has ordered between 5 to 10 items are from are from Quill.com?. Keep the solution inside sql tag ```sql [SQL-Query] ```
donor
SELECT COUNT(projectid) FROM resources WHERE vendor_name = 'Quill.com' AND item_quantity BETWEEN 5 AND 10
Write SQL query to solve given problem: List by school id projects from schools located in the Union Pub School District I-9 that have a New York teaching fellow. Keep the solution inside sql tag ```sql [SQL-Query] ```
donor
SELECT schoolid FROM projects WHERE school_district = 'Union Pub School District I-9' AND teacher_ny_teaching_fellow = 't'
Write SQL query to solve given problem: In which cities are Los Angeles County Suburban Metro Schools located?. Keep the solution inside sql tag ```sql [SQL-Query] ```
donor
SELECT school_city FROM projects WHERE school_metro = 'suburban' AND school_county = 'Los Angeles'
Write SQL query to solve given problem: What are the vendors of the book-type projects? List them with the project ID.. Keep the solution inside sql tag ```sql [SQL-Query] ```
donor
SELECT DISTINCT vendorid, projectid FROM resources WHERE project_resource_type = 'Books'
Write SQL query to solve given problem: What percentage of projects that have not received a cash donation have received a portion of a donation included corporate sponsored giftcard?. Keep the solution inside sql tag ```sql [SQL-Query] ```
donor
SELECT CAST(SUM(CASE WHEN payment_included_campaign_gift_card = 't' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(donationid) FROM donations WHERE payment_method = 'no_cash_received'
Write SQL query to solve given problem: What percentage of projects in the City of Santa Barbara are in suburban metro?. Keep the solution inside sql tag ```sql [SQL-Query] ```
donor
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'
Write SQL query to solve given problem: What is the percentage of payment methods of donations made in March 2013?. Keep the solution inside sql tag ```sql [SQL-Query] ```
donor
SELECT payment_method , CAST(COUNT(donationid) AS REAL) * 100 / 51090 FROM donations WHERE donation_timestamp LIKE '2013-03%' GROUP BY payment_method
Write SQL query to solve given problem: What is the average unit price of AKJ Books items?. Keep the solution inside sql tag ```sql [SQL-Query] ```
donor
SELECT SUM(item_unit_price) / SUM(item_quantity) FROM resources WHERE vendor_name = 'AKJ Books'
Write SQL query to solve given problem: 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?. Keep the solution inside sql tag ```sql [SQL-Query] ```
donor
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'
Write SQL query to solve given problem: How many schools with the highest level of poverty have received a portion of a donation included corporate sponsored gift card?. Keep the solution inside sql tag ```sql [SQL-Query] ```
donor
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'
Write SQL query to solve given problem: In which city is there a greater number of schools that have received donations of less than 10 dollars?. Keep the solution inside sql tag ```sql [SQL-Query] ```
donor
SELECT T2.school_city FROM donations AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T1.dollar_amount = 'under_10' GROUP BY T2.school_city ORDER BY COUNT(T2.schoolid) DESC LIMIT 1
Write SQL query to solve given problem: What is the project title of the school located at latitude 42003718 and longitude -87668289?. Keep the solution inside sql tag ```sql [SQL-Query] ```
donor
SELECT T1.title FROM essays AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T2.school_latitude = 42003718 AND T2.school_longitude = -87668289
Write SQL query to solve given problem: Find out if the project with the title Team More Books! has a New York teaching fellow.. Keep the solution inside sql tag ```sql [SQL-Query] ```
donor
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!'
Write SQL query to solve given problem: What is the name of the vendors that serve resources to schools whose primary focus area is Literature?. Keep the solution inside sql tag ```sql [SQL-Query] ```
donor
SELECT T1.vendor_name FROM resources AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T2.primary_focus_area LIKE 'Literacy%' GROUP BY T1.vendor_name ORDER BY COUNT(T2.primary_focus_area) DESC LIMIT 1
Write SQL query to solve given problem: What is the name of the vendors serving material for projects for grades 9-12?. Keep the solution inside sql tag ```sql [SQL-Query] ```
donor
SELECT DISTINCT T1.vendor_name FROM resources AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T2.grade_level = 'Grades 9-12'
Write SQL query to solve given problem: How many teachers have made some type of donation for projects in Chicago?. Keep the solution inside sql tag ```sql [SQL-Query] ```
donor
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'
Write SQL query to solve given problem: How many Rock Hill City School projects have teacher donors?. Keep the solution inside sql tag ```sql [SQL-Query] ```
donor
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'
Write SQL query to solve given problem: What is the total sum of the donations paid with an optional support in projects that reach more than 300 students?. Keep the solution inside sql tag ```sql [SQL-Query] ```
donor
SELECT SUM(T2.dollar_amount) FROM projects AS T1 INNER JOIN donations AS T2 ON T1.projectid = T2.projectid WHERE T1.students_reached > 300 AND t2.donation_included_optional_support = 't'
Write SQL query to solve given problem: How many total items were requested for the Onslow Co School District urban metro school projects?. Keep the solution inside sql tag ```sql [SQL-Query] ```
donor
SELECT SUM(T1.item_quantity) FROM resources AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T2.school_metro = 'urban' AND T2.school_district = 'Onslow Co School District'
Write SQL query to solve given problem: What is the average total donations received by Fresno County colleges?. Keep the solution inside sql tag ```sql [SQL-Query] ```
donor
SELECT SUM(T2.donation_optional_support + T2.donation_to_project) / COUNT(donationid) FROM projects AS T1 INNER JOIN donations AS T2 ON T1.projectid = T2.projectid WHERE T1.school_county = 'Fresno'
Write SQL query to solve given problem: In what percentage of counties has the ABC Read project been launched?. Keep the solution inside sql tag ```sql [SQL-Query] ```
donor
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
Write SQL query to solve given problem: What is the average amount of resources from projects that have received donations per honoree?. Keep the solution inside sql tag ```sql [SQL-Query] ```
donor
SELECT AVG(T1.item_quantity) FROM resources AS T1 INNER JOIN donations AS T2 ON T1.projectid = T2.projectid WHERE T2.for_honoree = 't'
Write SQL query to solve given problem: When did the project "Photojournalists Want to Exhibit Their Best Works" go live?. Keep the solution inside sql tag ```sql [SQL-Query] ```
donor
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'
Write SQL query to solve given problem: Which item provided for projects with Mathematics as a primary subject is the most expensive?. Keep the solution inside sql tag ```sql [SQL-Query] ```
donor
SELECT T1.item_name FROM resources AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T2.primary_focus_subject = 'Mathematics' ORDER BY T1.item_unit_price DESC LIMIT 1
Write SQL query to solve given problem: Where is the school that needs a "Viewscreen LCD from Texas Instruments, TI-84 Plus"? Provide the latitude and longitude of that school.. Keep the solution inside sql tag ```sql [SQL-Query] ```
donor
SELECT T2.school_city, T2.school_latitude, T2.school_longitude FROM resources AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T1.item_name = 'Viewscreen LCD FROM Texas Instruments, TI-84 Plus'
Write SQL query to solve given problem: How many donations does the project "Look, Look, We Need a Nook!" have?. Keep the solution inside sql tag ```sql [SQL-Query] ```
donor
SELECT SUM(T3.donation_total) FROM essays AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid INNER JOIN donations AS T3 ON T2.projectid = T3.projectid WHERE T1.title = 'Look, Look, We Need a Nook!'
Write SQL query to solve given problem: List the poverty level of all the schools that received donations with the zip code "7079".. Keep the solution inside sql tag ```sql [SQL-Query] ```
donor
SELECT DISTINCT T2.poverty_level FROM donations AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T1.donor_zip = 7079
Write SQL query to solve given problem: What is the name of the vendor that the project "Bloody Times" uses for their resources?. Keep the solution inside sql tag ```sql [SQL-Query] ```
donor
SELECT T3.vendor_name FROM essays AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid INNER JOIN resources AS T3 ON T2.projectid = T3.projectid WHERE T1.title = 'Bloody Times'
Write SQL query to solve given problem: List all the items from "Sax Arts & Crafts" and the zip code of the schools that received them.. Keep the solution inside sql tag ```sql [SQL-Query] ```
donor
SELECT T2.school_zip, T1.item_name FROM resources AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T1.vendor_name = 'Sax Arts & Crafts'
Write SQL query to solve given problem: What are the coordinates of the school with the project "Wiping Away Bad Grades"?. Keep the solution inside sql tag ```sql [SQL-Query] ```
donor
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'
Write SQL query to solve given problem: List the primary subject of all the donations with a corporate sponsored giftcard.. Keep the solution inside sql tag ```sql [SQL-Query] ```
donor
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'
Write SQL query to solve given problem: What is the most expensive book item? Please provide a short description of projects related to those.. Keep the solution inside sql tag ```sql [SQL-Query] ```
donor
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
Write SQL query to solve given problem: For what grade was the project "Too Close for Comfort" for?. Keep the solution inside sql tag ```sql [SQL-Query] ```
donor
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'
Write SQL query to solve given problem: What is the total number of students impacted by the projects with a donation from a donor with zip code "22205"?. Keep the solution inside sql tag ```sql [SQL-Query] ```
donor
SELECT SUM(T2.students_reached) FROM donations AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T1.donor_zip = 22205
Write SQL query to solve given problem: What percentage of donations are given via a giving or campaign page? List the primary area of those donations.. Keep the solution inside sql tag ```sql [SQL-Query] ```
donor
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
Write SQL query to solve given problem: Among the technology items, what percentage of them are from Best Buy for Business? Provide the date of the project related to those items.. Keep the solution inside sql tag ```sql [SQL-Query] ```
donor
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 resources AS T2 ON T1.projectid = T2.projectid WHERE T2.vendor_name = 'Best Buy for Business' AND T2.project_resource_type = 'Technology'
Write SQL query to solve given problem: How many more games were sold on game platform ID 50 than on game platform ID 51 in region ID 1?. Keep the solution inside sql tag ```sql [SQL-Query] ```
video_games
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
Write SQL query to solve given problem: Please list all the games that have the same game genre as 3D Lemmings.. Keep the solution inside sql tag ```sql [SQL-Query] ```
video_games
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' )
Write SQL query to solve given problem: How many action games are there in total?. Keep the solution inside sql tag ```sql [SQL-Query] ```
video_games
SELECT COUNT(T1.id) FROM game AS T1 INNER JOIN genre AS T2 ON T1.genre_id = T2.id WHERE T2.genre_name = 'Action'
Write SQL query to solve given problem: What is the genre of 3D Lemmings?. Keep the solution inside sql tag ```sql [SQL-Query] ```
video_games
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'
Write SQL query to solve given problem: Who is the publisher of 3D Lemmings?. Keep the solution inside sql tag ```sql [SQL-Query] ```
video_games
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'
Write SQL query to solve given problem: Please list the names of all the games published by 10TACLE Studios.. Keep the solution inside sql tag ```sql [SQL-Query] ```
video_games
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'
Write SQL query to solve given problem: Among the games published by 10TACLE Studios, how many of them are puzzles?. Keep the solution inside sql tag ```sql [SQL-Query] ```
video_games
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'
Write SQL query to solve given problem: Please list the names of all the games published by 10TACLE Studios and are puzzles.. Keep the solution inside sql tag ```sql [SQL-Query] ```
video_games
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'
Write SQL query to solve given problem: Which publisher has published the most games?. Keep the solution inside sql tag ```sql [SQL-Query] ```
video_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
Write SQL query to solve given problem: On which platform was Panzer Tactics released in 2007?. Keep the solution inside sql tag ```sql [SQL-Query] ```
video_games
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
Write SQL query to solve given problem: In which year was Panzer Tactics released on DS?. Keep the solution inside sql tag ```sql [SQL-Query] ```
video_games
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'
Write SQL query to solve given problem: Please list the names of the publishers of all the puzzle games.. Keep the solution inside sql tag ```sql [SQL-Query] ```
video_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'
Write SQL query to solve given problem: What is the name of the publisher that has published the most puzzle games?. Keep the solution inside sql tag ```sql [SQL-Query] ```
video_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 COUNT(DISTINCT T1.id) DESC LIMIT 1 ) t
Write SQL query to solve given problem: How many publishers have published more than 3 puzzle games?. Keep the solution inside sql tag ```sql [SQL-Query] ```
video_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 COUNT(DISTINCT T1.id) > 3 ) t
Write SQL query to solve given problem: Among the games published by Nintendo, what is the percentage of those in the genre of sports?. Keep the solution inside sql tag ```sql [SQL-Query] ```
video_games
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'
Write SQL query to solve given problem: How many games were sold on the DS platform on average in the 4 different regions?. Keep the solution inside sql tag ```sql [SQL-Query] ```
video_games
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'
Write SQL query to solve given problem: Tell the number of games whose publisher id is 352.. Keep the solution inside sql tag ```sql [SQL-Query] ```
video_games
SELECT DISTINCT T.game_id FROM game_publisher AS T WHERE T.publisher_id = 352
Write SQL query to solve given problem: List the genre id of the game Pro Evolution Soccer 2012.. Keep the solution inside sql tag ```sql [SQL-Query] ```
video_games
SELECT T.genre_id FROM game AS T WHERE T.game_name = 'Pro Evolution Soccer 2012'
Write SQL query to solve given problem: State the region id of Japan.. Keep the solution inside sql tag ```sql [SQL-Query] ```
video_games
SELECT T.id FROM region AS T WHERE T.region_name = 'Japan'
Write SQL query to solve given problem: Show the id of the game platform with the most sales in region 2.. Keep the solution inside sql tag ```sql [SQL-Query] ```
video_games
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
Write SQL query to solve given problem: Which genre has the most games? Show its id.. Keep the solution inside sql tag ```sql [SQL-Query] ```
video_games
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 )
Write SQL query to solve given problem: What is the id of the game "Resident Evil Archives: Resident Evil"?. Keep the solution inside sql tag ```sql [SQL-Query] ```
video_games
SELECT T.genre_id FROM game AS T WHERE T.game_name = 'Resident Evil Archives: Resident Evil'
Write SQL query to solve given problem: Show the number of games which were released on X360 in 2010.. Keep the solution inside sql tag ```sql [SQL-Query] ```
video_games
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
Write SQL query to solve given problem: State the publisher name of the game "ModNation Racers".. Keep the solution inside sql tag ```sql [SQL-Query] ```
video_games
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'
Write SQL query to solve given problem: Show the id of game platform which makes the most sales in Japan.. Keep the solution inside sql tag ```sql [SQL-Query] ```
video_games
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
Write SQL query to solve given problem: How many platforms are available for the game Pro Evolution Soccer 2016?. Keep the solution inside sql tag ```sql [SQL-Query] ```
video_games
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'
Write SQL query to solve given problem: How many games in the database belong to the genre of sports?. Keep the solution inside sql tag ```sql [SQL-Query] ```
video_games
SELECT COUNT(T1.id) FROM game AS T1 INNER JOIN genre AS T2 ON T1.genre_id = T2.id WHERE T2.genre_name = 'Sports'
Write SQL query to solve given problem: Name of the publisher of the game id 10031.. Keep the solution inside sql tag ```sql [SQL-Query] ```
video_games
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
Write SQL query to solve given problem: State the name of the publisher with the most games.. Keep the solution inside sql tag ```sql [SQL-Query] ```
video_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
Write SQL query to solve given problem: How many more sports games than simulation games?. Keep the solution inside sql tag ```sql [SQL-Query] ```
video_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
Write SQL query to solve given problem: Tell the genre of the game "Resident Evil: Revelations".. Keep the solution inside sql tag ```sql [SQL-Query] ```
video_games
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'
Write SQL query to solve given problem: How many sales does game platform id 3871 make in Europe?. Keep the solution inside sql tag ```sql [SQL-Query] ```
video_games
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
Write SQL query to solve given problem: Give the number of games which were published by Ascaron Entertainment GmbH.. Keep the solution inside sql tag ```sql [SQL-Query] ```
video_games
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'
Write SQL query to solve given problem: Show the name of the earliest platform in the database.. Keep the solution inside sql tag ```sql [SQL-Query] ```
video_games
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
Write SQL query to solve given problem: For all the games which were published by Namco Bandai Games, what percentage of them were adventure games?. Keep the solution inside sql tag ```sql [SQL-Query] ```
video_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'
Write SQL query to solve given problem: How many times more is the number of games which were published by Atari than Athena?. Keep the solution inside sql tag ```sql [SQL-Query] ```
video_games
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
Write SQL query to solve given problem: How many games did Electronic Arts publish?. Keep the solution inside sql tag ```sql [SQL-Query] ```
video_games
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'
Write SQL query to solve given problem: What is the genre of the Advent Rising game?. Keep the solution inside sql tag ```sql [SQL-Query] ```
video_games
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'
Write SQL query to solve given problem: How many role-playing games did Microsoft Game Studios publish?. Keep the solution inside sql tag ```sql [SQL-Query] ```
video_games
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'
Write SQL query to solve given problem: Which publisher published the most games?. Keep the solution inside sql tag ```sql [SQL-Query] ```
video_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
Write SQL query to solve given problem: In 2004, what are the names of the platforms where Codemasters publish its games?. Keep the solution inside sql tag ```sql [SQL-Query] ```
video_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'
Write SQL query to solve given problem: How many games were released on PS4 in 2014?. Keep the solution inside sql tag ```sql [SQL-Query] ```
video_games
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
Write SQL query to solve given problem: What are the names of the publishers who published the oldest games?. Keep the solution inside sql tag ```sql [SQL-Query] ```
video_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
Write SQL query to solve given problem: How many publishers in Japan released a game on X360 in 2011?. Keep the solution inside sql tag ```sql [SQL-Query] ```
video_games
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'
Write SQL query to solve given problem: Which game platform is the most popular in Europe?. Keep the solution inside sql tag ```sql [SQL-Query] ```
video_games
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 LIMIT 1 ) t
Write SQL query to solve given problem: Which year has the most number of PC games releases?. Keep the solution inside sql tag ```sql [SQL-Query] ```
video_games
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