1sf/bird-sql-train-with-schema huggingface dataset:
Database: donor
Tables: essays, projects, donations, resources
Columns (table index, column name): -1, *, 0, projectid, 0, teacher_acctid, 0, title, 0, short_description, 0, need_statement, 0, essay, 1, projectid, 1, teacher_acctid, 1, schoolid, 1, school_ncesid, 1, school_latitude, 1, school_longitude, 1, school_city, 1, school_state, 1, school_zip, 1, school_metro, 1, school_district, 1, school_county, 1, school_charter, 1, school_magnet, 1, school_year_round, 1, school_nlns, 1, school_kipp, 1, school_charter_ready_promise, 1, teacher_prefix, 1, teacher_teach_for_america, 1, teacher_ny_teaching_fellow, 1, primary_focus_subject, 1, primary_focus_area, 1, secondary_focus_subject, 1, secondary_focus_area, 1, resource_type, 1, poverty_level, 1, grade_level, 1, fulfillment_labor_materials, 1, total_price_excluding_optional_support, 1, total_price_including_optional_support, 1, students_reached, 1, eligible_double_your_impact_match, 1, eligible_almost_home_match, 1, date_posted, 2, donationid, 2, projectid, 2, donor_acctid, 2, donor_city, 2, donor_state, 2, donor_zip, 2, is_teacher_acct, 2, donation_timestamp, 2, donation_to_project, 2, donation_optional_support, 2, donation_total, 2, dollar_amount, 2, donation_included_optional_support, 2, payment_method, 2, payment_included_acct_credit, 2, payment_included_campaign_gift_card, 2, payment_included_web_purchased_gift_card, 2, payment_was_promo_matched, 2, via_giving_page, 2, for_honoree, 2, donation_message, 3, resourceid, 3, projectid, 3, vendorid, 3, vendor_name, 3, project_resource_type, 3, item_name, 3, item_number, 3, item_unit_price, 3, item_quantity
Question: List the primary subject of all the donations with a corporate sponsored giftcard.
Evidence: corporate sponsored giftcard refers to payment_included_campaign_gift_card = 't'; primary subject refers to primary_focus_subject
SQL: 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'
Database: donor
Tables: essays, projects, donations, resources
Columns (table index, column name): -1, *, 0, projectid, 0, teacher_acctid, 0, title, 0, short_description, 0, need_statement, 0, essay, 1, projectid, 1, teacher_acctid, 1, schoolid, 1, school_ncesid, 1, school_latitude, 1, school_longitude, 1, school_city, 1, school_state, 1, school_zip, 1, school_metro, 1, school_district, 1, school_county, 1, school_charter, 1, school_magnet, 1, school_year_round, 1, school_nlns, 1, school_kipp, 1, school_charter_ready_promise, 1, teacher_prefix, 1, teacher_teach_for_america, 1, teacher_ny_teaching_fellow, 1, primary_focus_subject, 1, primary_focus_area, 1, secondary_focus_subject, 1, secondary_focus_area, 1, resource_type, 1, poverty_level, 1, grade_level, 1, fulfillment_labor_materials, 1, total_price_excluding_optional_support, 1, total_price_including_optional_support, 1, students_reached, 1, eligible_double_your_impact_match, 1, eligible_almost_home_match, 1, date_posted, 2, donationid, 2, projectid, 2, donor_acctid, 2, donor_city, 2, donor_state, 2, donor_zip, 2, is_teacher_acct, 2, donation_timestamp, 2, donation_to_project, 2, donation_optional_support, 2, donation_total, 2, dollar_amount, 2, donation_included_optional_support, 2, payment_method, 2, payment_included_acct_credit, 2, payment_included_campaign_gift_card, 2, payment_included_web_purchased_gift_card, 2, payment_was_promo_matched, 2, via_giving_page, 2, for_honoree, 2, donation_message, 3, resourceid, 3, projectid, 3, vendorid, 3, vendor_name, 3, project_resource_type, 3, item_name, 3, item_number, 3, item_unit_price, 3, item_quantity
Question: What is the most expensive book item? Please provide a short description of projects related to those.
Evidence: book item refers to project_resource_type = 'Books'; most expensive refers to MAX(item_unit_price)
SQL: 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
Database: donor
Tables: essays, projects, donations, resources
Columns (table index, column name): -1, *, 0, projectid, 0, teacher_acctid, 0, title, 0, short_description, 0, need_statement, 0, essay, 1, projectid, 1, teacher_acctid, 1, schoolid, 1, school_ncesid, 1, school_latitude, 1, school_longitude, 1, school_city, 1, school_state, 1, school_zip, 1, school_metro, 1, school_district, 1, school_county, 1, school_charter, 1, school_magnet, 1, school_year_round, 1, school_nlns, 1, school_kipp, 1, school_charter_ready_promise, 1, teacher_prefix, 1, teacher_teach_for_america, 1, teacher_ny_teaching_fellow, 1, primary_focus_subject, 1, primary_focus_area, 1, secondary_focus_subject, 1, secondary_focus_area, 1, resource_type, 1, poverty_level, 1, grade_level, 1, fulfillment_labor_materials, 1, total_price_excluding_optional_support, 1, total_price_including_optional_support, 1, students_reached, 1, eligible_double_your_impact_match, 1, eligible_almost_home_match, 1, date_posted, 2, donationid, 2, projectid, 2, donor_acctid, 2, donor_city, 2, donor_state, 2, donor_zip, 2, is_teacher_acct, 2, donation_timestamp, 2, donation_to_project, 2, donation_optional_support, 2, donation_total, 2, dollar_amount, 2, donation_included_optional_support, 2, payment_method, 2, payment_included_acct_credit, 2, payment_included_campaign_gift_card, 2, payment_included_web_purchased_gift_card, 2, payment_was_promo_matched, 2, via_giving_page, 2, for_honoree, 2, donation_message, 3, resourceid, 3, projectid, 3, vendorid, 3, vendor_name, 3, project_resource_type, 3, item_name, 3, item_number, 3, item_unit_price, 3, item_quantity
Question: For what grade was the project "Too Close for Comfort" for?
Evidence: project "Too Close for Comfort" refers to title = 'Too Close for Comfort'; grade refers to grade_level
SQL: 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'
Database: donor
Tables: essays, projects, donations, resources
Columns (table index, column name): -1, *, 0, projectid, 0, teacher_acctid, 0, title, 0, short_description, 0, need_statement, 0, essay, 1, projectid, 1, teacher_acctid, 1, schoolid, 1, school_ncesid, 1, school_latitude, 1, school_longitude, 1, school_city, 1, school_state, 1, school_zip, 1, school_metro, 1, school_district, 1, school_county, 1, school_charter, 1, school_magnet, 1, school_year_round, 1, school_nlns, 1, school_kipp, 1, school_charter_ready_promise, 1, teacher_prefix, 1, teacher_teach_for_america, 1, teacher_ny_teaching_fellow, 1, primary_focus_subject, 1, primary_focus_area, 1, secondary_focus_subject, 1, secondary_focus_area, 1, resource_type, 1, poverty_level, 1, grade_level, 1, fulfillment_labor_materials, 1, total_price_excluding_optional_support, 1, total_price_including_optional_support, 1, students_reached, 1, eligible_double_your_impact_match, 1, eligible_almost_home_match, 1, date_posted, 2, donationid, 2, projectid, 2, donor_acctid, 2, donor_city, 2, donor_state, 2, donor_zip, 2, is_teacher_acct, 2, donation_timestamp, 2, donation_to_project, 2, donation_optional_support, 2, donation_total, 2, dollar_amount, 2, donation_included_optional_support, 2, payment_method, 2, payment_included_acct_credit, 2, payment_included_campaign_gift_card, 2, payment_included_web_purchased_gift_card, 2, payment_was_promo_matched, 2, via_giving_page, 2, for_honoree, 2, donation_message, 3, resourceid, 3, projectid, 3, vendorid, 3, vendor_name, 3, project_resource_type, 3, item_name, 3, item_number, 3, item_unit_price, 3, item_quantity
Question: What is the total number of students impacted by the projects with a donation from a donor with zip code "22205"?
Evidence: zip code "22205" refers to donor_zip = '22205'; students impacted refers to students_reached
SQL: SELECT SUM(T2.students_reached) FROM donations AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T1.donor_zip = 22205
Database: donor
Tables: essays, projects, donations, resources
Columns (table index, column name): -1, *, 0, projectid, 0, teacher_acctid, 0, title, 0, short_description, 0, need_statement, 0, essay, 1, projectid, 1, teacher_acctid, 1, schoolid, 1, school_ncesid, 1, school_latitude, 1, school_longitude, 1, school_city, 1, school_state, 1, school_zip, 1, school_metro, 1, school_district, 1, school_county, 1, school_charter, 1, school_magnet, 1, school_year_round, 1, school_nlns, 1, school_kipp, 1, school_charter_ready_promise, 1, teacher_prefix, 1, teacher_teach_for_america, 1, teacher_ny_teaching_fellow, 1, primary_focus_subject, 1, primary_focus_area, 1, secondary_focus_subject, 1, secondary_focus_area, 1, resource_type, 1, poverty_level, 1, grade_level, 1, fulfillment_labor_materials, 1, total_price_excluding_optional_support, 1, total_price_including_optional_support, 1, students_reached, 1, eligible_double_your_impact_match, 1, eligible_almost_home_match, 1, date_posted, 2, donationid, 2, projectid, 2, donor_acctid, 2, donor_city, 2, donor_state, 2, donor_zip, 2, is_teacher_acct, 2, donation_timestamp, 2, donation_to_project, 2, donation_optional_support, 2, donation_total, 2, dollar_amount, 2, donation_included_optional_support, 2, payment_method, 2, payment_included_acct_credit, 2, payment_included_campaign_gift_card, 2, payment_included_web_purchased_gift_card, 2, payment_was_promo_matched, 2, via_giving_page, 2, for_honoree, 2, donation_message, 3, resourceid, 3, projectid, 3, vendorid, 3, vendor_name, 3, project_resource_type, 3, item_name, 3, item_number, 3, item_unit_price, 3, item_quantity
Question: What percentage of donations are given via a giving or campaign page? List the primary area of those donations.
Evidence: 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
SQL: 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
Database: donor
Tables: essays, projects, donations, resources
Columns (table index, column name): -1, *, 0, projectid, 0, teacher_acctid, 0, title, 0, short_description, 0, need_statement, 0, essay, 1, projectid, 1, teacher_acctid, 1, schoolid, 1, school_ncesid, 1, school_latitude, 1, school_longitude, 1, school_city, 1, school_state, 1, school_zip, 1, school_metro, 1, school_district, 1, school_county, 1, school_charter, 1, school_magnet, 1, school_year_round, 1, school_nlns, 1, school_kipp, 1, school_charter_ready_promise, 1, teacher_prefix, 1, teacher_teach_for_america, 1, teacher_ny_teaching_fellow, 1, primary_focus_subject, 1, primary_focus_area, 1, secondary_focus_subject, 1, secondary_focus_area, 1, resource_type, 1, poverty_level, 1, grade_level, 1, fulfillment_labor_materials, 1, total_price_excluding_optional_support, 1, total_price_including_optional_support, 1, students_reached, 1, eligible_double_your_impact_match, 1, eligible_almost_home_match, 1, date_posted, 2, donationid, 2, projectid, 2, donor_acctid, 2, donor_city, 2, donor_state, 2, donor_zip, 2, is_teacher_acct, 2, donation_timestamp, 2, donation_to_project, 2, donation_optional_support, 2, donation_total, 2, dollar_amount, 2, donation_included_optional_support, 2, payment_method, 2, payment_included_acct_credit, 2, payment_included_campaign_gift_card, 2, payment_included_web_purchased_gift_card, 2, payment_was_promo_matched, 2, via_giving_page, 2, for_honoree, 2, donation_message, 3, resourceid, 3, projectid, 3, vendorid, 3, vendor_name, 3, project_resource_type, 3, item_name, 3, item_number, 3, item_unit_price, 3, item_quantity
Question: Among the technology items, what percentage of them are from Best Buy for Business? Provide the date of the project related to those items.
Evidence: technology items refers to project_resource_type = 'Technology'; from Best Buy for Business refers to vendor_name = 'Best Buy for Business'; percentage refers to DIVIDE(count(case when vendor_name = 'Best Buy for Business'),count(projectid))
SQL: 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'
Database: video_games
Tables: genre, game, platform, publisher, game_publisher, game_platform, region, region_sales
Columns (table index, column name): -1, *, 0, id, 0, genre_name, 1, id, 1, genre_id, 1, game_name, 2, id, 2, platform_name, 3, id, 3, publisher_name, 4, id, 4, game_id, 4, publisher_id, 5, id, 5, game_publisher_id, 5, platform_id, 5, release_year, 6, id, 6, region_name, 7, region_id, 7, game_platform_id, 7, num_sales
Question: How many more games were sold on game platform ID 50 than on game platform ID 51 in region ID 1?
Evidence: result = subtract(sum(num_sales where game_platform_id = 50), sum(num_sales where game_platform_id = 51))
SQL: 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
Database: video_games
Tables: genre, game, platform, publisher, game_publisher, game_platform, region, region_sales
Columns (table index, column name): -1, *, 0, id, 0, genre_name, 1, id, 1, genre_id, 1, game_name, 2, id, 2, platform_name, 3, id, 3, publisher_name, 4, id, 4, game_id, 4, publisher_id, 5, id, 5, game_publisher_id, 5, platform_id, 5, release_year, 6, id, 6, region_name, 7, region_id, 7, game_platform_id, 7, num_sales
Question: Please list all the games that have the same game genre as 3D Lemmings.
Evidence: game refers to game_name; 3D Lemmings refers to game_name = '3D Lemmings'
SQL: 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' )
Database: video_games
Tables: genre, game, platform, publisher, game_publisher, game_platform, region, region_sales
Columns (table index, column name): -1, *, 0, id, 0, genre_name, 1, id, 1, genre_id, 1, game_name, 2, id, 2, platform_name, 3, id, 3, publisher_name, 4, id, 4, game_id, 4, publisher_id, 5, id, 5, game_publisher_id, 5, platform_id, 5, release_year, 6, id, 6, region_name, 7, region_id, 7, game_platform_id, 7, num_sales
Question: How many action games are there in total?
Evidence: action game refers to genre_name = 'Action'
SQL: SELECT COUNT(T1.id) FROM game AS T1 INNER JOIN genre AS T2 ON T1.genre_id = T2.id WHERE T2.genre_name = 'Action'
Database: video_games
Tables: genre, game, platform, publisher, game_publisher, game_platform, region, region_sales
Columns (table index, column name): -1, *, 0, id, 0, genre_name, 1, id, 1, genre_id, 1, game_name, 2, id, 2, platform_name, 3, id, 3, publisher_name, 4, id, 4, game_id, 4, publisher_id, 5, id, 5, game_publisher_id, 5, platform_id, 5, release_year, 6, id, 6, region_name, 7, region_id, 7, game_platform_id, 7, num_sales
Question: What is the genre of 3D Lemmings?
Evidence: genre refers to genre_name; 3D Lemmings refers to game_name = '3D Lemmings'
SQL: 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'
Database: video_games
Tables: genre, game, platform, publisher, game_publisher, game_platform, region, region_sales
Columns (table index, column name): -1, *, 0, id, 0, genre_name, 1, id, 1, genre_id, 1, game_name, 2, id, 2, platform_name, 3, id, 3, publisher_name, 4, id, 4, game_id, 4, publisher_id, 5, id, 5, game_publisher_id, 5, platform_id, 5, release_year, 6, id, 6, region_name, 7, region_id, 7, game_platform_id, 7, num_sales
Question: Who is the publisher of 3D Lemmings?
Evidence: publisher refers to publisher_name; 3D Lemmings refers to game_name = '3D Lemmings'
SQL: 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'
Database: video_games
Tables: genre, game, platform, publisher, game_publisher, game_platform, region, region_sales
Columns (table index, column name): -1, *, 0, id, 0, genre_name, 1, id, 1, genre_id, 1, game_name, 2, id, 2, platform_name, 3, id, 3, publisher_name, 4, id, 4, game_id, 4, publisher_id, 5, id, 5, game_publisher_id, 5, platform_id, 5, release_year, 6, id, 6, region_name, 7, region_id, 7, game_platform_id, 7, num_sales
Question: Please list the names of all the games published by 10TACLE Studios.
Evidence: name refers to game_name; published by 10TACLE Studios refers to publisher_name = '10TACLE Studios'
SQL: 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'
Database: video_games
Tables: genre, game, platform, publisher, game_publisher, game_platform, region, region_sales
Columns (table index, column name): -1, *, 0, id, 0, genre_name, 1, id, 1, genre_id, 1, game_name, 2, id, 2, platform_name, 3, id, 3, publisher_name, 4, id, 4, game_id, 4, publisher_id, 5, id, 5, game_publisher_id, 5, platform_id, 5, release_year, 6, id, 6, region_name, 7, region_id, 7, game_platform_id, 7, num_sales
Question: Among the games published by 10TACLE Studios, how many of them are puzzles?
Evidence: published by 10TACLE Studios refers to publisher_name = '10TACLE Studios'; puzzle refers to genre_name = 'Puzzle'
SQL: 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'
Database: video_games
Tables: genre, game, platform, publisher, game_publisher, game_platform, region, region_sales
Columns (table index, column name): -1, *, 0, id, 0, genre_name, 1, id, 1, genre_id, 1, game_name, 2, id, 2, platform_name, 3, id, 3, publisher_name, 4, id, 4, game_id, 4, publisher_id, 5, id, 5, game_publisher_id, 5, platform_id, 5, release_year, 6, id, 6, region_name, 7, region_id, 7, game_platform_id, 7, num_sales
Question: Please list the names of all the games published by 10TACLE Studios and are puzzles.
Evidence: name refers to game_name; published by 10TACLE Studios refers to publisher_name = '10TACLE Studios'; puzzle refers to genre_name = 'Puzzle'
SQL: 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'
Database: video_games
Tables: genre, game, platform, publisher, game_publisher, game_platform, region, region_sales
Columns (table index, column name): -1, *, 0, id, 0, genre_name, 1, id, 1, genre_id, 1, game_name, 2, id, 2, platform_name, 3, id, 3, publisher_name, 4, id, 4, game_id, 4, publisher_id, 5, id, 5, game_publisher_id, 5, platform_id, 5, release_year, 6, id, 6, region_name, 7, region_id, 7, game_platform_id, 7, num_sales
Question: Which publisher has published the most games?
Evidence: publisher refers to publisher_name; the most games refers to max(count(game_id))
SQL: 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
Database: video_games
Tables: genre, game, platform, publisher, game_publisher, game_platform, region, region_sales
Columns (table index, column name): -1, *, 0, id, 0, genre_name, 1, id, 1, genre_id, 1, game_name, 2, id, 2, platform_name, 3, id, 3, publisher_name, 4, id, 4, game_id, 4, publisher_id, 5, id, 5, game_publisher_id, 5, platform_id, 5, release_year, 6, id, 6, region_name, 7, region_id, 7, game_platform_id, 7, num_sales
Question: On which platform was Panzer Tactics released in 2007?
Evidence: platform refers to platform_name; Panzer Tactics refers to game_name = 'Panzer Tactics'; released in 2007 refers to release_year = 2007
SQL: 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
Database: video_games
Tables: genre, game, platform, publisher, game_publisher, game_platform, region, region_sales
Columns (table index, column name): -1, *, 0, id, 0, genre_name, 1, id, 1, genre_id, 1, game_name, 2, id, 2, platform_name, 3, id, 3, publisher_name, 4, id, 4, game_id, 4, publisher_id, 5, id, 5, game_publisher_id, 5, platform_id, 5, release_year, 6, id, 6, region_name, 7, region_id, 7, game_platform_id, 7, num_sales
Question: In which year was Panzer Tactics released on DS?
Evidence: year refers to release_year; Panzer Tactics refers to game_name = 'Panzer Tactics'; on DS refers to platform_name = 'DS'
SQL: 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'
Database: video_games
Tables: genre, game, platform, publisher, game_publisher, game_platform, region, region_sales
Columns (table index, column name): -1, *, 0, id, 0, genre_name, 1, id, 1, genre_id, 1, game_name, 2, id, 2, platform_name, 3, id, 3, publisher_name, 4, id, 4, game_id, 4, publisher_id, 5, id, 5, game_publisher_id, 5, platform_id, 5, release_year, 6, id, 6, region_name, 7, region_id, 7, game_platform_id, 7, num_sales
Question: Please list the names of the publishers of all the puzzle games.
Evidence: name of publisher refers to publisher_name; puzzle refers to genre_name = 'Puzzle'
SQL: 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'
Database: video_games
Tables: genre, game, platform, publisher, game_publisher, game_platform, region, region_sales
Columns (table index, column name): -1, *, 0, id, 0, genre_name, 1, id, 1, genre_id, 1, game_name, 2, id, 2, platform_name, 3, id, 3, publisher_name, 4, id, 4, game_id, 4, publisher_id, 5, id, 5, game_publisher_id, 5, platform_id, 5, release_year, 6, id, 6, region_name, 7, region_id, 7, game_platform_id, 7, num_sales
Question: What is the name of the publisher that has published the most puzzle games?
Evidence: 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'))
SQL: 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