data_source stringclasses 1 value | prompt listlengths 2 2 | ability stringclasses 1 value | reward_model dict | extra_info dict |
|---|---|---|---|---|
nl2sql | [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE resources (\n resourceid text, -- example: ['0000037fecc4461faf0e49328ae66661', '0000046b69c683354ca46b30db5c558e']\n projectid text, -- example: ['ffffc4f85b60efc5b52347df489d0238', 'ffffac55ee02a49d1abc87ba6fc61135']\n vendorid integer, -- example: [430, 82]\n item_name text, -- example: ['TT992 - Refill Pack for Safety Name Tags', 'Refill Pack', 'Brooklyn', 'Schools', 'Request', 'iPod nano 4th Gen 8GB (Black)']\n PRIMARY KEY (resourceid),\n CONSTRAINT fk_resources_projectid FOREIGN KEY (projectid) REFERENCES projects (projectid)\n);\n\nCREATE TABLE donations (\n donationid text, -- example: ['000000a91a14ed37bef82e125c102e77', '000013be53ed7382ed5d5975eb86eb85']\n projectid text, -- example: ['ffffac55ee02a49d1abc87ba6fc61135', 'ffff97ed93720407d70a2787475932b0']\n donor_acctid text, -- donor accid, example: ['22cbc920c9b5fa08dfb331422f5926b5', '521f1830a77c9dbbf8119d99c6206a16']\n donor_city text, -- example: ['Donation', 'brooklyn', 'BROOKLYN', 'bROOKLYN', 'Brooklyn', 'Many']\n donor_state text, -- example: ['GA', 'MD']\n donor_zip text, -- example: ['30269', '20853']\n donation_timestamp datetime, -- example: ['2011-08-25 14:27:34.807', '2011-11-04 07:54:21.552']\n donation_to_project real, -- example: [42.5, 26.83]\n payment_method text, -- example: ['no_cash_received', 'creditcard']\n payment_included_acct_credit text, -- example: ['f', 't']\n via_giving_page text, -- example: ['f', 't']\n for_honoree text, -- example: ['f', 't']\n donation_message text, -- example: ['donation', 'Donation', 'TAG', 'I gave to this project because I support', 'I donated because I want to support kids']\n PRIMARY KEY (donationid),\n CONSTRAINT fk_donations_projectid FOREIGN KEY (projectid) REFERENCES projects (projectid)\n);\n\nCREATE TABLE projects (\n projectid text, -- example: ['00001ccc0e81598c4bd86bacb94d7acb', '00002bff514104264a6b798356fdd893']\n teacher_acctid text, -- example: ['42d43fa6f37314365d08692e08680973', '864eb466462bf704bf7a16a585ef296a']\n schoolid text, -- example: ['c0e6ce89b244764085691a1b8e28cb81', 'd711e47810900c96f26a5d0be30c446d']\n school_ncesid text, -- school national center for education statistics id, example: ['063627006187', '483702008193']\n school_city text, -- example: ['BROOKLYN', 'Brooklyn', 'Many', 'Selma', 'Dallas']\n school_zip integer, -- example: [93662, 75243]\n school_metro text, -- example: ['urban', 'rural']\n school_charter text, -- example: ['f', 't']\n school_charter_ready_promise text, -- example: ['f', 't']\n teacher_ny_teaching_fellow text, -- teacher_new_york_teaching_fellow, example: ['f', 't']\n primary_focus_subject text, -- example: ['Literature & Writing', 'Literacy']\n primary_focus_area text, -- example: ['Literacy & Language', 'History & Civics']\n poverty_level text, -- example: ['highest poverty', 'high poverty']\n eligible_double_your_impact_match text, -- example: ['f', 't']\n eligible_almost_home_match text, -- example: ['f', 't']\n PRIMARY KEY (projectid)\n);\n\nCREATE TABLE essays (\n projectid text, -- example: ['ffffc4f85b60efc5b52347df489d0238', 'ffffac55ee02a49d1abc87ba6fc61135']\n title text, -- example: ['iMath', \"Recording Rockin' Readers\"]\n short_description text, -- example: ['It is imperative that teachers bring tec', 'Can you imagine having to translate ever']\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nin 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'\nHow many schools in Brooklyn with urban metro and donations for an honoree have requested TT992 - Refill Pack for Safety Name Tags as a resource?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"role": "user"
}
] | nl2sql | {
"ground_truth": "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'",
"style": "rule"
} | {
"db_id": "donor.sqlite",
"gt_sql": "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'",
"index": 1600,
"question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE resources (\n resourceid text, -- example: ['0000037fecc4461faf0e49328ae66661', '0000046b69c683354ca46b30db5c558e']\n projectid text, -- example: ['ffffc4f85b60efc5b52347df489d0238', 'ffffac55ee02a49d1abc87ba6fc61135']\n vendorid integer, -- example: [430, 82]\n item_name text, -- example: ['TT992 - Refill Pack for Safety Name Tags', 'Refill Pack', 'Brooklyn', 'Schools', 'Request', 'iPod nano 4th Gen 8GB (Black)']\n PRIMARY KEY (resourceid),\n CONSTRAINT fk_resources_projectid FOREIGN KEY (projectid) REFERENCES projects (projectid)\n);\n\nCREATE TABLE donations (\n donationid text, -- example: ['000000a91a14ed37bef82e125c102e77', '000013be53ed7382ed5d5975eb86eb85']\n projectid text, -- example: ['ffffac55ee02a49d1abc87ba6fc61135', 'ffff97ed93720407d70a2787475932b0']\n donor_acctid text, -- donor accid, example: ['22cbc920c9b5fa08dfb331422f5926b5', '521f1830a77c9dbbf8119d99c6206a16']\n donor_city text, -- example: ['Donation', 'brooklyn', 'BROOKLYN', 'bROOKLYN', 'Brooklyn', 'Many']\n donor_state text, -- example: ['GA', 'MD']\n donor_zip text, -- example: ['30269', '20853']\n donation_timestamp datetime, -- example: ['2011-08-25 14:27:34.807', '2011-11-04 07:54:21.552']\n donation_to_project real, -- example: [42.5, 26.83]\n payment_method text, -- example: ['no_cash_received', 'creditcard']\n payment_included_acct_credit text, -- example: ['f', 't']\n via_giving_page text, -- example: ['f', 't']\n for_honoree text, -- example: ['f', 't']\n donation_message text, -- example: ['donation', 'Donation', 'TAG', 'I gave to this project because I support', 'I donated because I want to support kids']\n PRIMARY KEY (donationid),\n CONSTRAINT fk_donations_projectid FOREIGN KEY (projectid) REFERENCES projects (projectid)\n);\n\nCREATE TABLE projects (\n projectid text, -- example: ['00001ccc0e81598c4bd86bacb94d7acb', '00002bff514104264a6b798356fdd893']\n teacher_acctid text, -- example: ['42d43fa6f37314365d08692e08680973', '864eb466462bf704bf7a16a585ef296a']\n schoolid text, -- example: ['c0e6ce89b244764085691a1b8e28cb81', 'd711e47810900c96f26a5d0be30c446d']\n school_ncesid text, -- school national center for education statistics id, example: ['063627006187', '483702008193']\n school_city text, -- example: ['BROOKLYN', 'Brooklyn', 'Many', 'Selma', 'Dallas']\n school_zip integer, -- example: [93662, 75243]\n school_metro text, -- example: ['urban', 'rural']\n school_charter text, -- example: ['f', 't']\n school_charter_ready_promise text, -- example: ['f', 't']\n teacher_ny_teaching_fellow text, -- teacher_new_york_teaching_fellow, example: ['f', 't']\n primary_focus_subject text, -- example: ['Literature & Writing', 'Literacy']\n primary_focus_area text, -- example: ['Literacy & Language', 'History & Civics']\n poverty_level text, -- example: ['highest poverty', 'high poverty']\n eligible_double_your_impact_match text, -- example: ['f', 't']\n eligible_almost_home_match text, -- example: ['f', 't']\n PRIMARY KEY (projectid)\n);\n\nCREATE TABLE essays (\n projectid text, -- example: ['ffffc4f85b60efc5b52347df489d0238', 'ffffac55ee02a49d1abc87ba6fc61135']\n title text, -- example: ['iMath', \"Recording Rockin' Readers\"]\n short_description text, -- example: ['It is imperative that teachers bring tec', 'Can you imagine having to translate ever']\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nin 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'\nHow many schools in Brooklyn with urban metro and donations for an honoree have requested TT992 - Refill Pack for Safety Name Tags as a resource?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"split": "train"
} |
nl2sql | [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE projects (\n projectid text, -- example: ['00001ccc0e81598c4bd86bacb94d7acb', '00002bff514104264a6b798356fdd893']\n schoolid text, -- example: ['c0e6ce89b244764085691a1b8e28cb81', 'd711e47810900c96f26a5d0be30c446d']\n school_ncesid text, -- school national center for education statistics id, example: ['063627006187', '483702008193']\n school_latitude real, -- example: [36.57634, 32.911179]\n school_charter text, -- example: ['f', 't']\n school_year_round text, -- example: ['f', 't']\n teacher_prefix text, -- example: ['Mrs.', 'Mr.']\n teacher_ny_teaching_fellow text, -- teacher_new_york_teaching_fellow, example: ['f', 't']\n resource_type text, -- example: ['Books', 'Technology']\n poverty_level text, -- example: ['highest poverty', 'high poverty']\n total_price_excluding_optional_support real, -- example: [555.81, 296.47]\n eligible_double_your_impact_match text, -- example: ['f', 't']\n eligible_almost_home_match text, -- example: ['f', 't']\n PRIMARY KEY (projectid)\n);\n\nCREATE TABLE donations (\n donationid text, -- example: ['000000a91a14ed37bef82e125c102e77', '000013be53ed7382ed5d5975eb86eb85']\n projectid text, -- example: ['ffffac55ee02a49d1abc87ba6fc61135', 'ffff97ed93720407d70a2787475932b0']\n donation_timestamp datetime, -- example: ['2011-08-25 14:27:34.807', '2011-11-04 07:54:21.552']\n donation_optional_support real, -- example: [7.5, 4.73]\n dollar_amount text, -- example: ['10_to_100', 'under_10']\n donation_included_optional_support text, -- example: ['t', 'f']\n payment_included_campaign_gift_card text, -- example: ['t', 'f']\n via_giving_page text, -- example: ['f', 't']\n donation_message text, -- example: ['Gift card ', 'GIFT CARD', 'Gift Card', 'gift card', 'donation', 'Donation']\n PRIMARY KEY (donationid),\n CONSTRAINT fk_donations_projectid FOREIGN KEY (projectid) REFERENCES projects (projectid)\n);\n\nCREATE TABLE essays (\n projectid text, -- example: ['ffffc4f85b60efc5b52347df489d0238', 'ffffac55ee02a49d1abc87ba6fc61135']\n teacher_acctid text, -- example: ['c24011b20fc161ed02248e85beb59a90', '947066d0af47e0566f334566553dd6a6']\n title text, -- example: ['iMath', \"Recording Rockin' Readers\"]\n short_description text, -- example: ['It is imperative that teachers bring tec', 'Can you imagine having to translate ever']\n need_statement text, -- example: ['My students need four iPods.', 'My students need a camcorder. ']\n);\n\nCREATE TABLE resources (\n resourceid text, -- example: ['0000037fecc4461faf0e49328ae66661', '0000046b69c683354ca46b30db5c558e']\n projectid text, -- example: ['ffffc4f85b60efc5b52347df489d0238', 'ffffac55ee02a49d1abc87ba6fc61135']\n vendorid integer, -- example: [430, 82]\n vendor_name text, -- example: ['Woodwind and Brasswind', 'Best Buy for Business']\n item_name text, -- example: ['Schools', 'Gift cards', 'How Many?', 'School!', 'iPod nano 4th Gen 8GB (Black)', 'Sony bloggie MHS-FS1 - camcorder - inter']\n item_unit_price real, -- example: [149.0, 148.0]\n PRIMARY KEY (resourceid),\n CONSTRAINT fk_resources_projectid FOREIGN KEY (projectid) REFERENCES projects (projectid)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nhighest 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'\nHow many schools with the highest level of poverty have received a portion of a donation included corporate sponsored gift card?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"role": "user"
}
] | nl2sql | {
"ground_truth": "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'",
"style": "rule"
} | {
"db_id": "donor.sqlite",
"gt_sql": "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'",
"index": 1601,
"question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE projects (\n projectid text, -- example: ['00001ccc0e81598c4bd86bacb94d7acb', '00002bff514104264a6b798356fdd893']\n schoolid text, -- example: ['c0e6ce89b244764085691a1b8e28cb81', 'd711e47810900c96f26a5d0be30c446d']\n school_ncesid text, -- school national center for education statistics id, example: ['063627006187', '483702008193']\n school_latitude real, -- example: [36.57634, 32.911179]\n school_charter text, -- example: ['f', 't']\n school_year_round text, -- example: ['f', 't']\n teacher_prefix text, -- example: ['Mrs.', 'Mr.']\n teacher_ny_teaching_fellow text, -- teacher_new_york_teaching_fellow, example: ['f', 't']\n resource_type text, -- example: ['Books', 'Technology']\n poverty_level text, -- example: ['highest poverty', 'high poverty']\n total_price_excluding_optional_support real, -- example: [555.81, 296.47]\n eligible_double_your_impact_match text, -- example: ['f', 't']\n eligible_almost_home_match text, -- example: ['f', 't']\n PRIMARY KEY (projectid)\n);\n\nCREATE TABLE donations (\n donationid text, -- example: ['000000a91a14ed37bef82e125c102e77', '000013be53ed7382ed5d5975eb86eb85']\n projectid text, -- example: ['ffffac55ee02a49d1abc87ba6fc61135', 'ffff97ed93720407d70a2787475932b0']\n donation_timestamp datetime, -- example: ['2011-08-25 14:27:34.807', '2011-11-04 07:54:21.552']\n donation_optional_support real, -- example: [7.5, 4.73]\n dollar_amount text, -- example: ['10_to_100', 'under_10']\n donation_included_optional_support text, -- example: ['t', 'f']\n payment_included_campaign_gift_card text, -- example: ['t', 'f']\n via_giving_page text, -- example: ['f', 't']\n donation_message text, -- example: ['Gift card ', 'GIFT CARD', 'Gift Card', 'gift card', 'donation', 'Donation']\n PRIMARY KEY (donationid),\n CONSTRAINT fk_donations_projectid FOREIGN KEY (projectid) REFERENCES projects (projectid)\n);\n\nCREATE TABLE essays (\n projectid text, -- example: ['ffffc4f85b60efc5b52347df489d0238', 'ffffac55ee02a49d1abc87ba6fc61135']\n teacher_acctid text, -- example: ['c24011b20fc161ed02248e85beb59a90', '947066d0af47e0566f334566553dd6a6']\n title text, -- example: ['iMath', \"Recording Rockin' Readers\"]\n short_description text, -- example: ['It is imperative that teachers bring tec', 'Can you imagine having to translate ever']\n need_statement text, -- example: ['My students need four iPods.', 'My students need a camcorder. ']\n);\n\nCREATE TABLE resources (\n resourceid text, -- example: ['0000037fecc4461faf0e49328ae66661', '0000046b69c683354ca46b30db5c558e']\n projectid text, -- example: ['ffffc4f85b60efc5b52347df489d0238', 'ffffac55ee02a49d1abc87ba6fc61135']\n vendorid integer, -- example: [430, 82]\n vendor_name text, -- example: ['Woodwind and Brasswind', 'Best Buy for Business']\n item_name text, -- example: ['Schools', 'Gift cards', 'How Many?', 'School!', 'iPod nano 4th Gen 8GB (Black)', 'Sony bloggie MHS-FS1 - camcorder - inter']\n item_unit_price real, -- example: [149.0, 148.0]\n PRIMARY KEY (resourceid),\n CONSTRAINT fk_resources_projectid FOREIGN KEY (projectid) REFERENCES projects (projectid)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nhighest 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'\nHow many schools with the highest level of poverty have received a portion of a donation included corporate sponsored gift card?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"split": "train"
} |
nl2sql | [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE projects (\n projectid text, -- example: ['00001ccc0e81598c4bd86bacb94d7acb', '00002bff514104264a6b798356fdd893']\n teacher_acctid text, -- example: ['42d43fa6f37314365d08692e08680973', '864eb466462bf704bf7a16a585ef296a']\n schoolid text, -- example: ['c0e6ce89b244764085691a1b8e28cb81', 'd711e47810900c96f26a5d0be30c446d']\n school_latitude real, -- example: [36.57634, 32.911179]\n school_longitude real, -- example: [-119.608713, -96.72364]\n school_state text, -- example: ['CA', 'TX']\n school_metro text, -- example: ['urban', 'rural']\n school_county text, -- example: ['Fresno', 'Dallas']\n school_magnet text, -- example: ['f', 't']\n school_year_round text, -- example: ['f', 't']\n school_nlns text, -- school Nonleafy Normal Stature, example: ['f', 't']\n teacher_prefix text, -- example: ['Mrs.', 'Mr.']\n teacher_teach_for_america text, -- teachers teach for america, example: ['f', 't']\n teacher_ny_teaching_fellow text, -- teacher_new_york_teaching_fellow, example: ['f', 't']\n secondary_focus_subject text, -- example: ['College & Career Prep', 'ESL']\n total_price_including_optional_support real, -- example: [653.89, 348.79]\n eligible_almost_home_match text, -- example: ['f', 't']\n date_posted date, -- example: ['2014-05-12', '2014-05-11']\n PRIMARY KEY (projectid)\n);\n\nCREATE TABLE essays (\n projectid text, -- example: ['ffffc4f85b60efc5b52347df489d0238', 'ffffac55ee02a49d1abc87ba6fc61135']\n teacher_acctid text, -- example: ['c24011b20fc161ed02248e85beb59a90', '947066d0af47e0566f334566553dd6a6']\n title text, -- example: ['Team More Books!', 'iMath', \"Recording Rockin' Readers\"]\n short_description text, -- example: ['It is imperative that teachers bring tec', 'Can you imagine having to translate ever']\n essay text, -- example: ['I am a fourth year fifth grade math teac', 'Can you imagine having to translate ever']\n);\n\nCREATE TABLE donations (\n donationid text, -- example: ['000000a91a14ed37bef82e125c102e77', '000013be53ed7382ed5d5975eb86eb85']\n projectid text, -- example: ['ffffac55ee02a49d1abc87ba6fc61135', 'ffff97ed93720407d70a2787475932b0']\n donor_city text, -- example: ['New York', 'NEW York', 'New york', 'YORK', 'York', 'YOrk']\n donor_zip text, -- example: ['30269', '20853']\n is_teacher_acct text, -- example: ['t', 'f']\n donation_to_project real, -- example: [42.5, 26.83]\n donation_optional_support real, -- example: [7.5, 4.73]\n dollar_amount text, -- example: ['10_to_100', 'under_10']\n payment_included_campaign_gift_card text, -- example: ['t', 'f']\n payment_was_promo_matched text, -- example: ['f', 't']\n via_giving_page text, -- example: ['f', 't']\n for_honoree text, -- example: ['t', 'f']\n donation_message text, -- example: ['ha', 'I gave to this project because I support', 'I donated because I want to support kids']\n PRIMARY KEY (donationid),\n CONSTRAINT fk_donations_projectid FOREIGN KEY (projectid) REFERENCES projects (projectid)\n);\n\nCREATE TABLE resources (\n resourceid text, -- example: ['0000037fecc4461faf0e49328ae66661', '0000046b69c683354ca46b30db5c558e']\n projectid text, -- example: ['ffffc4f85b60efc5b52347df489d0238', 'ffffac55ee02a49d1abc87ba6fc61135']\n item_number text, -- example: ['249995.001', 'BB11216668']\n item_unit_price real, -- example: [149.0, 148.0]\n PRIMARY KEY (resourceid),\n CONSTRAINT fk_resources_projectid FOREIGN KEY (projectid) REFERENCES projects (projectid)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\ntitle Team More Books! Refers to title = 'Team More Books!'; as a New York teaching fellow refers to teacher_ny_teaching_fellow = 't'\nFind out if the project with the title Team More Books! has a New York teaching fellow.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"role": "user"
}
] | nl2sql | {
"ground_truth": "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!'",
"style": "rule"
} | {
"db_id": "donor.sqlite",
"gt_sql": "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!'",
"index": 1602,
"question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE projects (\n projectid text, -- example: ['00001ccc0e81598c4bd86bacb94d7acb', '00002bff514104264a6b798356fdd893']\n teacher_acctid text, -- example: ['42d43fa6f37314365d08692e08680973', '864eb466462bf704bf7a16a585ef296a']\n schoolid text, -- example: ['c0e6ce89b244764085691a1b8e28cb81', 'd711e47810900c96f26a5d0be30c446d']\n school_latitude real, -- example: [36.57634, 32.911179]\n school_longitude real, -- example: [-119.608713, -96.72364]\n school_state text, -- example: ['CA', 'TX']\n school_metro text, -- example: ['urban', 'rural']\n school_county text, -- example: ['Fresno', 'Dallas']\n school_magnet text, -- example: ['f', 't']\n school_year_round text, -- example: ['f', 't']\n school_nlns text, -- school Nonleafy Normal Stature, example: ['f', 't']\n teacher_prefix text, -- example: ['Mrs.', 'Mr.']\n teacher_teach_for_america text, -- teachers teach for america, example: ['f', 't']\n teacher_ny_teaching_fellow text, -- teacher_new_york_teaching_fellow, example: ['f', 't']\n secondary_focus_subject text, -- example: ['College & Career Prep', 'ESL']\n total_price_including_optional_support real, -- example: [653.89, 348.79]\n eligible_almost_home_match text, -- example: ['f', 't']\n date_posted date, -- example: ['2014-05-12', '2014-05-11']\n PRIMARY KEY (projectid)\n);\n\nCREATE TABLE essays (\n projectid text, -- example: ['ffffc4f85b60efc5b52347df489d0238', 'ffffac55ee02a49d1abc87ba6fc61135']\n teacher_acctid text, -- example: ['c24011b20fc161ed02248e85beb59a90', '947066d0af47e0566f334566553dd6a6']\n title text, -- example: ['Team More Books!', 'iMath', \"Recording Rockin' Readers\"]\n short_description text, -- example: ['It is imperative that teachers bring tec', 'Can you imagine having to translate ever']\n essay text, -- example: ['I am a fourth year fifth grade math teac', 'Can you imagine having to translate ever']\n);\n\nCREATE TABLE donations (\n donationid text, -- example: ['000000a91a14ed37bef82e125c102e77', '000013be53ed7382ed5d5975eb86eb85']\n projectid text, -- example: ['ffffac55ee02a49d1abc87ba6fc61135', 'ffff97ed93720407d70a2787475932b0']\n donor_city text, -- example: ['New York', 'NEW York', 'New york', 'YORK', 'York', 'YOrk']\n donor_zip text, -- example: ['30269', '20853']\n is_teacher_acct text, -- example: ['t', 'f']\n donation_to_project real, -- example: [42.5, 26.83]\n donation_optional_support real, -- example: [7.5, 4.73]\n dollar_amount text, -- example: ['10_to_100', 'under_10']\n payment_included_campaign_gift_card text, -- example: ['t', 'f']\n payment_was_promo_matched text, -- example: ['f', 't']\n via_giving_page text, -- example: ['f', 't']\n for_honoree text, -- example: ['t', 'f']\n donation_message text, -- example: ['ha', 'I gave to this project because I support', 'I donated because I want to support kids']\n PRIMARY KEY (donationid),\n CONSTRAINT fk_donations_projectid FOREIGN KEY (projectid) REFERENCES projects (projectid)\n);\n\nCREATE TABLE resources (\n resourceid text, -- example: ['0000037fecc4461faf0e49328ae66661', '0000046b69c683354ca46b30db5c558e']\n projectid text, -- example: ['ffffc4f85b60efc5b52347df489d0238', 'ffffac55ee02a49d1abc87ba6fc61135']\n item_number text, -- example: ['249995.001', 'BB11216668']\n item_unit_price real, -- example: [149.0, 148.0]\n PRIMARY KEY (resourceid),\n CONSTRAINT fk_resources_projectid FOREIGN KEY (projectid) REFERENCES projects (projectid)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\ntitle Team More Books! Refers to title = 'Team More Books!'; as a New York teaching fellow refers to teacher_ny_teaching_fellow = 't'\nFind out if the project with the title Team More Books! has a New York teaching fellow.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"split": "train"
} |
nl2sql | [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE resources (\n resourceid text, -- example: ['0000037fecc4461faf0e49328ae66661', '0000046b69c683354ca46b30db5c558e']\n projectid text, -- example: ['ffffc4f85b60efc5b52347df489d0238', 'ffffac55ee02a49d1abc87ba6fc61135']\n vendorid integer, -- example: [430, 82]\n vendor_name text, -- example: ['Woodwind and Brasswind', 'Best Buy for Business']\n project_resource_type text, -- example: ['Technology', 'Supplies']\n item_name text, -- example: ['iPod nano 4th Gen 8GB (Black)', 'Sony bloggie MHS-FS1 - camcorder - inter']\n item_number text, -- example: ['249995.001', 'BB11216668']\n item_unit_price real, -- example: [149.0, 148.0]\n item_quantity integer, -- example: [4, 1]\n PRIMARY KEY (resourceid),\n CONSTRAINT fk_resources_projectid FOREIGN KEY (projectid) REFERENCES projects (projectid)\n);\n\nCREATE TABLE essays (\n projectid text, -- example: ['ffffc4f85b60efc5b52347df489d0238', 'ffffac55ee02a49d1abc87ba6fc61135']\n essay text, -- example: ['I am a fourth year fifth grade math teac', 'Can you imagine having to translate ever']\n);\n\nCREATE TABLE projects (\n projectid text, -- example: ['00001ccc0e81598c4bd86bacb94d7acb', '00002bff514104264a6b798356fdd893']\n teacher_acctid text, -- example: ['42d43fa6f37314365d08692e08680973', '864eb466462bf704bf7a16a585ef296a']\n school_zip integer, -- example: [93662, 75243]\n school_district text, -- example: ['Selma Unified Sch District', 'Richardson Ind School District']\n school_county text, -- example: ['Fresno', 'Dallas']\n school_magnet text, -- example: ['f', 't']\n school_nlns text, -- school Nonleafy Normal Stature, example: ['f', 't']\n school_kipp text, -- school Knowledge Is Power Program, example: ['f', 't']\n teacher_prefix text, -- example: ['Mrs.', 'Mr.']\n teacher_ny_teaching_fellow text, -- teacher_new_york_teaching_fellow, example: ['f', 't']\n secondary_focus_area text, -- example: ['Applied Learning', 'Literacy & Language']\n resource_type text, -- example: ['Books', 'Technology']\n poverty_level text, -- example: ['highest poverty', 'high poverty']\n grade_level text, -- example: ['Grades 9-12', 'Grades 6-8', 'Grades PreK-2']\n fulfillment_labor_materials real, -- example: [30.0, 35.0]\n total_price_including_optional_support real, -- example: [653.89, 348.79]\n students_reached integer, -- example: [32, 22]\n eligible_double_your_impact_match text, -- example: ['f', 't']\n eligible_almost_home_match text, -- example: ['f', 't']\n PRIMARY KEY (projectid)\n);\n\nCREATE TABLE donations (\n donationid text, -- example: ['000000a91a14ed37bef82e125c102e77', '000013be53ed7382ed5d5975eb86eb85']\n projectid text, -- example: ['ffffac55ee02a49d1abc87ba6fc61135', 'ffff97ed93720407d70a2787475932b0']\n donor_city text, -- example: ['Peachtree City', 'Rockville']\n donor_zip text, -- example: ['30269', '20853']\n payment_method text, -- example: ['no_cash_received', 'creditcard']\n payment_included_campaign_gift_card text, -- example: ['t', 'f']\n payment_included_web_purchased_gift_card text, -- example: ['f', 't']\n via_giving_page text, -- example: ['f', 't']\n for_honoree text, -- example: ['f', 't']\n PRIMARY KEY (donationid),\n CONSTRAINT fk_donations_projectid FOREIGN KEY (projectid) REFERENCES projects (projectid)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nfor grades 9-12 refers to grade_level = 'Grades 9-12'\nWhat is the name of the vendors serving material for projects for grades 9-12?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"role": "user"
}
] | nl2sql | {
"ground_truth": "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'",
"style": "rule"
} | {
"db_id": "donor.sqlite",
"gt_sql": "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'",
"index": 1603,
"question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE resources (\n resourceid text, -- example: ['0000037fecc4461faf0e49328ae66661', '0000046b69c683354ca46b30db5c558e']\n projectid text, -- example: ['ffffc4f85b60efc5b52347df489d0238', 'ffffac55ee02a49d1abc87ba6fc61135']\n vendorid integer, -- example: [430, 82]\n vendor_name text, -- example: ['Woodwind and Brasswind', 'Best Buy for Business']\n project_resource_type text, -- example: ['Technology', 'Supplies']\n item_name text, -- example: ['iPod nano 4th Gen 8GB (Black)', 'Sony bloggie MHS-FS1 - camcorder - inter']\n item_number text, -- example: ['249995.001', 'BB11216668']\n item_unit_price real, -- example: [149.0, 148.0]\n item_quantity integer, -- example: [4, 1]\n PRIMARY KEY (resourceid),\n CONSTRAINT fk_resources_projectid FOREIGN KEY (projectid) REFERENCES projects (projectid)\n);\n\nCREATE TABLE essays (\n projectid text, -- example: ['ffffc4f85b60efc5b52347df489d0238', 'ffffac55ee02a49d1abc87ba6fc61135']\n essay text, -- example: ['I am a fourth year fifth grade math teac', 'Can you imagine having to translate ever']\n);\n\nCREATE TABLE projects (\n projectid text, -- example: ['00001ccc0e81598c4bd86bacb94d7acb', '00002bff514104264a6b798356fdd893']\n teacher_acctid text, -- example: ['42d43fa6f37314365d08692e08680973', '864eb466462bf704bf7a16a585ef296a']\n school_zip integer, -- example: [93662, 75243]\n school_district text, -- example: ['Selma Unified Sch District', 'Richardson Ind School District']\n school_county text, -- example: ['Fresno', 'Dallas']\n school_magnet text, -- example: ['f', 't']\n school_nlns text, -- school Nonleafy Normal Stature, example: ['f', 't']\n school_kipp text, -- school Knowledge Is Power Program, example: ['f', 't']\n teacher_prefix text, -- example: ['Mrs.', 'Mr.']\n teacher_ny_teaching_fellow text, -- teacher_new_york_teaching_fellow, example: ['f', 't']\n secondary_focus_area text, -- example: ['Applied Learning', 'Literacy & Language']\n resource_type text, -- example: ['Books', 'Technology']\n poverty_level text, -- example: ['highest poverty', 'high poverty']\n grade_level text, -- example: ['Grades 9-12', 'Grades 6-8', 'Grades PreK-2']\n fulfillment_labor_materials real, -- example: [30.0, 35.0]\n total_price_including_optional_support real, -- example: [653.89, 348.79]\n students_reached integer, -- example: [32, 22]\n eligible_double_your_impact_match text, -- example: ['f', 't']\n eligible_almost_home_match text, -- example: ['f', 't']\n PRIMARY KEY (projectid)\n);\n\nCREATE TABLE donations (\n donationid text, -- example: ['000000a91a14ed37bef82e125c102e77', '000013be53ed7382ed5d5975eb86eb85']\n projectid text, -- example: ['ffffac55ee02a49d1abc87ba6fc61135', 'ffff97ed93720407d70a2787475932b0']\n donor_city text, -- example: ['Peachtree City', 'Rockville']\n donor_zip text, -- example: ['30269', '20853']\n payment_method text, -- example: ['no_cash_received', 'creditcard']\n payment_included_campaign_gift_card text, -- example: ['t', 'f']\n payment_included_web_purchased_gift_card text, -- example: ['f', 't']\n via_giving_page text, -- example: ['f', 't']\n for_honoree text, -- example: ['f', 't']\n PRIMARY KEY (donationid),\n CONSTRAINT fk_donations_projectid FOREIGN KEY (projectid) REFERENCES projects (projectid)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nfor grades 9-12 refers to grade_level = 'Grades 9-12'\nWhat is the name of the vendors serving material for projects for grades 9-12?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"split": "train"
} |
nl2sql | [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE resources (\n resourceid text, -- example: ['0000037fecc4461faf0e49328ae66661', '0000046b69c683354ca46b30db5c558e']\n projectid text, -- example: ['ffffc4f85b60efc5b52347df489d0238', 'ffffac55ee02a49d1abc87ba6fc61135']\n vendorid integer, -- example: [430, 82]\n vendor_name text, -- example: ['Woodwind and Brasswind', 'Best Buy for Business']\n project_resource_type text, -- example: ['Technology', 'Supplies']\n item_name text, -- example: ['How Many?', 'School!', 'Schools', 'iPod nano 4th Gen 8GB (Black)', 'Sony bloggie MHS-FS1 - camcorder - inter']\n item_number text, -- example: ['249995.001', 'BB11216668']\n item_unit_price real, -- example: [149.0, 148.0]\n item_quantity integer, -- example: [4, 1]\n PRIMARY KEY (resourceid),\n CONSTRAINT fk_resources_projectid FOREIGN KEY (projectid) REFERENCES projects (projectid)\n);\n\nCREATE TABLE projects (\n projectid text, -- example: ['00001ccc0e81598c4bd86bacb94d7acb', '00002bff514104264a6b798356fdd893']\n teacher_acctid text, -- example: ['42d43fa6f37314365d08692e08680973', '864eb466462bf704bf7a16a585ef296a']\n schoolid text, -- example: ['c0e6ce89b244764085691a1b8e28cb81', 'd711e47810900c96f26a5d0be30c446d']\n school_ncesid text, -- school national center for education statistics id, example: ['063627006187', '483702008193']\n school_latitude real, -- example: [36.57634, 32.911179]\n school_longitude real, -- example: [-119.608713, -96.72364]\n school_city text, -- example: ['Hill City', 'Rock Hill', 'Many', 'Selma', 'Dallas']\n school_state text, -- example: ['CA', 'TX']\n school_zip integer, -- example: [93662, 75243]\n school_metro text, -- example: ['urban', 'rural']\n school_district text, -- example: ['Selma Unified Sch District', 'Richardson Ind School District']\n school_county text, -- example: ['Hill', 'Fresno', 'Dallas']\n school_charter text, -- example: ['f', 't']\n school_magnet text, -- example: ['f', 't']\n school_year_round text, -- example: ['f', 't']\n school_nlns text, -- school Nonleafy Normal Stature, example: ['f', 't']\n school_kipp text, -- school Knowledge Is Power Program, example: ['f', 't']\n school_charter_ready_promise text, -- example: ['f', 't']\n teacher_prefix text, -- example: ['Mrs.', 'Mr.']\n teacher_teach_for_america text, -- teachers teach for america, example: ['f', 't']\n teacher_ny_teaching_fellow text, -- teacher_new_york_teaching_fellow, example: ['f', 't']\n primary_focus_subject text, -- example: ['Literature & Writing', 'Literacy']\n primary_focus_area text, -- example: ['Literacy & Language', 'History & Civics']\n secondary_focus_subject text, -- example: ['College & Career Prep', 'ESL']\n secondary_focus_area text, -- example: ['Applied Learning', 'Literacy & Language']\n resource_type text, -- example: ['Books', 'Technology']\n poverty_level text, -- example: ['highest poverty', 'high poverty']\n grade_level text, -- example: ['Grades 6-8', 'Grades PreK-2']\n fulfillment_labor_materials real, -- example: [30.0, 35.0]\n total_price_excluding_optional_support real, -- example: [555.81, 296.47]\n total_price_including_optional_support real, -- example: [653.89, 348.79]\n students_reached integer, -- example: [32, 22]\n eligible_double_your_impact_match text, -- example: ['f', 't']\n eligible_almost_home_match text, -- example: ['f', 't']\n date_posted date, -- example: ['2014-05-12', '2014-05-11']\n PRIMARY KEY (projectid)\n);\n\nCREATE TABLE donations (\n donationid text, -- example: ['000000a91a14ed37bef82e125c102e77', '000013be53ed7382ed5d5975eb86eb85']\n projectid text, -- example: ['ffffac55ee02a49d1abc87ba6fc61135', 'ffff97ed93720407d70a2787475932b0']\n donor_acctid text, -- donor accid, example: ['22cbc920c9b5fa08dfb331422f5926b5', '521f1830a77c9dbbf8119d99c6206a16']\n donor_city text, -- example: ['Hill City', 'ROCK HILL', 'Rock Hill', 'Rock HIll', 'rock hill', 'Many']\n donor_state text, -- example: ['GA', 'MD']\n donor_zip text, -- example: ['30269', '20853']\n is_teacher_acct text, -- example: ['t', 'f']\n donation_timestamp datetime, -- example: ['2011-08-25 14:27:34.807', '2011-11-04 07:54:21.552']\n donation_to_project real, -- example: [42.5, 26.83]\n donation_optional_support real, -- example: [7.5, 4.73]\n donation_total real, -- example: [50.0, 31.56]\n dollar_amount text, -- example: ['10_to_100', 'under_10']\n donation_included_optional_support text, -- example: ['t', 'f']\n payment_method text, -- example: ['no_cash_received', 'creditcard']\n payment_included_acct_credit text, -- example: ['f', 't']\n payment_included_campaign_gift_card text, -- example: ['t', 'f']\n payment_included_web_purchased_gift_card text, -- example: ['f', 't']\n payment_was_promo_matched text, -- example: ['f', 't']\n via_giving_page text, -- example: ['f', 't']\n for_honoree text, -- example: ['t', 'f']\n donation_message text, -- example: ['I gave to this project because I support', 'I donated because I want to support kids']\n PRIMARY KEY (donationid),\n CONSTRAINT fk_donations_projectid FOREIGN KEY (projectid) REFERENCES projects (projectid)\n);\n\nCREATE TABLE essays (\n projectid text, -- example: ['ffffc4f85b60efc5b52347df489d0238', 'ffffac55ee02a49d1abc87ba6fc61135']\n teacher_acctid text, -- example: ['c24011b20fc161ed02248e85beb59a90', '947066d0af47e0566f334566553dd6a6']\n title text, -- example: ['iMath', \"Recording Rockin' Readers\"]\n short_description text, -- example: ['It is imperative that teachers bring tec', 'Can you imagine having to translate ever']\n need_statement text, -- example: ['My students need four iPods.', 'My students need a camcorder. ']\n essay text, -- example: ['I am a fourth year fifth grade math teac', 'Can you imagine having to translate ever']\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nRock Hill City School refers to school_city = 'Rock Hill'; teacher donors refers to is_teacher_acct = 't'\nHow many Rock Hill City School projects have teacher donors?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"role": "user"
}
] | nl2sql | {
"ground_truth": "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'",
"style": "rule"
} | {
"db_id": "donor.sqlite",
"gt_sql": "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'",
"index": 1604,
"question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE resources (\n resourceid text, -- example: ['0000037fecc4461faf0e49328ae66661', '0000046b69c683354ca46b30db5c558e']\n projectid text, -- example: ['ffffc4f85b60efc5b52347df489d0238', 'ffffac55ee02a49d1abc87ba6fc61135']\n vendorid integer, -- example: [430, 82]\n vendor_name text, -- example: ['Woodwind and Brasswind', 'Best Buy for Business']\n project_resource_type text, -- example: ['Technology', 'Supplies']\n item_name text, -- example: ['How Many?', 'School!', 'Schools', 'iPod nano 4th Gen 8GB (Black)', 'Sony bloggie MHS-FS1 - camcorder - inter']\n item_number text, -- example: ['249995.001', 'BB11216668']\n item_unit_price real, -- example: [149.0, 148.0]\n item_quantity integer, -- example: [4, 1]\n PRIMARY KEY (resourceid),\n CONSTRAINT fk_resources_projectid FOREIGN KEY (projectid) REFERENCES projects (projectid)\n);\n\nCREATE TABLE projects (\n projectid text, -- example: ['00001ccc0e81598c4bd86bacb94d7acb', '00002bff514104264a6b798356fdd893']\n teacher_acctid text, -- example: ['42d43fa6f37314365d08692e08680973', '864eb466462bf704bf7a16a585ef296a']\n schoolid text, -- example: ['c0e6ce89b244764085691a1b8e28cb81', 'd711e47810900c96f26a5d0be30c446d']\n school_ncesid text, -- school national center for education statistics id, example: ['063627006187', '483702008193']\n school_latitude real, -- example: [36.57634, 32.911179]\n school_longitude real, -- example: [-119.608713, -96.72364]\n school_city text, -- example: ['Hill City', 'Rock Hill', 'Many', 'Selma', 'Dallas']\n school_state text, -- example: ['CA', 'TX']\n school_zip integer, -- example: [93662, 75243]\n school_metro text, -- example: ['urban', 'rural']\n school_district text, -- example: ['Selma Unified Sch District', 'Richardson Ind School District']\n school_county text, -- example: ['Hill', 'Fresno', 'Dallas']\n school_charter text, -- example: ['f', 't']\n school_magnet text, -- example: ['f', 't']\n school_year_round text, -- example: ['f', 't']\n school_nlns text, -- school Nonleafy Normal Stature, example: ['f', 't']\n school_kipp text, -- school Knowledge Is Power Program, example: ['f', 't']\n school_charter_ready_promise text, -- example: ['f', 't']\n teacher_prefix text, -- example: ['Mrs.', 'Mr.']\n teacher_teach_for_america text, -- teachers teach for america, example: ['f', 't']\n teacher_ny_teaching_fellow text, -- teacher_new_york_teaching_fellow, example: ['f', 't']\n primary_focus_subject text, -- example: ['Literature & Writing', 'Literacy']\n primary_focus_area text, -- example: ['Literacy & Language', 'History & Civics']\n secondary_focus_subject text, -- example: ['College & Career Prep', 'ESL']\n secondary_focus_area text, -- example: ['Applied Learning', 'Literacy & Language']\n resource_type text, -- example: ['Books', 'Technology']\n poverty_level text, -- example: ['highest poverty', 'high poverty']\n grade_level text, -- example: ['Grades 6-8', 'Grades PreK-2']\n fulfillment_labor_materials real, -- example: [30.0, 35.0]\n total_price_excluding_optional_support real, -- example: [555.81, 296.47]\n total_price_including_optional_support real, -- example: [653.89, 348.79]\n students_reached integer, -- example: [32, 22]\n eligible_double_your_impact_match text, -- example: ['f', 't']\n eligible_almost_home_match text, -- example: ['f', 't']\n date_posted date, -- example: ['2014-05-12', '2014-05-11']\n PRIMARY KEY (projectid)\n);\n\nCREATE TABLE donations (\n donationid text, -- example: ['000000a91a14ed37bef82e125c102e77', '000013be53ed7382ed5d5975eb86eb85']\n projectid text, -- example: ['ffffac55ee02a49d1abc87ba6fc61135', 'ffff97ed93720407d70a2787475932b0']\n donor_acctid text, -- donor accid, example: ['22cbc920c9b5fa08dfb331422f5926b5', '521f1830a77c9dbbf8119d99c6206a16']\n donor_city text, -- example: ['Hill City', 'ROCK HILL', 'Rock Hill', 'Rock HIll', 'rock hill', 'Many']\n donor_state text, -- example: ['GA', 'MD']\n donor_zip text, -- example: ['30269', '20853']\n is_teacher_acct text, -- example: ['t', 'f']\n donation_timestamp datetime, -- example: ['2011-08-25 14:27:34.807', '2011-11-04 07:54:21.552']\n donation_to_project real, -- example: [42.5, 26.83]\n donation_optional_support real, -- example: [7.5, 4.73]\n donation_total real, -- example: [50.0, 31.56]\n dollar_amount text, -- example: ['10_to_100', 'under_10']\n donation_included_optional_support text, -- example: ['t', 'f']\n payment_method text, -- example: ['no_cash_received', 'creditcard']\n payment_included_acct_credit text, -- example: ['f', 't']\n payment_included_campaign_gift_card text, -- example: ['t', 'f']\n payment_included_web_purchased_gift_card text, -- example: ['f', 't']\n payment_was_promo_matched text, -- example: ['f', 't']\n via_giving_page text, -- example: ['f', 't']\n for_honoree text, -- example: ['t', 'f']\n donation_message text, -- example: ['I gave to this project because I support', 'I donated because I want to support kids']\n PRIMARY KEY (donationid),\n CONSTRAINT fk_donations_projectid FOREIGN KEY (projectid) REFERENCES projects (projectid)\n);\n\nCREATE TABLE essays (\n projectid text, -- example: ['ffffc4f85b60efc5b52347df489d0238', 'ffffac55ee02a49d1abc87ba6fc61135']\n teacher_acctid text, -- example: ['c24011b20fc161ed02248e85beb59a90', '947066d0af47e0566f334566553dd6a6']\n title text, -- example: ['iMath', \"Recording Rockin' Readers\"]\n short_description text, -- example: ['It is imperative that teachers bring tec', 'Can you imagine having to translate ever']\n need_statement text, -- example: ['My students need four iPods.', 'My students need a camcorder. ']\n essay text, -- example: ['I am a fourth year fifth grade math teac', 'Can you imagine having to translate ever']\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nRock Hill City School refers to school_city = 'Rock Hill'; teacher donors refers to is_teacher_acct = 't'\nHow many Rock Hill City School projects have teacher donors?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"split": "train"
} |
nl2sql | [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE essays (\n projectid text, -- example: ['ffffc4f85b60efc5b52347df489d0238', 'ffffac55ee02a49d1abc87ba6fc61135']\n teacher_acctid text, -- example: ['c24011b20fc161ed02248e85beb59a90', '947066d0af47e0566f334566553dd6a6']\n short_description text, -- example: ['It is imperative that teachers bring tec', 'Can you imagine having to translate ever']\n essay text, -- example: ['I am a fourth year fifth grade math teac', 'Can you imagine having to translate ever']\n);\n\nCREATE TABLE donations (\n donationid text, -- example: ['000000a91a14ed37bef82e125c102e77', '000013be53ed7382ed5d5975eb86eb85']\n projectid text, -- example: ['ffffac55ee02a49d1abc87ba6fc61135', 'ffff97ed93720407d70a2787475932b0']\n donor_acctid text, -- donor accid, example: ['22cbc920c9b5fa08dfb331422f5926b5', '521f1830a77c9dbbf8119d99c6206a16']\n donor_state text, -- example: ['CO', 'GA', 'MD']\n donor_zip text, -- example: ['30269', '20853']\n is_teacher_acct text, -- example: ['f', 't']\n donation_timestamp datetime, -- example: ['2011-08-25 14:27:34.807', '2011-11-04 07:54:21.552']\n donation_to_project real, -- example: [42.5, 26.83]\n donation_optional_support real, -- example: [7.5, 4.73]\n donation_total real, -- example: [50.0, 31.56]\n dollar_amount text, -- example: ['10_to_100', 'under_10']\n donation_included_optional_support text, -- example: ['t', 'f']\n payment_method text, -- example: ['no_cash_received', 'creditcard']\n payment_included_acct_credit text, -- example: ['f', 't']\n payment_included_campaign_gift_card text, -- example: ['t', 'f']\n payment_included_web_purchased_gift_card text, -- example: ['f', 't']\n payment_was_promo_matched text, -- example: ['f', 't']\n for_honoree text, -- example: ['f', 't']\n donation_message text, -- example: ['I gave to this project because I support', 'I donated because I want to support kids']\n PRIMARY KEY (donationid),\n CONSTRAINT fk_donations_projectid FOREIGN KEY (projectid) REFERENCES projects (projectid)\n);\n\nCREATE TABLE resources (\n resourceid text, -- example: ['0000037fecc4461faf0e49328ae66661', '0000046b69c683354ca46b30db5c558e']\n projectid text, -- example: ['ffffc4f85b60efc5b52347df489d0238', 'ffffac55ee02a49d1abc87ba6fc61135']\n vendorid integer, -- example: [430, 82]\n vendor_name text, -- example: ['Woodwind and Brasswind', 'Best Buy for Business']\n project_resource_type text, -- example: ['Technology', 'Supplies']\n item_unit_price real, -- example: [149.0, 148.0]\n item_quantity integer, -- example: [4, 1]\n PRIMARY KEY (resourceid),\n CONSTRAINT fk_resources_projectid FOREIGN KEY (projectid) REFERENCES projects (projectid)\n);\n\nCREATE TABLE projects (\n projectid text, -- example: ['00001ccc0e81598c4bd86bacb94d7acb', '00002bff514104264a6b798356fdd893']\n teacher_acctid text, -- example: ['42d43fa6f37314365d08692e08680973', '864eb466462bf704bf7a16a585ef296a']\n schoolid text, -- example: ['c0e6ce89b244764085691a1b8e28cb81', 'd711e47810900c96f26a5d0be30c446d']\n school_ncesid text, -- school national center for education statistics id, example: ['063627006187', '483702008193']\n school_latitude real, -- example: [36.57634, 32.911179]\n school_longitude real, -- example: [-119.608713, -96.72364]\n school_state text, -- example: ['CO', 'CA', 'TX']\n school_zip integer, -- example: [93662, 75243]\n school_metro text, -- example: ['urban', 'rural']\n school_district text, -- example: ['Onslow Co School District', 'Selma Unified Sch District', 'Richardson Ind School District']\n school_county text, -- example: ['Onslow', 'Fresno', 'Dallas']\n school_charter text, -- example: ['f', 't']\n school_year_round text, -- example: ['f', 't']\n school_nlns text, -- school Nonleafy Normal Stature, example: ['f', 't']\n school_kipp text, -- school Knowledge Is Power Program, example: ['f', 't']\n school_charter_ready_promise text, -- example: ['f', 't']\n teacher_teach_for_america text, -- teachers teach for america, example: ['f', 't']\n teacher_ny_teaching_fellow text, -- teacher_new_york_teaching_fellow, example: ['f', 't']\n primary_focus_subject text, -- example: ['Literature & Writing', 'Literacy']\n primary_focus_area text, -- example: ['Literacy & Language', 'History & Civics']\n secondary_focus_subject text, -- example: ['College & Career Prep', 'ESL']\n resource_type text, -- example: ['Books', 'Technology']\n poverty_level text, -- example: ['highest poverty', 'high poverty']\n grade_level text, -- example: ['Grades 6-8', 'Grades PreK-2']\n fulfillment_labor_materials real, -- example: [30.0, 35.0]\n eligible_double_your_impact_match text, -- example: ['f', 't']\n eligible_almost_home_match text, -- example: ['f', 't']\n date_posted date, -- example: ['2014-05-12', '2014-05-11']\n PRIMARY KEY (projectid)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nOnslow Co School District refers to school_district = 'Onslow Co School District';\nHow many total items were requested for the Onslow Co School District urban metro school projects?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"role": "user"
}
] | nl2sql | {
"ground_truth": "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'",
"style": "rule"
} | {
"db_id": "donor.sqlite",
"gt_sql": "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'",
"index": 1605,
"question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE essays (\n projectid text, -- example: ['ffffc4f85b60efc5b52347df489d0238', 'ffffac55ee02a49d1abc87ba6fc61135']\n teacher_acctid text, -- example: ['c24011b20fc161ed02248e85beb59a90', '947066d0af47e0566f334566553dd6a6']\n short_description text, -- example: ['It is imperative that teachers bring tec', 'Can you imagine having to translate ever']\n essay text, -- example: ['I am a fourth year fifth grade math teac', 'Can you imagine having to translate ever']\n);\n\nCREATE TABLE donations (\n donationid text, -- example: ['000000a91a14ed37bef82e125c102e77', '000013be53ed7382ed5d5975eb86eb85']\n projectid text, -- example: ['ffffac55ee02a49d1abc87ba6fc61135', 'ffff97ed93720407d70a2787475932b0']\n donor_acctid text, -- donor accid, example: ['22cbc920c9b5fa08dfb331422f5926b5', '521f1830a77c9dbbf8119d99c6206a16']\n donor_state text, -- example: ['CO', 'GA', 'MD']\n donor_zip text, -- example: ['30269', '20853']\n is_teacher_acct text, -- example: ['f', 't']\n donation_timestamp datetime, -- example: ['2011-08-25 14:27:34.807', '2011-11-04 07:54:21.552']\n donation_to_project real, -- example: [42.5, 26.83]\n donation_optional_support real, -- example: [7.5, 4.73]\n donation_total real, -- example: [50.0, 31.56]\n dollar_amount text, -- example: ['10_to_100', 'under_10']\n donation_included_optional_support text, -- example: ['t', 'f']\n payment_method text, -- example: ['no_cash_received', 'creditcard']\n payment_included_acct_credit text, -- example: ['f', 't']\n payment_included_campaign_gift_card text, -- example: ['t', 'f']\n payment_included_web_purchased_gift_card text, -- example: ['f', 't']\n payment_was_promo_matched text, -- example: ['f', 't']\n for_honoree text, -- example: ['f', 't']\n donation_message text, -- example: ['I gave to this project because I support', 'I donated because I want to support kids']\n PRIMARY KEY (donationid),\n CONSTRAINT fk_donations_projectid FOREIGN KEY (projectid) REFERENCES projects (projectid)\n);\n\nCREATE TABLE resources (\n resourceid text, -- example: ['0000037fecc4461faf0e49328ae66661', '0000046b69c683354ca46b30db5c558e']\n projectid text, -- example: ['ffffc4f85b60efc5b52347df489d0238', 'ffffac55ee02a49d1abc87ba6fc61135']\n vendorid integer, -- example: [430, 82]\n vendor_name text, -- example: ['Woodwind and Brasswind', 'Best Buy for Business']\n project_resource_type text, -- example: ['Technology', 'Supplies']\n item_unit_price real, -- example: [149.0, 148.0]\n item_quantity integer, -- example: [4, 1]\n PRIMARY KEY (resourceid),\n CONSTRAINT fk_resources_projectid FOREIGN KEY (projectid) REFERENCES projects (projectid)\n);\n\nCREATE TABLE projects (\n projectid text, -- example: ['00001ccc0e81598c4bd86bacb94d7acb', '00002bff514104264a6b798356fdd893']\n teacher_acctid text, -- example: ['42d43fa6f37314365d08692e08680973', '864eb466462bf704bf7a16a585ef296a']\n schoolid text, -- example: ['c0e6ce89b244764085691a1b8e28cb81', 'd711e47810900c96f26a5d0be30c446d']\n school_ncesid text, -- school national center for education statistics id, example: ['063627006187', '483702008193']\n school_latitude real, -- example: [36.57634, 32.911179]\n school_longitude real, -- example: [-119.608713, -96.72364]\n school_state text, -- example: ['CO', 'CA', 'TX']\n school_zip integer, -- example: [93662, 75243]\n school_metro text, -- example: ['urban', 'rural']\n school_district text, -- example: ['Onslow Co School District', 'Selma Unified Sch District', 'Richardson Ind School District']\n school_county text, -- example: ['Onslow', 'Fresno', 'Dallas']\n school_charter text, -- example: ['f', 't']\n school_year_round text, -- example: ['f', 't']\n school_nlns text, -- school Nonleafy Normal Stature, example: ['f', 't']\n school_kipp text, -- school Knowledge Is Power Program, example: ['f', 't']\n school_charter_ready_promise text, -- example: ['f', 't']\n teacher_teach_for_america text, -- teachers teach for america, example: ['f', 't']\n teacher_ny_teaching_fellow text, -- teacher_new_york_teaching_fellow, example: ['f', 't']\n primary_focus_subject text, -- example: ['Literature & Writing', 'Literacy']\n primary_focus_area text, -- example: ['Literacy & Language', 'History & Civics']\n secondary_focus_subject text, -- example: ['College & Career Prep', 'ESL']\n resource_type text, -- example: ['Books', 'Technology']\n poverty_level text, -- example: ['highest poverty', 'high poverty']\n grade_level text, -- example: ['Grades 6-8', 'Grades PreK-2']\n fulfillment_labor_materials real, -- example: [30.0, 35.0]\n eligible_double_your_impact_match text, -- example: ['f', 't']\n eligible_almost_home_match text, -- example: ['f', 't']\n date_posted date, -- example: ['2014-05-12', '2014-05-11']\n PRIMARY KEY (projectid)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nOnslow Co School District refers to school_district = 'Onslow Co School District';\nHow many total items were requested for the Onslow Co School District urban metro school projects?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"split": "train"
} |
nl2sql | [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE essays (\n projectid text, -- example: ['ffffc4f85b60efc5b52347df489d0238', 'ffffac55ee02a49d1abc87ba6fc61135']\n teacher_acctid text, -- example: ['c24011b20fc161ed02248e85beb59a90', '947066d0af47e0566f334566553dd6a6']\n title text, -- example: ['College', 'iMath', \"Recording Rockin' Readers\"]\n short_description text, -- example: ['It is imperative that teachers bring tec', 'Can you imagine having to translate ever']\n need_statement text, -- example: ['My students need four iPods.', 'My students need a camcorder. ']\n essay text, -- example: ['I am a fourth year fifth grade math teac', 'Can you imagine having to translate ever']\n);\n\nCREATE TABLE resources (\n resourceid text, -- example: ['0000037fecc4461faf0e49328ae66661', '0000046b69c683354ca46b30db5c558e']\n projectid text, -- example: ['ffffc4f85b60efc5b52347df489d0238', 'ffffac55ee02a49d1abc87ba6fc61135']\n vendorid integer, -- example: [430, 82]\n vendor_name text, -- example: ['Woodwind and Brasswind', 'Best Buy for Business']\n project_resource_type text, -- example: ['Technology', 'Supplies']\n item_name text, -- example: ['iPod nano 4th Gen 8GB (Black)', 'Sony bloggie MHS-FS1 - camcorder - inter']\n item_unit_price real, -- example: [149.0, 148.0]\n PRIMARY KEY (resourceid),\n CONSTRAINT fk_resources_projectid FOREIGN KEY (projectid) REFERENCES projects (projectid)\n);\n\nCREATE TABLE donations (\n donationid text, -- example: ['000000a91a14ed37bef82e125c102e77', '000013be53ed7382ed5d5975eb86eb85']\n projectid text, -- example: ['ffffac55ee02a49d1abc87ba6fc61135', 'ffff97ed93720407d70a2787475932b0']\n donor_acctid text, -- donor accid, example: ['22cbc920c9b5fa08dfb331422f5926b5', '521f1830a77c9dbbf8119d99c6206a16']\n donor_city text, -- example: ['Donation', 'Divide', 'FRESNO', 'fresno', 'Fresno', 'Peachtree City']\n donor_state text, -- example: ['GA', 'MD']\n donor_zip text, -- example: ['30269', '20853']\n is_teacher_acct text, -- example: ['f', 't']\n donation_timestamp datetime, -- example: ['2011-08-25 14:27:34.807', '2011-11-04 07:54:21.552']\n donation_to_project real, -- example: [42.5, 26.83]\n donation_optional_support real, -- example: [7.5, 4.73]\n donation_total real, -- example: [50.0, 31.56]\n dollar_amount text, -- example: ['10_to_100', 'under_10']\n donation_included_optional_support text, -- example: ['t', 'f']\n payment_method text, -- example: ['no_cash_received', 'creditcard']\n payment_included_acct_credit text, -- example: ['f', 't']\n payment_included_campaign_gift_card text, -- example: ['t', 'f']\n payment_included_web_purchased_gift_card text, -- example: ['f', 't']\n payment_was_promo_matched text, -- example: ['f', 't']\n via_giving_page text, -- example: ['f', 't']\n for_honoree text, -- example: ['f', 't']\n donation_message text, -- example: ['donation', 'Donation', 'I gave to this project because I support', 'I donated because I want to support kids']\n PRIMARY KEY (donationid),\n CONSTRAINT fk_donations_projectid FOREIGN KEY (projectid) REFERENCES projects (projectid)\n);\n\nCREATE TABLE projects (\n projectid text, -- example: ['00001ccc0e81598c4bd86bacb94d7acb', '00002bff514104264a6b798356fdd893']\n schoolid text, -- example: ['c0e6ce89b244764085691a1b8e28cb81', 'd711e47810900c96f26a5d0be30c446d']\n school_ncesid text, -- school national center for education statistics id, example: ['063627006187', '483702008193']\n school_latitude real, -- example: [36.57634, 32.911179]\n school_longitude real, -- example: [-119.608713, -96.72364]\n school_city text, -- example: ['Divide', 'Fresno', 'Selma', 'Dallas']\n school_state text, -- example: ['CA', 'TX']\n school_metro text, -- example: ['urban', 'rural']\n school_county text, -- example: ['Divide', 'Fresno', 'Dallas']\n school_charter text, -- example: ['f', 't']\n school_magnet text, -- example: ['f', 't']\n school_year_round text, -- example: ['f', 't']\n school_nlns text, -- school Nonleafy Normal Stature, example: ['f', 't']\n school_kipp text, -- school Knowledge Is Power Program, example: ['f', 't']\n school_charter_ready_promise text, -- example: ['f', 't']\n teacher_prefix text, -- example: ['Mrs.', 'Mr.']\n teacher_teach_for_america text, -- teachers teach for america, example: ['f', 't']\n primary_focus_subject text, -- example: ['Literature & Writing', 'Literacy']\n primary_focus_area text, -- example: ['Literacy & Language', 'History & Civics']\n secondary_focus_subject text, -- example: ['College & Career Prep', 'ESL']\n secondary_focus_area text, -- example: ['Applied Learning', 'Literacy & Language']\n resource_type text, -- example: ['Books', 'Technology']\n poverty_level text, -- example: ['highest poverty', 'high poverty']\n grade_level text, -- example: ['Grades 6-8', 'Grades PreK-2']\n fulfillment_labor_materials real, -- example: [30.0, 35.0]\n total_price_excluding_optional_support real, -- example: [555.81, 296.47]\n total_price_including_optional_support real, -- example: [653.89, 348.79]\n eligible_double_your_impact_match text, -- example: ['f', 't']\n eligible_almost_home_match text, -- example: ['f', 't']\n date_posted date, -- example: ['2014-05-12', '2014-05-11']\n PRIMARY KEY (projectid)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nFresno County colleges refers to school_county = 'Fresno'; average refers to DIVIDE(sum(donation_optional_support,donation_to_project),sum(donation_total))\nWhat is the average total donations received by Fresno County colleges?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"role": "user"
}
] | nl2sql | {
"ground_truth": "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'",
"style": "rule"
} | {
"db_id": "donor.sqlite",
"gt_sql": "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'",
"index": 1606,
"question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE essays (\n projectid text, -- example: ['ffffc4f85b60efc5b52347df489d0238', 'ffffac55ee02a49d1abc87ba6fc61135']\n teacher_acctid text, -- example: ['c24011b20fc161ed02248e85beb59a90', '947066d0af47e0566f334566553dd6a6']\n title text, -- example: ['College', 'iMath', \"Recording Rockin' Readers\"]\n short_description text, -- example: ['It is imperative that teachers bring tec', 'Can you imagine having to translate ever']\n need_statement text, -- example: ['My students need four iPods.', 'My students need a camcorder. ']\n essay text, -- example: ['I am a fourth year fifth grade math teac', 'Can you imagine having to translate ever']\n);\n\nCREATE TABLE resources (\n resourceid text, -- example: ['0000037fecc4461faf0e49328ae66661', '0000046b69c683354ca46b30db5c558e']\n projectid text, -- example: ['ffffc4f85b60efc5b52347df489d0238', 'ffffac55ee02a49d1abc87ba6fc61135']\n vendorid integer, -- example: [430, 82]\n vendor_name text, -- example: ['Woodwind and Brasswind', 'Best Buy for Business']\n project_resource_type text, -- example: ['Technology', 'Supplies']\n item_name text, -- example: ['iPod nano 4th Gen 8GB (Black)', 'Sony bloggie MHS-FS1 - camcorder - inter']\n item_unit_price real, -- example: [149.0, 148.0]\n PRIMARY KEY (resourceid),\n CONSTRAINT fk_resources_projectid FOREIGN KEY (projectid) REFERENCES projects (projectid)\n);\n\nCREATE TABLE donations (\n donationid text, -- example: ['000000a91a14ed37bef82e125c102e77', '000013be53ed7382ed5d5975eb86eb85']\n projectid text, -- example: ['ffffac55ee02a49d1abc87ba6fc61135', 'ffff97ed93720407d70a2787475932b0']\n donor_acctid text, -- donor accid, example: ['22cbc920c9b5fa08dfb331422f5926b5', '521f1830a77c9dbbf8119d99c6206a16']\n donor_city text, -- example: ['Donation', 'Divide', 'FRESNO', 'fresno', 'Fresno', 'Peachtree City']\n donor_state text, -- example: ['GA', 'MD']\n donor_zip text, -- example: ['30269', '20853']\n is_teacher_acct text, -- example: ['f', 't']\n donation_timestamp datetime, -- example: ['2011-08-25 14:27:34.807', '2011-11-04 07:54:21.552']\n donation_to_project real, -- example: [42.5, 26.83]\n donation_optional_support real, -- example: [7.5, 4.73]\n donation_total real, -- example: [50.0, 31.56]\n dollar_amount text, -- example: ['10_to_100', 'under_10']\n donation_included_optional_support text, -- example: ['t', 'f']\n payment_method text, -- example: ['no_cash_received', 'creditcard']\n payment_included_acct_credit text, -- example: ['f', 't']\n payment_included_campaign_gift_card text, -- example: ['t', 'f']\n payment_included_web_purchased_gift_card text, -- example: ['f', 't']\n payment_was_promo_matched text, -- example: ['f', 't']\n via_giving_page text, -- example: ['f', 't']\n for_honoree text, -- example: ['f', 't']\n donation_message text, -- example: ['donation', 'Donation', 'I gave to this project because I support', 'I donated because I want to support kids']\n PRIMARY KEY (donationid),\n CONSTRAINT fk_donations_projectid FOREIGN KEY (projectid) REFERENCES projects (projectid)\n);\n\nCREATE TABLE projects (\n projectid text, -- example: ['00001ccc0e81598c4bd86bacb94d7acb', '00002bff514104264a6b798356fdd893']\n schoolid text, -- example: ['c0e6ce89b244764085691a1b8e28cb81', 'd711e47810900c96f26a5d0be30c446d']\n school_ncesid text, -- school national center for education statistics id, example: ['063627006187', '483702008193']\n school_latitude real, -- example: [36.57634, 32.911179]\n school_longitude real, -- example: [-119.608713, -96.72364]\n school_city text, -- example: ['Divide', 'Fresno', 'Selma', 'Dallas']\n school_state text, -- example: ['CA', 'TX']\n school_metro text, -- example: ['urban', 'rural']\n school_county text, -- example: ['Divide', 'Fresno', 'Dallas']\n school_charter text, -- example: ['f', 't']\n school_magnet text, -- example: ['f', 't']\n school_year_round text, -- example: ['f', 't']\n school_nlns text, -- school Nonleafy Normal Stature, example: ['f', 't']\n school_kipp text, -- school Knowledge Is Power Program, example: ['f', 't']\n school_charter_ready_promise text, -- example: ['f', 't']\n teacher_prefix text, -- example: ['Mrs.', 'Mr.']\n teacher_teach_for_america text, -- teachers teach for america, example: ['f', 't']\n primary_focus_subject text, -- example: ['Literature & Writing', 'Literacy']\n primary_focus_area text, -- example: ['Literacy & Language', 'History & Civics']\n secondary_focus_subject text, -- example: ['College & Career Prep', 'ESL']\n secondary_focus_area text, -- example: ['Applied Learning', 'Literacy & Language']\n resource_type text, -- example: ['Books', 'Technology']\n poverty_level text, -- example: ['highest poverty', 'high poverty']\n grade_level text, -- example: ['Grades 6-8', 'Grades PreK-2']\n fulfillment_labor_materials real, -- example: [30.0, 35.0]\n total_price_excluding_optional_support real, -- example: [555.81, 296.47]\n total_price_including_optional_support real, -- example: [653.89, 348.79]\n eligible_double_your_impact_match text, -- example: ['f', 't']\n eligible_almost_home_match text, -- example: ['f', 't']\n date_posted date, -- example: ['2014-05-12', '2014-05-11']\n PRIMARY KEY (projectid)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nFresno County colleges refers to school_county = 'Fresno'; average refers to DIVIDE(sum(donation_optional_support,donation_to_project),sum(donation_total))\nWhat is the average total donations received by Fresno County colleges?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"split": "train"
} |
nl2sql | [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE donations (\n donationid text, -- example: ['000000a91a14ed37bef82e125c102e77', '000013be53ed7382ed5d5975eb86eb85']\n projectid text, -- example: ['ffffac55ee02a49d1abc87ba6fc61135', 'ffff97ed93720407d70a2787475932b0']\n donor_acctid text, -- donor accid, example: ['22cbc920c9b5fa08dfb331422f5926b5', '521f1830a77c9dbbf8119d99c6206a16']\n donor_city text, -- example: ['Peachtree City', 'Rockville']\n donor_zip text, -- example: ['30269', '20853']\n is_teacher_acct text, -- example: ['f', 't']\n donation_timestamp datetime, -- example: ['2011-08-25 14:27:34.807', '2011-11-04 07:54:21.552']\n donation_to_project real, -- example: [42.5, 26.83]\n donation_optional_support real, -- example: [7.5, 4.73]\n donation_total real, -- example: [50.0, 31.56]\n dollar_amount text, -- example: ['10_to_100', 'under_10']\n donation_included_optional_support text, -- example: ['t', 'f']\n payment_method text, -- example: ['no_cash_received', 'creditcard']\n payment_included_acct_credit text, -- example: ['f', 't']\n payment_included_campaign_gift_card text, -- example: ['t', 'f']\n payment_included_web_purchased_gift_card text, -- example: ['f', 't']\n via_giving_page text, -- example: ['f', 't']\n for_honoree text, -- example: ['f', 't']\n donation_message text, -- example: ['I gave to this project because I support', 'I donated because I want to support kids']\n PRIMARY KEY (donationid),\n CONSTRAINT fk_donations_projectid FOREIGN KEY (projectid) REFERENCES projects (projectid)\n);\n\nCREATE TABLE resources (\n resourceid text, -- example: ['0000037fecc4461faf0e49328ae66661', '0000046b69c683354ca46b30db5c558e']\n projectid text, -- example: ['ffffc4f85b60efc5b52347df489d0238', 'ffffac55ee02a49d1abc87ba6fc61135']\n vendorid integer, -- example: [430, 82]\n project_resource_type text, -- example: ['Technology', 'Supplies']\n item_name text, -- example: ['iPod nano 4th Gen 8GB (Black)', 'Sony bloggie MHS-FS1 - camcorder - inter']\n item_unit_price real, -- example: [149.0, 148.0]\n PRIMARY KEY (resourceid),\n CONSTRAINT fk_resources_projectid FOREIGN KEY (projectid) REFERENCES projects (projectid)\n);\n\nCREATE TABLE projects (\n projectid text, -- example: ['00001ccc0e81598c4bd86bacb94d7acb', '00002bff514104264a6b798356fdd893']\n teacher_acctid text, -- example: ['42d43fa6f37314365d08692e08680973', '864eb466462bf704bf7a16a585ef296a']\n schoolid text, -- example: ['c0e6ce89b244764085691a1b8e28cb81', 'd711e47810900c96f26a5d0be30c446d']\n school_ncesid text, -- school national center for education statistics id, example: ['063627006187', '483702008193']\n school_latitude real, -- example: [36.57634, 32.911179]\n school_longitude real, -- example: [-119.608713, -96.72364]\n school_city text, -- example: ['Selma', 'Dallas']\n school_state text, -- example: ['CA', 'TX']\n school_zip integer, -- example: [93662, 75243]\n school_metro text, -- example: ['urban', 'rural']\n school_district text, -- example: ['Selma Unified Sch District', 'Richardson Ind School District']\n school_county text, -- example: ['Fresno', 'Dallas']\n school_nlns text, -- school Nonleafy Normal Stature, example: ['f', 't']\n school_kipp text, -- school Knowledge Is Power Program, example: ['f', 't']\n school_charter_ready_promise text, -- example: ['f', 't']\n teacher_prefix text, -- example: ['Mrs.', 'Mr.']\n teacher_teach_for_america text, -- teachers teach for america, example: ['f', 't']\n primary_focus_subject text, -- example: ['Literature & Writing', 'Literacy']\n primary_focus_area text, -- example: ['Literacy & Language', 'History & Civics']\n secondary_focus_area text, -- example: ['Applied Learning', 'Literacy & Language']\n poverty_level text, -- example: ['highest poverty', 'high poverty']\n fulfillment_labor_materials real, -- example: [30.0, 35.0]\n total_price_excluding_optional_support real, -- example: [555.81, 296.47]\n total_price_including_optional_support real, -- example: [653.89, 348.79]\n eligible_double_your_impact_match text, -- example: ['f', 't']\n eligible_almost_home_match text, -- example: ['f', 't']\n date_posted date, -- example: ['2014-05-12', '2014-05-11']\n PRIMARY KEY (projectid)\n);\n\nCREATE TABLE essays (\n projectid text, -- example: ['ffffc4f85b60efc5b52347df489d0238', 'ffffac55ee02a49d1abc87ba6fc61135']\n teacher_acctid text, -- example: ['c24011b20fc161ed02248e85beb59a90', '947066d0af47e0566f334566553dd6a6']\n title text, -- example: ['iMath', \"Recording Rockin' Readers\"]\n short_description text, -- example: ['It is imperative that teachers bring tec', 'Can you imagine having to translate ever']\n need_statement text, -- example: ['My students need four iPods.', 'My students need a camcorder. ']\n essay text, -- example: ['I am a fourth year fifth grade math teac', 'Can you imagine having to translate ever']\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nproject \"Photojournalists Want to Exhibit Their Best Works\" refers to title = 'Photojournalists Want to Exhibit Their Best Works'; when project go live refers to datePosted\nWhen did the project \"Photojournalists Want to Exhibit Their Best Works\" go live?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"role": "user"
}
] | nl2sql | {
"ground_truth": "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'",
"style": "rule"
} | {
"db_id": "donor.sqlite",
"gt_sql": "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'",
"index": 1607,
"question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE donations (\n donationid text, -- example: ['000000a91a14ed37bef82e125c102e77', '000013be53ed7382ed5d5975eb86eb85']\n projectid text, -- example: ['ffffac55ee02a49d1abc87ba6fc61135', 'ffff97ed93720407d70a2787475932b0']\n donor_acctid text, -- donor accid, example: ['22cbc920c9b5fa08dfb331422f5926b5', '521f1830a77c9dbbf8119d99c6206a16']\n donor_city text, -- example: ['Peachtree City', 'Rockville']\n donor_zip text, -- example: ['30269', '20853']\n is_teacher_acct text, -- example: ['f', 't']\n donation_timestamp datetime, -- example: ['2011-08-25 14:27:34.807', '2011-11-04 07:54:21.552']\n donation_to_project real, -- example: [42.5, 26.83]\n donation_optional_support real, -- example: [7.5, 4.73]\n donation_total real, -- example: [50.0, 31.56]\n dollar_amount text, -- example: ['10_to_100', 'under_10']\n donation_included_optional_support text, -- example: ['t', 'f']\n payment_method text, -- example: ['no_cash_received', 'creditcard']\n payment_included_acct_credit text, -- example: ['f', 't']\n payment_included_campaign_gift_card text, -- example: ['t', 'f']\n payment_included_web_purchased_gift_card text, -- example: ['f', 't']\n via_giving_page text, -- example: ['f', 't']\n for_honoree text, -- example: ['f', 't']\n donation_message text, -- example: ['I gave to this project because I support', 'I donated because I want to support kids']\n PRIMARY KEY (donationid),\n CONSTRAINT fk_donations_projectid FOREIGN KEY (projectid) REFERENCES projects (projectid)\n);\n\nCREATE TABLE resources (\n resourceid text, -- example: ['0000037fecc4461faf0e49328ae66661', '0000046b69c683354ca46b30db5c558e']\n projectid text, -- example: ['ffffc4f85b60efc5b52347df489d0238', 'ffffac55ee02a49d1abc87ba6fc61135']\n vendorid integer, -- example: [430, 82]\n project_resource_type text, -- example: ['Technology', 'Supplies']\n item_name text, -- example: ['iPod nano 4th Gen 8GB (Black)', 'Sony bloggie MHS-FS1 - camcorder - inter']\n item_unit_price real, -- example: [149.0, 148.0]\n PRIMARY KEY (resourceid),\n CONSTRAINT fk_resources_projectid FOREIGN KEY (projectid) REFERENCES projects (projectid)\n);\n\nCREATE TABLE projects (\n projectid text, -- example: ['00001ccc0e81598c4bd86bacb94d7acb', '00002bff514104264a6b798356fdd893']\n teacher_acctid text, -- example: ['42d43fa6f37314365d08692e08680973', '864eb466462bf704bf7a16a585ef296a']\n schoolid text, -- example: ['c0e6ce89b244764085691a1b8e28cb81', 'd711e47810900c96f26a5d0be30c446d']\n school_ncesid text, -- school national center for education statistics id, example: ['063627006187', '483702008193']\n school_latitude real, -- example: [36.57634, 32.911179]\n school_longitude real, -- example: [-119.608713, -96.72364]\n school_city text, -- example: ['Selma', 'Dallas']\n school_state text, -- example: ['CA', 'TX']\n school_zip integer, -- example: [93662, 75243]\n school_metro text, -- example: ['urban', 'rural']\n school_district text, -- example: ['Selma Unified Sch District', 'Richardson Ind School District']\n school_county text, -- example: ['Fresno', 'Dallas']\n school_nlns text, -- school Nonleafy Normal Stature, example: ['f', 't']\n school_kipp text, -- school Knowledge Is Power Program, example: ['f', 't']\n school_charter_ready_promise text, -- example: ['f', 't']\n teacher_prefix text, -- example: ['Mrs.', 'Mr.']\n teacher_teach_for_america text, -- teachers teach for america, example: ['f', 't']\n primary_focus_subject text, -- example: ['Literature & Writing', 'Literacy']\n primary_focus_area text, -- example: ['Literacy & Language', 'History & Civics']\n secondary_focus_area text, -- example: ['Applied Learning', 'Literacy & Language']\n poverty_level text, -- example: ['highest poverty', 'high poverty']\n fulfillment_labor_materials real, -- example: [30.0, 35.0]\n total_price_excluding_optional_support real, -- example: [555.81, 296.47]\n total_price_including_optional_support real, -- example: [653.89, 348.79]\n eligible_double_your_impact_match text, -- example: ['f', 't']\n eligible_almost_home_match text, -- example: ['f', 't']\n date_posted date, -- example: ['2014-05-12', '2014-05-11']\n PRIMARY KEY (projectid)\n);\n\nCREATE TABLE essays (\n projectid text, -- example: ['ffffc4f85b60efc5b52347df489d0238', 'ffffac55ee02a49d1abc87ba6fc61135']\n teacher_acctid text, -- example: ['c24011b20fc161ed02248e85beb59a90', '947066d0af47e0566f334566553dd6a6']\n title text, -- example: ['iMath', \"Recording Rockin' Readers\"]\n short_description text, -- example: ['It is imperative that teachers bring tec', 'Can you imagine having to translate ever']\n need_statement text, -- example: ['My students need four iPods.', 'My students need a camcorder. ']\n essay text, -- example: ['I am a fourth year fifth grade math teac', 'Can you imagine having to translate ever']\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nproject \"Photojournalists Want to Exhibit Their Best Works\" refers to title = 'Photojournalists Want to Exhibit Their Best Works'; when project go live refers to datePosted\nWhen did the project \"Photojournalists Want to Exhibit Their Best Works\" go live?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"split": "train"
} |
nl2sql | [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE essays (\n projectid text, -- example: ['ffffc4f85b60efc5b52347df489d0238', 'ffffac55ee02a49d1abc87ba6fc61135']\n title text, -- example: ['Mathematics', 'iMath', \"Recording Rockin' Readers\"]\n need_statement text, -- example: ['My students need four iPods.', 'My students need a camcorder. ']\n);\n\nCREATE TABLE resources (\n resourceid text, -- example: ['0000037fecc4461faf0e49328ae66661', '0000046b69c683354ca46b30db5c558e']\n projectid text, -- example: ['ffffc4f85b60efc5b52347df489d0238', 'ffffac55ee02a49d1abc87ba6fc61135']\n vendorid integer, -- example: [430, 82]\n item_name text, -- example: ['item', 'Max', 'MAX', 'iPod nano 4th Gen 8GB (Black)', 'Sony bloggie MHS-FS1 - camcorder - inter']\n item_number text, -- example: ['249995.001', 'BB11216668']\n item_unit_price real, -- example: [149.0, 148.0]\n item_quantity integer, -- example: [4, 1]\n PRIMARY KEY (resourceid),\n CONSTRAINT fk_resources_projectid FOREIGN KEY (projectid) REFERENCES projects (projectid)\n);\n\nCREATE TABLE donations (\n donationid text, -- example: ['000000a91a14ed37bef82e125c102e77', '000013be53ed7382ed5d5975eb86eb85']\n projectid text, -- example: ['ffffac55ee02a49d1abc87ba6fc61135', 'ffff97ed93720407d70a2787475932b0']\n is_teacher_acct text, -- example: ['f', 't']\n donation_timestamp datetime, -- example: ['2011-08-25 14:27:34.807', '2011-11-04 07:54:21.552']\n donation_to_project real, -- example: [42.5, 26.83]\n donation_optional_support real, -- example: [7.5, 4.73]\n donation_total real, -- example: [50.0, 31.56]\n dollar_amount text, -- example: ['10_to_100', 'under_10']\n donation_included_optional_support text, -- example: ['t', 'f']\n payment_method text, -- example: ['no_cash_received', 'creditcard']\n payment_included_acct_credit text, -- example: ['f', 't']\n payment_included_campaign_gift_card text, -- example: ['t', 'f']\n payment_included_web_purchased_gift_card text, -- example: ['f', 't']\n payment_was_promo_matched text, -- example: ['f', 't']\n via_giving_page text, -- example: ['f', 't']\n for_honoree text, -- example: ['f', 't']\n PRIMARY KEY (donationid),\n CONSTRAINT fk_donations_projectid FOREIGN KEY (projectid) REFERENCES projects (projectid)\n);\n\nCREATE TABLE projects (\n projectid text, -- example: ['00001ccc0e81598c4bd86bacb94d7acb', '00002bff514104264a6b798356fdd893']\n school_city text, -- example: ['Selma', 'Dallas']\n school_state text, -- example: ['CA', 'TX']\n school_zip integer, -- example: [93662, 75243]\n school_metro text, -- example: ['urban', 'rural']\n school_district text, -- example: ['Selma Unified Sch District', 'Richardson Ind School District']\n school_county text, -- example: ['Fresno', 'Dallas']\n school_magnet text, -- example: ['f', 't']\n school_year_round text, -- example: ['f', 't']\n school_charter_ready_promise text, -- example: ['f', 't']\n teacher_prefix text, -- example: ['Mrs.', 'Mr.']\n primary_focus_subject text, -- example: ['Mathematics', 'Literature & Writing', 'Literacy']\n secondary_focus_subject text, -- example: ['Mathematics', 'College & Career Prep', 'ESL']\n secondary_focus_area text, -- example: ['Applied Learning', 'Literacy & Language']\n resource_type text, -- example: ['Books', 'Technology']\n grade_level text, -- example: ['Grades 6-8', 'Grades PreK-2']\n total_price_excluding_optional_support real, -- example: [555.81, 296.47]\n total_price_including_optional_support real, -- example: [653.89, 348.79]\n eligible_double_your_impact_match text, -- example: ['f', 't']\n date_posted date, -- example: ['2014-05-12', '2014-05-11']\n PRIMARY KEY (projectid)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nMathematics as a primary subject refers to primary_focus_subject = 'Mathematics'; most expensive refers to max(item_unit_price)\nWhich item provided for projects with Mathematics as a primary subject is the most expensive?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"role": "user"
}
] | nl2sql | {
"ground_truth": "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",
"style": "rule"
} | {
"db_id": "donor.sqlite",
"gt_sql": "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",
"index": 1608,
"question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE essays (\n projectid text, -- example: ['ffffc4f85b60efc5b52347df489d0238', 'ffffac55ee02a49d1abc87ba6fc61135']\n title text, -- example: ['Mathematics', 'iMath', \"Recording Rockin' Readers\"]\n need_statement text, -- example: ['My students need four iPods.', 'My students need a camcorder. ']\n);\n\nCREATE TABLE resources (\n resourceid text, -- example: ['0000037fecc4461faf0e49328ae66661', '0000046b69c683354ca46b30db5c558e']\n projectid text, -- example: ['ffffc4f85b60efc5b52347df489d0238', 'ffffac55ee02a49d1abc87ba6fc61135']\n vendorid integer, -- example: [430, 82]\n item_name text, -- example: ['item', 'Max', 'MAX', 'iPod nano 4th Gen 8GB (Black)', 'Sony bloggie MHS-FS1 - camcorder - inter']\n item_number text, -- example: ['249995.001', 'BB11216668']\n item_unit_price real, -- example: [149.0, 148.0]\n item_quantity integer, -- example: [4, 1]\n PRIMARY KEY (resourceid),\n CONSTRAINT fk_resources_projectid FOREIGN KEY (projectid) REFERENCES projects (projectid)\n);\n\nCREATE TABLE donations (\n donationid text, -- example: ['000000a91a14ed37bef82e125c102e77', '000013be53ed7382ed5d5975eb86eb85']\n projectid text, -- example: ['ffffac55ee02a49d1abc87ba6fc61135', 'ffff97ed93720407d70a2787475932b0']\n is_teacher_acct text, -- example: ['f', 't']\n donation_timestamp datetime, -- example: ['2011-08-25 14:27:34.807', '2011-11-04 07:54:21.552']\n donation_to_project real, -- example: [42.5, 26.83]\n donation_optional_support real, -- example: [7.5, 4.73]\n donation_total real, -- example: [50.0, 31.56]\n dollar_amount text, -- example: ['10_to_100', 'under_10']\n donation_included_optional_support text, -- example: ['t', 'f']\n payment_method text, -- example: ['no_cash_received', 'creditcard']\n payment_included_acct_credit text, -- example: ['f', 't']\n payment_included_campaign_gift_card text, -- example: ['t', 'f']\n payment_included_web_purchased_gift_card text, -- example: ['f', 't']\n payment_was_promo_matched text, -- example: ['f', 't']\n via_giving_page text, -- example: ['f', 't']\n for_honoree text, -- example: ['f', 't']\n PRIMARY KEY (donationid),\n CONSTRAINT fk_donations_projectid FOREIGN KEY (projectid) REFERENCES projects (projectid)\n);\n\nCREATE TABLE projects (\n projectid text, -- example: ['00001ccc0e81598c4bd86bacb94d7acb', '00002bff514104264a6b798356fdd893']\n school_city text, -- example: ['Selma', 'Dallas']\n school_state text, -- example: ['CA', 'TX']\n school_zip integer, -- example: [93662, 75243]\n school_metro text, -- example: ['urban', 'rural']\n school_district text, -- example: ['Selma Unified Sch District', 'Richardson Ind School District']\n school_county text, -- example: ['Fresno', 'Dallas']\n school_magnet text, -- example: ['f', 't']\n school_year_round text, -- example: ['f', 't']\n school_charter_ready_promise text, -- example: ['f', 't']\n teacher_prefix text, -- example: ['Mrs.', 'Mr.']\n primary_focus_subject text, -- example: ['Mathematics', 'Literature & Writing', 'Literacy']\n secondary_focus_subject text, -- example: ['Mathematics', 'College & Career Prep', 'ESL']\n secondary_focus_area text, -- example: ['Applied Learning', 'Literacy & Language']\n resource_type text, -- example: ['Books', 'Technology']\n grade_level text, -- example: ['Grades 6-8', 'Grades PreK-2']\n total_price_excluding_optional_support real, -- example: [555.81, 296.47]\n total_price_including_optional_support real, -- example: [653.89, 348.79]\n eligible_double_your_impact_match text, -- example: ['f', 't']\n date_posted date, -- example: ['2014-05-12', '2014-05-11']\n PRIMARY KEY (projectid)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nMathematics as a primary subject refers to primary_focus_subject = 'Mathematics'; most expensive refers to max(item_unit_price)\nWhich item provided for projects with Mathematics as a primary subject is the most expensive?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"split": "train"
} |
nl2sql | [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE donations (\n donationid text, -- example: ['000000a91a14ed37bef82e125c102e77', '000013be53ed7382ed5d5975eb86eb85']\n projectid text, -- example: ['ffffac55ee02a49d1abc87ba6fc61135', 'ffff97ed93720407d70a2787475932b0']\n donor_acctid text, -- donor accid, example: ['22cbc920c9b5fa08dfb331422f5926b5', '521f1830a77c9dbbf8119d99c6206a16']\n donor_state text, -- example: ['GA', 'MD']\n dollar_amount text, -- example: ['10_to_100', 'under_10']\n donation_included_optional_support text, -- example: ['t', 'f']\n payment_method text, -- example: ['no_cash_received', 'creditcard']\n payment_included_acct_credit text, -- example: ['f', 't']\n payment_included_web_purchased_gift_card text, -- example: ['f', 't']\n via_giving_page text, -- example: ['f', 't']\n PRIMARY KEY (donationid),\n CONSTRAINT fk_donations_projectid FOREIGN KEY (projectid) REFERENCES projects (projectid)\n);\n\nCREATE TABLE projects (\n projectid text, -- example: ['00001ccc0e81598c4bd86bacb94d7acb', '00002bff514104264a6b798356fdd893']\n teacher_acctid text, -- example: ['42d43fa6f37314365d08692e08680973', '864eb466462bf704bf7a16a585ef296a']\n schoolid text, -- example: ['c0e6ce89b244764085691a1b8e28cb81', 'd711e47810900c96f26a5d0be30c446d']\n school_longitude real, -- example: [-119.608713, -96.72364]\n school_city text, -- example: ['Many', 'Selma', 'Dallas']\n school_state text, -- example: ['CA', 'TX']\n school_year_round text, -- example: ['f', 't']\n teacher_ny_teaching_fellow text, -- teacher_new_york_teaching_fellow, example: ['f', 't']\n primary_focus_subject text, -- example: ['Literature & Writing', 'Literacy']\n primary_focus_area text, -- example: ['Literacy & Language', 'History & Civics']\n secondary_focus_subject text, -- example: ['College & Career Prep', 'ESL']\n secondary_focus_area text, -- example: ['Applied Learning', 'Literacy & Language']\n poverty_level text, -- example: ['highest poverty', 'high poverty']\n fulfillment_labor_materials real, -- example: [30.0, 35.0]\n total_price_excluding_optional_support real, -- example: [555.81, 296.47]\n students_reached integer, -- example: [32, 22]\n eligible_double_your_impact_match text, -- example: ['f', 't']\n eligible_almost_home_match text, -- example: ['f', 't']\n date_posted date, -- example: ['2014-05-12', '2014-05-11']\n PRIMARY KEY (projectid)\n);\n\nCREATE TABLE essays (\n projectid text, -- example: ['ffffc4f85b60efc5b52347df489d0238', 'ffffac55ee02a49d1abc87ba6fc61135']\n title text, -- example: ['Look, Look, We Need a Nook!', 'iMath', \"Recording Rockin' Readers\"]\n essay text, -- example: ['I am a fourth year fifth grade math teac', 'Can you imagine having to translate ever']\n);\n\nCREATE TABLE resources (\n resourceid text, -- example: ['0000037fecc4461faf0e49328ae66661', '0000046b69c683354ca46b30db5c558e']\n projectid text, -- example: ['ffffc4f85b60efc5b52347df489d0238', 'ffffac55ee02a49d1abc87ba6fc61135']\n vendorid integer, -- example: [430, 82]\n item_name text, -- example: ['Nook', 'NOOK', 'How Many?', 'iPod nano 4th Gen 8GB (Black)', 'Sony bloggie MHS-FS1 - camcorder - inter']\n item_number text, -- example: ['249995.001', 'BB11216668']\n item_unit_price real, -- example: [149.0, 148.0]\n item_quantity integer, -- example: [4, 1]\n PRIMARY KEY (resourceid),\n CONSTRAINT fk_resources_projectid FOREIGN KEY (projectid) REFERENCES projects (projectid)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nproject \"Look, Look, We Need a Nook!\" refers to title = 'Look, Look, We Need a Nook!'\nHow many donations does the project \"Look, Look, We Need a Nook!\" have?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"role": "user"
}
] | nl2sql | {
"ground_truth": "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!'",
"style": "rule"
} | {
"db_id": "donor.sqlite",
"gt_sql": "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!'",
"index": 1609,
"question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE donations (\n donationid text, -- example: ['000000a91a14ed37bef82e125c102e77', '000013be53ed7382ed5d5975eb86eb85']\n projectid text, -- example: ['ffffac55ee02a49d1abc87ba6fc61135', 'ffff97ed93720407d70a2787475932b0']\n donor_acctid text, -- donor accid, example: ['22cbc920c9b5fa08dfb331422f5926b5', '521f1830a77c9dbbf8119d99c6206a16']\n donor_state text, -- example: ['GA', 'MD']\n dollar_amount text, -- example: ['10_to_100', 'under_10']\n donation_included_optional_support text, -- example: ['t', 'f']\n payment_method text, -- example: ['no_cash_received', 'creditcard']\n payment_included_acct_credit text, -- example: ['f', 't']\n payment_included_web_purchased_gift_card text, -- example: ['f', 't']\n via_giving_page text, -- example: ['f', 't']\n PRIMARY KEY (donationid),\n CONSTRAINT fk_donations_projectid FOREIGN KEY (projectid) REFERENCES projects (projectid)\n);\n\nCREATE TABLE projects (\n projectid text, -- example: ['00001ccc0e81598c4bd86bacb94d7acb', '00002bff514104264a6b798356fdd893']\n teacher_acctid text, -- example: ['42d43fa6f37314365d08692e08680973', '864eb466462bf704bf7a16a585ef296a']\n schoolid text, -- example: ['c0e6ce89b244764085691a1b8e28cb81', 'd711e47810900c96f26a5d0be30c446d']\n school_longitude real, -- example: [-119.608713, -96.72364]\n school_city text, -- example: ['Many', 'Selma', 'Dallas']\n school_state text, -- example: ['CA', 'TX']\n school_year_round text, -- example: ['f', 't']\n teacher_ny_teaching_fellow text, -- teacher_new_york_teaching_fellow, example: ['f', 't']\n primary_focus_subject text, -- example: ['Literature & Writing', 'Literacy']\n primary_focus_area text, -- example: ['Literacy & Language', 'History & Civics']\n secondary_focus_subject text, -- example: ['College & Career Prep', 'ESL']\n secondary_focus_area text, -- example: ['Applied Learning', 'Literacy & Language']\n poverty_level text, -- example: ['highest poverty', 'high poverty']\n fulfillment_labor_materials real, -- example: [30.0, 35.0]\n total_price_excluding_optional_support real, -- example: [555.81, 296.47]\n students_reached integer, -- example: [32, 22]\n eligible_double_your_impact_match text, -- example: ['f', 't']\n eligible_almost_home_match text, -- example: ['f', 't']\n date_posted date, -- example: ['2014-05-12', '2014-05-11']\n PRIMARY KEY (projectid)\n);\n\nCREATE TABLE essays (\n projectid text, -- example: ['ffffc4f85b60efc5b52347df489d0238', 'ffffac55ee02a49d1abc87ba6fc61135']\n title text, -- example: ['Look, Look, We Need a Nook!', 'iMath', \"Recording Rockin' Readers\"]\n essay text, -- example: ['I am a fourth year fifth grade math teac', 'Can you imagine having to translate ever']\n);\n\nCREATE TABLE resources (\n resourceid text, -- example: ['0000037fecc4461faf0e49328ae66661', '0000046b69c683354ca46b30db5c558e']\n projectid text, -- example: ['ffffc4f85b60efc5b52347df489d0238', 'ffffac55ee02a49d1abc87ba6fc61135']\n vendorid integer, -- example: [430, 82]\n item_name text, -- example: ['Nook', 'NOOK', 'How Many?', 'iPod nano 4th Gen 8GB (Black)', 'Sony bloggie MHS-FS1 - camcorder - inter']\n item_number text, -- example: ['249995.001', 'BB11216668']\n item_unit_price real, -- example: [149.0, 148.0]\n item_quantity integer, -- example: [4, 1]\n PRIMARY KEY (resourceid),\n CONSTRAINT fk_resources_projectid FOREIGN KEY (projectid) REFERENCES projects (projectid)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nproject \"Look, Look, We Need a Nook!\" refers to title = 'Look, Look, We Need a Nook!'\nHow many donations does the project \"Look, Look, We Need a Nook!\" have?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"split": "train"
} |
nl2sql | [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE essays (\n projectid text, -- example: ['ffffc4f85b60efc5b52347df489d0238', 'ffffac55ee02a49d1abc87ba6fc61135']\n title text, -- example: ['Wiping Away Bad Grades', 'iMath', \"Recording Rockin' Readers\"]\n essay text, -- example: ['I am a fourth year fifth grade math teac', 'Can you imagine having to translate ever']\n);\n\nCREATE TABLE donations (\n donationid text, -- example: ['000000a91a14ed37bef82e125c102e77', '000013be53ed7382ed5d5975eb86eb85']\n projectid text, -- example: ['ffffac55ee02a49d1abc87ba6fc61135', 'ffff97ed93720407d70a2787475932b0']\n donation_to_project real, -- example: [42.5, 26.83]\n payment_included_campaign_gift_card text, -- example: ['t', 'f']\n via_giving_page text, -- example: ['f', 't']\n PRIMARY KEY (donationid),\n CONSTRAINT fk_donations_projectid FOREIGN KEY (projectid) REFERENCES projects (projectid)\n);\n\nCREATE TABLE resources (\n resourceid text, -- example: ['0000037fecc4461faf0e49328ae66661', '0000046b69c683354ca46b30db5c558e']\n projectid text, -- example: ['ffffc4f85b60efc5b52347df489d0238', 'ffffac55ee02a49d1abc87ba6fc61135']\n vendorid integer, -- example: [430, 82]\n vendor_name text, -- example: ['Woodwind and Brasswind', 'Best Buy for Business']\n PRIMARY KEY (resourceid),\n CONSTRAINT fk_resources_projectid FOREIGN KEY (projectid) REFERENCES projects (projectid)\n);\n\nCREATE TABLE projects (\n projectid text, -- example: ['00001ccc0e81598c4bd86bacb94d7acb', '00002bff514104264a6b798356fdd893']\n school_ncesid text, -- school national center for education statistics id, example: ['063627006187', '483702008193']\n school_latitude real, -- example: [36.57634, 32.911179]\n school_longitude real, -- example: [-119.608713, -96.72364]\n school_city text, -- example: ['Selma', 'Dallas']\n primary_focus_subject text, -- example: ['Literature & Writing', 'Literacy']\n secondary_focus_subject text, -- example: ['College & Career Prep', 'ESL']\n resource_type text, -- example: ['Books', 'Technology']\n poverty_level text, -- example: ['highest poverty', 'high poverty']\n students_reached integer, -- example: [32, 22]\n PRIMARY KEY (projectid)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nproject \"Wiping Away Bad Grades\" title = 'Wiping Away Bad Grades'; coordinates refers to school_longitude, school_latitude\nWhat are the coordinates of the school with the project \"Wiping Away Bad Grades\"?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"role": "user"
}
] | nl2sql | {
"ground_truth": "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'",
"style": "rule"
} | {
"db_id": "donor.sqlite",
"gt_sql": "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'",
"index": 1610,
"question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE essays (\n projectid text, -- example: ['ffffc4f85b60efc5b52347df489d0238', 'ffffac55ee02a49d1abc87ba6fc61135']\n title text, -- example: ['Wiping Away Bad Grades', 'iMath', \"Recording Rockin' Readers\"]\n essay text, -- example: ['I am a fourth year fifth grade math teac', 'Can you imagine having to translate ever']\n);\n\nCREATE TABLE donations (\n donationid text, -- example: ['000000a91a14ed37bef82e125c102e77', '000013be53ed7382ed5d5975eb86eb85']\n projectid text, -- example: ['ffffac55ee02a49d1abc87ba6fc61135', 'ffff97ed93720407d70a2787475932b0']\n donation_to_project real, -- example: [42.5, 26.83]\n payment_included_campaign_gift_card text, -- example: ['t', 'f']\n via_giving_page text, -- example: ['f', 't']\n PRIMARY KEY (donationid),\n CONSTRAINT fk_donations_projectid FOREIGN KEY (projectid) REFERENCES projects (projectid)\n);\n\nCREATE TABLE resources (\n resourceid text, -- example: ['0000037fecc4461faf0e49328ae66661', '0000046b69c683354ca46b30db5c558e']\n projectid text, -- example: ['ffffc4f85b60efc5b52347df489d0238', 'ffffac55ee02a49d1abc87ba6fc61135']\n vendorid integer, -- example: [430, 82]\n vendor_name text, -- example: ['Woodwind and Brasswind', 'Best Buy for Business']\n PRIMARY KEY (resourceid),\n CONSTRAINT fk_resources_projectid FOREIGN KEY (projectid) REFERENCES projects (projectid)\n);\n\nCREATE TABLE projects (\n projectid text, -- example: ['00001ccc0e81598c4bd86bacb94d7acb', '00002bff514104264a6b798356fdd893']\n school_ncesid text, -- school national center for education statistics id, example: ['063627006187', '483702008193']\n school_latitude real, -- example: [36.57634, 32.911179]\n school_longitude real, -- example: [-119.608713, -96.72364]\n school_city text, -- example: ['Selma', 'Dallas']\n primary_focus_subject text, -- example: ['Literature & Writing', 'Literacy']\n secondary_focus_subject text, -- example: ['College & Career Prep', 'ESL']\n resource_type text, -- example: ['Books', 'Technology']\n poverty_level text, -- example: ['highest poverty', 'high poverty']\n students_reached integer, -- example: [32, 22]\n PRIMARY KEY (projectid)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nproject \"Wiping Away Bad Grades\" title = 'Wiping Away Bad Grades'; coordinates refers to school_longitude, school_latitude\nWhat are the coordinates of the school with the project \"Wiping Away Bad Grades\"?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"split": "train"
} |
nl2sql | [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE resources (\n resourceid text, -- example: ['0000037fecc4461faf0e49328ae66661', '0000046b69c683354ca46b30db5c558e']\n projectid text, -- example: ['ffffc4f85b60efc5b52347df489d0238', 'ffffac55ee02a49d1abc87ba6fc61135']\n vendor_name text, -- example: ['Woodwind and Brasswind', 'Best Buy for Business']\n PRIMARY KEY (resourceid),\n CONSTRAINT fk_resources_projectid FOREIGN KEY (projectid) REFERENCES projects (projectid)\n);\n\nCREATE TABLE essays (\n projectid text, -- example: ['ffffc4f85b60efc5b52347df489d0238', 'ffffac55ee02a49d1abc87ba6fc61135']\n need_statement text, -- example: ['My students need four iPods.', 'My students need a camcorder. ']\n essay text, -- example: ['I am a fourth year fifth grade math teac', 'Can you imagine having to translate ever']\n);\n\nCREATE TABLE projects (\n projectid text, -- example: ['00001ccc0e81598c4bd86bacb94d7acb', '00002bff514104264a6b798356fdd893']\n schoolid text, -- example: ['c0e6ce89b244764085691a1b8e28cb81', 'd711e47810900c96f26a5d0be30c446d']\n school_latitude real, -- example: [36.57634, 32.911179]\n school_longitude real, -- example: [-119.608713, -96.72364]\n school_state text, -- example: ['CA', 'TX']\n school_zip integer, -- example: [93662, 75243]\n school_district text, -- example: ['Selma Unified Sch District', 'Richardson Ind School District']\n school_charter text, -- example: ['f', 't']\n school_year_round text, -- example: ['f', 't']\n teacher_teach_for_america text, -- teachers teach for america, example: ['f', 't']\n teacher_ny_teaching_fellow text, -- teacher_new_york_teaching_fellow, example: ['f', 't']\n primary_focus_subject text, -- example: ['Literature & Writing', 'Literacy']\n primary_focus_area text, -- example: ['Literacy & Language', 'History & Civics']\n resource_type text, -- example: ['Books', 'Technology']\n poverty_level text, -- example: ['highest poverty', 'high poverty']\n fulfillment_labor_materials real, -- example: [30.0, 35.0]\n date_posted date, -- example: ['2014-05-12', '2014-05-11']\n PRIMARY KEY (projectid)\n);\n\nCREATE TABLE donations (\n donationid text, -- example: ['000000a91a14ed37bef82e125c102e77', '000013be53ed7382ed5d5975eb86eb85']\n projectid text, -- example: ['ffffac55ee02a49d1abc87ba6fc61135', 'ffff97ed93720407d70a2787475932b0']\n donor_acctid text, -- donor accid, example: ['22cbc920c9b5fa08dfb331422f5926b5', '521f1830a77c9dbbf8119d99c6206a16']\n donor_state text, -- example: ['GA', 'MD']\n is_teacher_acct text, -- example: ['t', 'f']\n donation_to_project real, -- example: [42.5, 26.83]\n donation_total real, -- example: [50.0, 31.56]\n payment_included_campaign_gift_card text, -- example: ['t', 'f']\n via_giving_page text, -- example: ['f', 't']\n for_honoree text, -- example: ['t', 'f']\n PRIMARY KEY (donationid),\n CONSTRAINT fk_donations_projectid FOREIGN KEY (projectid) REFERENCES projects (projectid)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\ncorporate sponsored giftcard refers to payment_included_campaign_gift_card = 't'; primary subject refers to primary_focus_subject\nList the primary subject of all the donations with a corporate sponsored giftcard.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"role": "user"
}
] | nl2sql | {
"ground_truth": "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'",
"style": "rule"
} | {
"db_id": "donor.sqlite",
"gt_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'",
"index": 1611,
"question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE resources (\n resourceid text, -- example: ['0000037fecc4461faf0e49328ae66661', '0000046b69c683354ca46b30db5c558e']\n projectid text, -- example: ['ffffc4f85b60efc5b52347df489d0238', 'ffffac55ee02a49d1abc87ba6fc61135']\n vendor_name text, -- example: ['Woodwind and Brasswind', 'Best Buy for Business']\n PRIMARY KEY (resourceid),\n CONSTRAINT fk_resources_projectid FOREIGN KEY (projectid) REFERENCES projects (projectid)\n);\n\nCREATE TABLE essays (\n projectid text, -- example: ['ffffc4f85b60efc5b52347df489d0238', 'ffffac55ee02a49d1abc87ba6fc61135']\n need_statement text, -- example: ['My students need four iPods.', 'My students need a camcorder. ']\n essay text, -- example: ['I am a fourth year fifth grade math teac', 'Can you imagine having to translate ever']\n);\n\nCREATE TABLE projects (\n projectid text, -- example: ['00001ccc0e81598c4bd86bacb94d7acb', '00002bff514104264a6b798356fdd893']\n schoolid text, -- example: ['c0e6ce89b244764085691a1b8e28cb81', 'd711e47810900c96f26a5d0be30c446d']\n school_latitude real, -- example: [36.57634, 32.911179]\n school_longitude real, -- example: [-119.608713, -96.72364]\n school_state text, -- example: ['CA', 'TX']\n school_zip integer, -- example: [93662, 75243]\n school_district text, -- example: ['Selma Unified Sch District', 'Richardson Ind School District']\n school_charter text, -- example: ['f', 't']\n school_year_round text, -- example: ['f', 't']\n teacher_teach_for_america text, -- teachers teach for america, example: ['f', 't']\n teacher_ny_teaching_fellow text, -- teacher_new_york_teaching_fellow, example: ['f', 't']\n primary_focus_subject text, -- example: ['Literature & Writing', 'Literacy']\n primary_focus_area text, -- example: ['Literacy & Language', 'History & Civics']\n resource_type text, -- example: ['Books', 'Technology']\n poverty_level text, -- example: ['highest poverty', 'high poverty']\n fulfillment_labor_materials real, -- example: [30.0, 35.0]\n date_posted date, -- example: ['2014-05-12', '2014-05-11']\n PRIMARY KEY (projectid)\n);\n\nCREATE TABLE donations (\n donationid text, -- example: ['000000a91a14ed37bef82e125c102e77', '000013be53ed7382ed5d5975eb86eb85']\n projectid text, -- example: ['ffffac55ee02a49d1abc87ba6fc61135', 'ffff97ed93720407d70a2787475932b0']\n donor_acctid text, -- donor accid, example: ['22cbc920c9b5fa08dfb331422f5926b5', '521f1830a77c9dbbf8119d99c6206a16']\n donor_state text, -- example: ['GA', 'MD']\n is_teacher_acct text, -- example: ['t', 'f']\n donation_to_project real, -- example: [42.5, 26.83]\n donation_total real, -- example: [50.0, 31.56]\n payment_included_campaign_gift_card text, -- example: ['t', 'f']\n via_giving_page text, -- example: ['f', 't']\n for_honoree text, -- example: ['t', 'f']\n PRIMARY KEY (donationid),\n CONSTRAINT fk_donations_projectid FOREIGN KEY (projectid) REFERENCES projects (projectid)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\ncorporate sponsored giftcard refers to payment_included_campaign_gift_card = 't'; primary subject refers to primary_focus_subject\nList the primary subject of all the donations with a corporate sponsored giftcard.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"split": "train"
} |
nl2sql | [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE projects (\n projectid text, -- example: ['00001ccc0e81598c4bd86bacb94d7acb', '00002bff514104264a6b798356fdd893']\n teacher_acctid text, -- example: ['42d43fa6f37314365d08692e08680973', '864eb466462bf704bf7a16a585ef296a']\n schoolid text, -- example: ['c0e6ce89b244764085691a1b8e28cb81', 'd711e47810900c96f26a5d0be30c446d']\n school_ncesid text, -- school national center for education statistics id, example: ['063627006187', '483702008193']\n school_latitude real, -- example: [36.57634, 32.911179]\n school_city text, -- example: ['Selma', 'Dallas']\n school_state text, -- example: ['CA', 'TX']\n school_metro text, -- example: ['urban', 'rural']\n school_district text, -- example: ['Selma Unified Sch District', 'Richardson Ind School District']\n school_charter text, -- example: ['f', 't']\n school_year_round text, -- example: ['f', 't']\n school_nlns text, -- school Nonleafy Normal Stature, example: ['f', 't']\n teacher_prefix text, -- example: ['Mrs.', 'Mr.']\n teacher_teach_for_america text, -- teachers teach for america, example: ['f', 't']\n teacher_ny_teaching_fellow text, -- teacher_new_york_teaching_fellow, example: ['f', 't']\n primary_focus_area text, -- example: ['Literacy & Language', 'History & Civics']\n secondary_focus_subject text, -- example: ['College & Career Prep', 'ESL']\n resource_type text, -- example: ['Books', 'Technology']\n poverty_level text, -- example: ['highest poverty', 'high poverty']\n grade_level text, -- example: ['Grades 6-8', 'Grades PreK-2']\n fulfillment_labor_materials real, -- example: [30.0, 35.0]\n students_reached integer, -- example: [32, 22]\n eligible_double_your_impact_match text, -- example: ['f', 't']\n eligible_almost_home_match text, -- example: ['f', 't']\n PRIMARY KEY (projectid)\n);\n\nCREATE TABLE donations (\n donationid text, -- example: ['000000a91a14ed37bef82e125c102e77', '000013be53ed7382ed5d5975eb86eb85']\n projectid text, -- example: ['ffffac55ee02a49d1abc87ba6fc61135', 'ffff97ed93720407d70a2787475932b0']\n donor_acctid text, -- donor accid, example: ['22cbc920c9b5fa08dfb331422f5926b5', '521f1830a77c9dbbf8119d99c6206a16']\n donor_city text, -- example: ['Peachtree City', 'Rockville']\n donation_timestamp datetime, -- example: ['2011-08-25 14:27:34.807', '2011-11-04 07:54:21.552']\n donation_to_project real, -- example: [42.5, 26.83]\n donation_optional_support real, -- example: [7.5, 4.73]\n donation_total real, -- example: [50.0, 31.56]\n dollar_amount text, -- example: ['10_to_100', 'under_10']\n donation_included_optional_support text, -- example: ['t', 'f']\n payment_method text, -- example: ['no_cash_received', 'creditcard']\n payment_included_acct_credit text, -- example: ['f', 't']\n payment_included_web_purchased_gift_card text, -- example: ['f', 't']\n via_giving_page text, -- example: ['f', 't']\n for_honoree text, -- example: ['f', 't']\n PRIMARY KEY (donationid),\n CONSTRAINT fk_donations_projectid FOREIGN KEY (projectid) REFERENCES projects (projectid)\n);\n\nCREATE TABLE essays (\n projectid text, -- example: ['ffffc4f85b60efc5b52347df489d0238', 'ffffac55ee02a49d1abc87ba6fc61135']\n teacher_acctid text, -- example: ['c24011b20fc161ed02248e85beb59a90', '947066d0af47e0566f334566553dd6a6']\n title text, -- example: ['iMath', \"Recording Rockin' Readers\"]\n short_description text, -- example: ['It is imperative that teachers bring tec', 'Can you imagine having to translate ever']\n need_statement text, -- example: ['My students need four iPods.', 'My students need a camcorder. ']\n essay text, -- example: ['I am a fourth year fifth grade math teac', 'Can you imagine having to translate ever']\n);\n\nCREATE TABLE resources (\n resourceid text, -- example: ['0000037fecc4461faf0e49328ae66661', '0000046b69c683354ca46b30db5c558e']\n projectid text, -- example: ['ffffc4f85b60efc5b52347df489d0238', 'ffffac55ee02a49d1abc87ba6fc61135']\n vendorid integer, -- example: [430, 82]\n vendor_name text, -- example: ['Woodwind and Brasswind', 'Best Buy for Business']\n project_resource_type text, -- example: ['Technology', 'Supplies']\n item_name text, -- example: ['Short', 'item', 'Max', 'MAX', 'iPod nano 4th Gen 8GB (Black)', 'Sony bloggie MHS-FS1 - camcorder - inter']\n item_unit_price real, -- example: [149.0, 148.0]\n item_quantity integer, -- example: [4, 1]\n PRIMARY KEY (resourceid),\n CONSTRAINT fk_resources_projectid FOREIGN KEY (projectid) REFERENCES projects (projectid)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nbook item refers to project_resource_type = 'Books'; most expensive refers to MAX(item_unit_price)\nWhat is the most expensive book item? Please provide a short description of projects related to those.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"role": "user"
}
] | nl2sql | {
"ground_truth": "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",
"style": "rule"
} | {
"db_id": "donor.sqlite",
"gt_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",
"index": 1612,
"question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE projects (\n projectid text, -- example: ['00001ccc0e81598c4bd86bacb94d7acb', '00002bff514104264a6b798356fdd893']\n teacher_acctid text, -- example: ['42d43fa6f37314365d08692e08680973', '864eb466462bf704bf7a16a585ef296a']\n schoolid text, -- example: ['c0e6ce89b244764085691a1b8e28cb81', 'd711e47810900c96f26a5d0be30c446d']\n school_ncesid text, -- school national center for education statistics id, example: ['063627006187', '483702008193']\n school_latitude real, -- example: [36.57634, 32.911179]\n school_city text, -- example: ['Selma', 'Dallas']\n school_state text, -- example: ['CA', 'TX']\n school_metro text, -- example: ['urban', 'rural']\n school_district text, -- example: ['Selma Unified Sch District', 'Richardson Ind School District']\n school_charter text, -- example: ['f', 't']\n school_year_round text, -- example: ['f', 't']\n school_nlns text, -- school Nonleafy Normal Stature, example: ['f', 't']\n teacher_prefix text, -- example: ['Mrs.', 'Mr.']\n teacher_teach_for_america text, -- teachers teach for america, example: ['f', 't']\n teacher_ny_teaching_fellow text, -- teacher_new_york_teaching_fellow, example: ['f', 't']\n primary_focus_area text, -- example: ['Literacy & Language', 'History & Civics']\n secondary_focus_subject text, -- example: ['College & Career Prep', 'ESL']\n resource_type text, -- example: ['Books', 'Technology']\n poverty_level text, -- example: ['highest poverty', 'high poverty']\n grade_level text, -- example: ['Grades 6-8', 'Grades PreK-2']\n fulfillment_labor_materials real, -- example: [30.0, 35.0]\n students_reached integer, -- example: [32, 22]\n eligible_double_your_impact_match text, -- example: ['f', 't']\n eligible_almost_home_match text, -- example: ['f', 't']\n PRIMARY KEY (projectid)\n);\n\nCREATE TABLE donations (\n donationid text, -- example: ['000000a91a14ed37bef82e125c102e77', '000013be53ed7382ed5d5975eb86eb85']\n projectid text, -- example: ['ffffac55ee02a49d1abc87ba6fc61135', 'ffff97ed93720407d70a2787475932b0']\n donor_acctid text, -- donor accid, example: ['22cbc920c9b5fa08dfb331422f5926b5', '521f1830a77c9dbbf8119d99c6206a16']\n donor_city text, -- example: ['Peachtree City', 'Rockville']\n donation_timestamp datetime, -- example: ['2011-08-25 14:27:34.807', '2011-11-04 07:54:21.552']\n donation_to_project real, -- example: [42.5, 26.83]\n donation_optional_support real, -- example: [7.5, 4.73]\n donation_total real, -- example: [50.0, 31.56]\n dollar_amount text, -- example: ['10_to_100', 'under_10']\n donation_included_optional_support text, -- example: ['t', 'f']\n payment_method text, -- example: ['no_cash_received', 'creditcard']\n payment_included_acct_credit text, -- example: ['f', 't']\n payment_included_web_purchased_gift_card text, -- example: ['f', 't']\n via_giving_page text, -- example: ['f', 't']\n for_honoree text, -- example: ['f', 't']\n PRIMARY KEY (donationid),\n CONSTRAINT fk_donations_projectid FOREIGN KEY (projectid) REFERENCES projects (projectid)\n);\n\nCREATE TABLE essays (\n projectid text, -- example: ['ffffc4f85b60efc5b52347df489d0238', 'ffffac55ee02a49d1abc87ba6fc61135']\n teacher_acctid text, -- example: ['c24011b20fc161ed02248e85beb59a90', '947066d0af47e0566f334566553dd6a6']\n title text, -- example: ['iMath', \"Recording Rockin' Readers\"]\n short_description text, -- example: ['It is imperative that teachers bring tec', 'Can you imagine having to translate ever']\n need_statement text, -- example: ['My students need four iPods.', 'My students need a camcorder. ']\n essay text, -- example: ['I am a fourth year fifth grade math teac', 'Can you imagine having to translate ever']\n);\n\nCREATE TABLE resources (\n resourceid text, -- example: ['0000037fecc4461faf0e49328ae66661', '0000046b69c683354ca46b30db5c558e']\n projectid text, -- example: ['ffffc4f85b60efc5b52347df489d0238', 'ffffac55ee02a49d1abc87ba6fc61135']\n vendorid integer, -- example: [430, 82]\n vendor_name text, -- example: ['Woodwind and Brasswind', 'Best Buy for Business']\n project_resource_type text, -- example: ['Technology', 'Supplies']\n item_name text, -- example: ['Short', 'item', 'Max', 'MAX', 'iPod nano 4th Gen 8GB (Black)', 'Sony bloggie MHS-FS1 - camcorder - inter']\n item_unit_price real, -- example: [149.0, 148.0]\n item_quantity integer, -- example: [4, 1]\n PRIMARY KEY (resourceid),\n CONSTRAINT fk_resources_projectid FOREIGN KEY (projectid) REFERENCES projects (projectid)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nbook item refers to project_resource_type = 'Books'; most expensive refers to MAX(item_unit_price)\nWhat is the most expensive book item? Please provide a short description of projects related to those.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"split": "train"
} |
nl2sql | [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE donations (\n donationid text, -- example: ['000000a91a14ed37bef82e125c102e77', '000013be53ed7382ed5d5975eb86eb85']\n projectid text, -- example: ['ffffac55ee02a49d1abc87ba6fc61135', 'ffff97ed93720407d70a2787475932b0']\n donor_acctid text, -- donor accid, example: ['22cbc920c9b5fa08dfb331422f5926b5', '521f1830a77c9dbbf8119d99c6206a16']\n donor_zip text, -- example: ['30269', '20853']\n donation_timestamp datetime, -- example: ['2011-08-25 14:27:34.807', '2011-11-04 07:54:21.552']\n dollar_amount text, -- example: ['10_to_100', 'under_10']\n payment_included_acct_credit text, -- example: ['f', 't']\n for_honoree text, -- example: ['f', 't']\n PRIMARY KEY (donationid),\n CONSTRAINT fk_donations_projectid FOREIGN KEY (projectid) REFERENCES projects (projectid)\n);\n\nCREATE TABLE projects (\n projectid text, -- example: ['00001ccc0e81598c4bd86bacb94d7acb', '00002bff514104264a6b798356fdd893']\n students_reached integer, -- example: [32, 22]\n PRIMARY KEY (projectid)\n);\n\nCREATE TABLE essays (\n projectid text, -- example: ['ffffc4f85b60efc5b52347df489d0238', 'ffffac55ee02a49d1abc87ba6fc61135']\n);\n\nCREATE TABLE resources (\n resourceid text, -- example: ['0000037fecc4461faf0e49328ae66661', '0000046b69c683354ca46b30db5c558e']\n projectid text, -- example: ['ffffc4f85b60efc5b52347df489d0238', 'ffffac55ee02a49d1abc87ba6fc61135']\n item_number text, -- example: ['249995.001', 'BB11216668']\n PRIMARY KEY (resourceid),\n CONSTRAINT fk_resources_projectid FOREIGN KEY (projectid) REFERENCES projects (projectid)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nzip code \"22205\" refers to donor_zip = '22205'; students impacted refers to students_reached\nWhat is the total number of students impacted by the projects with a donation from a donor with zip code \"22205\"?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"role": "user"
}
] | nl2sql | {
"ground_truth": "SELECT SUM(T2.students_reached) FROM donations AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T1.donor_zip = 22205",
"style": "rule"
} | {
"db_id": "donor.sqlite",
"gt_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",
"index": 1613,
"question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE donations (\n donationid text, -- example: ['000000a91a14ed37bef82e125c102e77', '000013be53ed7382ed5d5975eb86eb85']\n projectid text, -- example: ['ffffac55ee02a49d1abc87ba6fc61135', 'ffff97ed93720407d70a2787475932b0']\n donor_acctid text, -- donor accid, example: ['22cbc920c9b5fa08dfb331422f5926b5', '521f1830a77c9dbbf8119d99c6206a16']\n donor_zip text, -- example: ['30269', '20853']\n donation_timestamp datetime, -- example: ['2011-08-25 14:27:34.807', '2011-11-04 07:54:21.552']\n dollar_amount text, -- example: ['10_to_100', 'under_10']\n payment_included_acct_credit text, -- example: ['f', 't']\n for_honoree text, -- example: ['f', 't']\n PRIMARY KEY (donationid),\n CONSTRAINT fk_donations_projectid FOREIGN KEY (projectid) REFERENCES projects (projectid)\n);\n\nCREATE TABLE projects (\n projectid text, -- example: ['00001ccc0e81598c4bd86bacb94d7acb', '00002bff514104264a6b798356fdd893']\n students_reached integer, -- example: [32, 22]\n PRIMARY KEY (projectid)\n);\n\nCREATE TABLE essays (\n projectid text, -- example: ['ffffc4f85b60efc5b52347df489d0238', 'ffffac55ee02a49d1abc87ba6fc61135']\n);\n\nCREATE TABLE resources (\n resourceid text, -- example: ['0000037fecc4461faf0e49328ae66661', '0000046b69c683354ca46b30db5c558e']\n projectid text, -- example: ['ffffc4f85b60efc5b52347df489d0238', 'ffffac55ee02a49d1abc87ba6fc61135']\n item_number text, -- example: ['249995.001', 'BB11216668']\n PRIMARY KEY (resourceid),\n CONSTRAINT fk_resources_projectid FOREIGN KEY (projectid) REFERENCES projects (projectid)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nzip code \"22205\" refers to donor_zip = '22205'; students impacted refers to students_reached\nWhat is the total number of students impacted by the projects with a donation from a donor with zip code \"22205\"?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"split": "train"
} |
nl2sql | [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE projects (\n projectid text, -- example: ['00001ccc0e81598c4bd86bacb94d7acb', '00002bff514104264a6b798356fdd893']\n teacher_acctid text, -- example: ['42d43fa6f37314365d08692e08680973', '864eb466462bf704bf7a16a585ef296a']\n schoolid text, -- example: ['c0e6ce89b244764085691a1b8e28cb81', 'd711e47810900c96f26a5d0be30c446d']\n school_latitude real, -- example: [36.57634, 32.911179]\n school_longitude real, -- example: [-119.608713, -96.72364]\n school_city text, -- example: ['Divide', 'Selma', 'Dallas']\n school_state text, -- example: ['CA', 'TX']\n school_zip integer, -- example: [93662, 75243]\n school_metro text, -- example: ['urban', 'rural']\n school_district text, -- example: ['Selma Unified Sch District', 'Richardson Ind School District']\n school_county text, -- example: ['Divide', 'Fresno', 'Dallas']\n school_charter text, -- example: ['f', 't']\n school_year_round text, -- example: ['f', 't']\n school_nlns text, -- school Nonleafy Normal Stature, example: ['f', 't']\n school_kipp text, -- school Knowledge Is Power Program, example: ['f', 't']\n school_charter_ready_promise text, -- example: ['f', 't']\n teacher_prefix text, -- example: ['Mrs.', 'Mr.']\n teacher_teach_for_america text, -- teachers teach for america, example: ['f', 't']\n teacher_ny_teaching_fellow text, -- teacher_new_york_teaching_fellow, example: ['f', 't']\n primary_focus_subject text, -- example: ['Literature & Writing', 'Literacy']\n primary_focus_area text, -- example: ['Literacy & Language', 'History & Civics']\n secondary_focus_subject text, -- example: ['College & Career Prep', 'ESL']\n secondary_focus_area text, -- example: ['Applied Learning', 'Literacy & Language']\n resource_type text, -- example: ['Books', 'Technology']\n grade_level text, -- example: ['Grades 6-8', 'Grades PreK-2']\n fulfillment_labor_materials real, -- example: [30.0, 35.0]\n total_price_excluding_optional_support real, -- example: [555.81, 296.47]\n total_price_including_optional_support real, -- example: [653.89, 348.79]\n students_reached integer, -- example: [32, 22]\n eligible_double_your_impact_match text, -- example: ['f', 't']\n eligible_almost_home_match text, -- example: ['f', 't']\n date_posted date, -- example: ['2014-05-12', '2014-05-11']\n PRIMARY KEY (projectid)\n);\n\nCREATE TABLE resources (\n resourceid text, -- example: ['0000037fecc4461faf0e49328ae66661', '0000046b69c683354ca46b30db5c558e']\n projectid text, -- example: ['ffffc4f85b60efc5b52347df489d0238', 'ffffac55ee02a49d1abc87ba6fc61135']\n vendorid integer, -- example: [430, 82]\n vendor_name text, -- example: ['Best Buy for Business', 'Woodwind and Brasswind']\n project_resource_type text, -- example: ['Technology', 'Supplies']\n item_name text, -- example: ['Percentage', 'Count', 'item', 'iPod nano 4th Gen 8GB (Black)', 'Sony bloggie MHS-FS1 - camcorder - inter']\n item_number text, -- example: ['BUY', '249995.001', 'BB11216668']\n item_quantity integer, -- example: [4, 1]\n PRIMARY KEY (resourceid),\n CONSTRAINT fk_resources_projectid FOREIGN KEY (projectid) REFERENCES projects (projectid)\n);\n\nCREATE TABLE donations (\n donationid text, -- example: ['000000a91a14ed37bef82e125c102e77', '000013be53ed7382ed5d5975eb86eb85']\n projectid text, -- example: ['ffffac55ee02a49d1abc87ba6fc61135', 'ffff97ed93720407d70a2787475932b0']\n donor_city text, -- example: ['Divide', 'Peachtree City', 'Rockville']\n donor_state text, -- example: ['GA', 'MD']\n donor_zip text, -- example: ['30269', '20853']\n is_teacher_acct text, -- example: ['f', 't']\n donation_timestamp datetime, -- example: ['2011-08-25 14:27:34.807', '2011-11-04 07:54:21.552']\n donation_to_project real, -- example: [42.5, 26.83]\n donation_optional_support real, -- example: [7.5, 4.73]\n donation_total real, -- example: [50.0, 31.56]\n dollar_amount text, -- example: ['10_to_100', 'under_10']\n donation_included_optional_support text, -- example: ['t', 'f']\n payment_method text, -- example: ['no_cash_received', 'creditcard']\n payment_included_campaign_gift_card text, -- example: ['t', 'f']\n payment_included_web_purchased_gift_card text, -- example: ['f', 't']\n payment_was_promo_matched text, -- example: ['f', 't']\n for_honoree text, -- example: ['f', 't']\n donation_message text, -- example: ['Technology', 'I gave to this project because I support', 'I donated because I want to support kids']\n PRIMARY KEY (donationid),\n CONSTRAINT fk_donations_projectid FOREIGN KEY (projectid) REFERENCES projects (projectid)\n);\n\nCREATE TABLE essays (\n projectid text, -- example: ['ffffc4f85b60efc5b52347df489d0238', 'ffffac55ee02a49d1abc87ba6fc61135']\n teacher_acctid text, -- example: ['c24011b20fc161ed02248e85beb59a90', '947066d0af47e0566f334566553dd6a6']\n title text, -- example: ['iMath', \"Recording Rockin' Readers\"]\n short_description text, -- example: ['It is imperative that teachers bring tec', 'Can you imagine having to translate ever']\n need_statement text, -- example: ['My students need four iPods.', 'My students need a camcorder. ']\n essay text, -- example: ['I am a fourth year fifth grade math teac', 'Can you imagine having to translate ever']\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\ntechnology 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))\nAmong the technology items, what percentage of them are from Best Buy for Business? Provide the date of the project related to those items.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"role": "user"
}
] | nl2sql | {
"ground_truth": "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'",
"style": "rule"
} | {
"db_id": "donor.sqlite",
"gt_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'",
"index": 1614,
"question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE projects (\n projectid text, -- example: ['00001ccc0e81598c4bd86bacb94d7acb', '00002bff514104264a6b798356fdd893']\n teacher_acctid text, -- example: ['42d43fa6f37314365d08692e08680973', '864eb466462bf704bf7a16a585ef296a']\n schoolid text, -- example: ['c0e6ce89b244764085691a1b8e28cb81', 'd711e47810900c96f26a5d0be30c446d']\n school_latitude real, -- example: [36.57634, 32.911179]\n school_longitude real, -- example: [-119.608713, -96.72364]\n school_city text, -- example: ['Divide', 'Selma', 'Dallas']\n school_state text, -- example: ['CA', 'TX']\n school_zip integer, -- example: [93662, 75243]\n school_metro text, -- example: ['urban', 'rural']\n school_district text, -- example: ['Selma Unified Sch District', 'Richardson Ind School District']\n school_county text, -- example: ['Divide', 'Fresno', 'Dallas']\n school_charter text, -- example: ['f', 't']\n school_year_round text, -- example: ['f', 't']\n school_nlns text, -- school Nonleafy Normal Stature, example: ['f', 't']\n school_kipp text, -- school Knowledge Is Power Program, example: ['f', 't']\n school_charter_ready_promise text, -- example: ['f', 't']\n teacher_prefix text, -- example: ['Mrs.', 'Mr.']\n teacher_teach_for_america text, -- teachers teach for america, example: ['f', 't']\n teacher_ny_teaching_fellow text, -- teacher_new_york_teaching_fellow, example: ['f', 't']\n primary_focus_subject text, -- example: ['Literature & Writing', 'Literacy']\n primary_focus_area text, -- example: ['Literacy & Language', 'History & Civics']\n secondary_focus_subject text, -- example: ['College & Career Prep', 'ESL']\n secondary_focus_area text, -- example: ['Applied Learning', 'Literacy & Language']\n resource_type text, -- example: ['Books', 'Technology']\n grade_level text, -- example: ['Grades 6-8', 'Grades PreK-2']\n fulfillment_labor_materials real, -- example: [30.0, 35.0]\n total_price_excluding_optional_support real, -- example: [555.81, 296.47]\n total_price_including_optional_support real, -- example: [653.89, 348.79]\n students_reached integer, -- example: [32, 22]\n eligible_double_your_impact_match text, -- example: ['f', 't']\n eligible_almost_home_match text, -- example: ['f', 't']\n date_posted date, -- example: ['2014-05-12', '2014-05-11']\n PRIMARY KEY (projectid)\n);\n\nCREATE TABLE resources (\n resourceid text, -- example: ['0000037fecc4461faf0e49328ae66661', '0000046b69c683354ca46b30db5c558e']\n projectid text, -- example: ['ffffc4f85b60efc5b52347df489d0238', 'ffffac55ee02a49d1abc87ba6fc61135']\n vendorid integer, -- example: [430, 82]\n vendor_name text, -- example: ['Best Buy for Business', 'Woodwind and Brasswind']\n project_resource_type text, -- example: ['Technology', 'Supplies']\n item_name text, -- example: ['Percentage', 'Count', 'item', 'iPod nano 4th Gen 8GB (Black)', 'Sony bloggie MHS-FS1 - camcorder - inter']\n item_number text, -- example: ['BUY', '249995.001', 'BB11216668']\n item_quantity integer, -- example: [4, 1]\n PRIMARY KEY (resourceid),\n CONSTRAINT fk_resources_projectid FOREIGN KEY (projectid) REFERENCES projects (projectid)\n);\n\nCREATE TABLE donations (\n donationid text, -- example: ['000000a91a14ed37bef82e125c102e77', '000013be53ed7382ed5d5975eb86eb85']\n projectid text, -- example: ['ffffac55ee02a49d1abc87ba6fc61135', 'ffff97ed93720407d70a2787475932b0']\n donor_city text, -- example: ['Divide', 'Peachtree City', 'Rockville']\n donor_state text, -- example: ['GA', 'MD']\n donor_zip text, -- example: ['30269', '20853']\n is_teacher_acct text, -- example: ['f', 't']\n donation_timestamp datetime, -- example: ['2011-08-25 14:27:34.807', '2011-11-04 07:54:21.552']\n donation_to_project real, -- example: [42.5, 26.83]\n donation_optional_support real, -- example: [7.5, 4.73]\n donation_total real, -- example: [50.0, 31.56]\n dollar_amount text, -- example: ['10_to_100', 'under_10']\n donation_included_optional_support text, -- example: ['t', 'f']\n payment_method text, -- example: ['no_cash_received', 'creditcard']\n payment_included_campaign_gift_card text, -- example: ['t', 'f']\n payment_included_web_purchased_gift_card text, -- example: ['f', 't']\n payment_was_promo_matched text, -- example: ['f', 't']\n for_honoree text, -- example: ['f', 't']\n donation_message text, -- example: ['Technology', 'I gave to this project because I support', 'I donated because I want to support kids']\n PRIMARY KEY (donationid),\n CONSTRAINT fk_donations_projectid FOREIGN KEY (projectid) REFERENCES projects (projectid)\n);\n\nCREATE TABLE essays (\n projectid text, -- example: ['ffffc4f85b60efc5b52347df489d0238', 'ffffac55ee02a49d1abc87ba6fc61135']\n teacher_acctid text, -- example: ['c24011b20fc161ed02248e85beb59a90', '947066d0af47e0566f334566553dd6a6']\n title text, -- example: ['iMath', \"Recording Rockin' Readers\"]\n short_description text, -- example: ['It is imperative that teachers bring tec', 'Can you imagine having to translate ever']\n need_statement text, -- example: ['My students need four iPods.', 'My students need a camcorder. ']\n essay text, -- example: ['I am a fourth year fifth grade math teac', 'Can you imagine having to translate ever']\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\ntechnology 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))\nAmong the technology items, what percentage of them are from Best Buy for Business? Provide the date of the project related to those items.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"split": "train"
} |
nl2sql | [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n genre_name text, -- example: ['Action', 'Adventure']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n release_year integer, -- example: [2007, 2006]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n num_sales real, -- number sales, example: [3.5, 1.43]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['2 Games in 1: Sonic Advance & ChuChu Roc', '2 Games in 1: Sonic Battle & ChuChu Rock']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n region_name text, -- example: ['North America', 'Europe']\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\naction game refers to genre_name = 'Action'\nHow many action games are there in total?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"role": "user"
}
] | nl2sql | {
"ground_truth": "SELECT COUNT(T1.id) FROM game AS T1 INNER JOIN genre AS T2 ON T1.genre_id = T2.id WHERE T2.genre_name = 'Action'",
"style": "rule"
} | {
"db_id": "video_games.sqlite",
"gt_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'",
"index": 1615,
"question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n genre_name text, -- example: ['Action', 'Adventure']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n release_year integer, -- example: [2007, 2006]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n num_sales real, -- number sales, example: [3.5, 1.43]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['2 Games in 1: Sonic Advance & ChuChu Roc', '2 Games in 1: Sonic Battle & ChuChu Rock']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n region_name text, -- example: ['North America', 'Europe']\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\naction game refers to genre_name = 'Action'\nHow many action games are there in total?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"split": "train"
} |
nl2sql | [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n platform_name text, -- example: ['Wii', 'NES']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n region_name text, -- example: ['North America', 'Europe']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['3D Lemmings', 'Lemmings', '2 Games in 1: Sonic Advance & ChuChu Roc', '2 Games in 1: Sonic Battle & ChuChu Rock']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n genre_name text, -- example: ['Action', 'Adventure']\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\ngenre refers to genre_name; 3D Lemmings refers to game_name = '3D Lemmings'\nWhat is the genre of 3D Lemmings?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"role": "user"
}
] | nl2sql | {
"ground_truth": "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'",
"style": "rule"
} | {
"db_id": "video_games.sqlite",
"gt_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'",
"index": 1616,
"question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n platform_name text, -- example: ['Wii', 'NES']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n region_name text, -- example: ['North America', 'Europe']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['3D Lemmings', 'Lemmings', '2 Games in 1: Sonic Advance & ChuChu Roc', '2 Games in 1: Sonic Battle & ChuChu Rock']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n genre_name text, -- example: ['Action', 'Adventure']\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\ngenre refers to genre_name; 3D Lemmings refers to game_name = '3D Lemmings'\nWhat is the genre of 3D Lemmings?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"split": "train"
} |
nl2sql | [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n region_name text, -- example: ['North America', 'Europe']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['10TACLE Studios', '1C Company']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n num_sales real, -- number sales, example: [3.5, 1.43]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n genre_name text, -- example: ['Puzzle', 'Action', 'Adventure']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['2 Games in 1: Sonic Advance & ChuChu Roc', '2 Games in 1: Sonic Battle & ChuChu Rock']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n platform_name text, -- example: ['Wii', 'NES']\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\npublished by 10TACLE Studios refers to publisher_name = '10TACLE Studios'; puzzle refers to genre_name = 'Puzzle'\nAmong the games published by 10TACLE Studios, how many of them are puzzles?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"role": "user"
}
] | nl2sql | {
"ground_truth": "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'",
"style": "rule"
} | {
"db_id": "video_games.sqlite",
"gt_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'",
"index": 1617,
"question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n region_name text, -- example: ['North America', 'Europe']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['10TACLE Studios', '1C Company']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n num_sales real, -- number sales, example: [3.5, 1.43]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n genre_name text, -- example: ['Puzzle', 'Action', 'Adventure']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['2 Games in 1: Sonic Advance & ChuChu Roc', '2 Games in 1: Sonic Battle & ChuChu Rock']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n platform_name text, -- example: ['Wii', 'NES']\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\npublished by 10TACLE Studios refers to publisher_name = '10TACLE Studios'; puzzle refers to genre_name = 'Puzzle'\nAmong the games published by 10TACLE Studios, how many of them are puzzles?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"split": "train"
} |
nl2sql | [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['10TACLE Studios', '1C Company']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n num_sales real, -- number sales, example: [3.5, 1.43]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n region_name text, -- example: ['North America', 'Europe']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n release_year integer, -- example: [2007, 2006]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n platform_name text, -- example: ['Wii', 'NES']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['2 Games in 1: Sonic Advance & ChuChu Roc', '2 Games in 1: Sonic Battle & ChuChu Rock']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n genre_name text, -- example: ['Puzzle', 'Action', 'Adventure']\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nname refers to game_name; published by 10TACLE Studios refers to publisher_name = '10TACLE Studios'; puzzle refers to genre_name = 'Puzzle'\nPlease list the names of all the games published by 10TACLE Studios and are puzzles.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"role": "user"
}
] | nl2sql | {
"ground_truth": "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'",
"style": "rule"
} | {
"db_id": "video_games.sqlite",
"gt_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'",
"index": 1618,
"question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['10TACLE Studios', '1C Company']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n num_sales real, -- number sales, example: [3.5, 1.43]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n region_name text, -- example: ['North America', 'Europe']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n release_year integer, -- example: [2007, 2006]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n platform_name text, -- example: ['Wii', 'NES']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['2 Games in 1: Sonic Advance & ChuChu Roc', '2 Games in 1: Sonic Battle & ChuChu Rock']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n genre_name text, -- example: ['Puzzle', 'Action', 'Adventure']\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nname refers to game_name; published by 10TACLE Studios refers to publisher_name = '10TACLE Studios'; puzzle refers to genre_name = 'Puzzle'\nPlease list the names of all the games published by 10TACLE Studios and are puzzles.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"split": "train"
} |
nl2sql | [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n num_sales real, -- number sales, example: [3.5, 1.43]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n platform_name text, -- example: ['Wii', 'NES']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['2 Games in 1: Sonic Advance & ChuChu Roc', '2 Games in 1: Sonic Battle & ChuChu Rock']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n genre_name text, -- example: ['Action', 'Adventure']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n release_year integer, -- example: [2007, 2006]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['10TACLE Studios', '1C Company']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\npublisher refers to publisher_name; the most games refers to max(count(game_id))\nWhich publisher has published the most games?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"role": "user"
}
] | nl2sql | {
"ground_truth": "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",
"style": "rule"
} | {
"db_id": "video_games.sqlite",
"gt_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",
"index": 1619,
"question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n num_sales real, -- number sales, example: [3.5, 1.43]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n platform_name text, -- example: ['Wii', 'NES']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['2 Games in 1: Sonic Advance & ChuChu Roc', '2 Games in 1: Sonic Battle & ChuChu Rock']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n genre_name text, -- example: ['Action', 'Adventure']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n release_year integer, -- example: [2007, 2006]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['10TACLE Studios', '1C Company']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\npublisher refers to publisher_name; the most games refers to max(count(game_id))\nWhich publisher has published the most games?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"split": "train"
} |
nl2sql | [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['10TACLE Studios', '1C Company']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['2 Games in 1: Sonic Advance & ChuChu Roc', '2 Games in 1: Sonic Battle & ChuChu Rock']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n genre_name text, -- example: ['Puzzle', 'Action', 'Adventure']\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\npuzzle refers to genre_name = 'Puzzle'; more than 3 puzzle games refers to count(game_id where genre_name = 'Puzzle') > 3\nHow many publishers have published more than 3 puzzle games?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"role": "user"
}
] | nl2sql | {
"ground_truth": "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",
"style": "rule"
} | {
"db_id": "video_games.sqlite",
"gt_sql": "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",
"index": 1620,
"question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['10TACLE Studios', '1C Company']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['2 Games in 1: Sonic Advance & ChuChu Roc', '2 Games in 1: Sonic Battle & ChuChu Rock']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n genre_name text, -- example: ['Puzzle', 'Action', 'Adventure']\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\npuzzle refers to genre_name = 'Puzzle'; more than 3 puzzle games refers to count(game_id where genre_name = 'Puzzle') > 3\nHow many publishers have published more than 3 puzzle games?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"split": "train"
} |
nl2sql | [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n region_name text, -- example: ['North America', 'Europe']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['2 Games in 1: Sonic Advance & ChuChu Roc', '2 Games in 1: Sonic Battle & ChuChu Rock']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n release_year integer, -- example: [2007, 2006]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n platform_name text, -- example: ['Wii', 'NES']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['Nintendo', '10TACLE Studios', '1C Company']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n genre_name text, -- example: ['Sports', 'Action', 'Adventure']\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\npublished 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'\nAmong the games published by Nintendo, what is the percentage of those in the genre of sports?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"role": "user"
}
] | nl2sql | {
"ground_truth": "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'",
"style": "rule"
} | {
"db_id": "video_games.sqlite",
"gt_sql": "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'",
"index": 1621,
"question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n region_name text, -- example: ['North America', 'Europe']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['2 Games in 1: Sonic Advance & ChuChu Roc', '2 Games in 1: Sonic Battle & ChuChu Rock']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n release_year integer, -- example: [2007, 2006]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n platform_name text, -- example: ['Wii', 'NES']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['Nintendo', '10TACLE Studios', '1C Company']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n genre_name text, -- example: ['Sports', 'Action', 'Adventure']\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\npublished 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'\nAmong the games published by Nintendo, what is the percentage of those in the genre of sports?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"split": "train"
} |
nl2sql | [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n platform_name text, -- example: ['DS', 'Wii', 'NES']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['2 Games in 1: Sonic Advance & ChuChu Roc', '2 Games in 1: Sonic Battle & ChuChu Rock']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n region_name text, -- example: ['North America', 'Europe']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['10TACLE Studios', '1C Company']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n num_sales real, -- number sales, example: [3.5, 1.43]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n genre_name text, -- example: ['Platform', 'Action', 'Adventure']\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\non 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'\nHow many games were sold on the DS platform on average in the 4 different regions?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"role": "user"
}
] | nl2sql | {
"ground_truth": "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'",
"style": "rule"
} | {
"db_id": "video_games.sqlite",
"gt_sql": "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'",
"index": 1622,
"question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n platform_name text, -- example: ['DS', 'Wii', 'NES']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['2 Games in 1: Sonic Advance & ChuChu Roc', '2 Games in 1: Sonic Battle & ChuChu Rock']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n region_name text, -- example: ['North America', 'Europe']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['10TACLE Studios', '1C Company']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n num_sales real, -- number sales, example: [3.5, 1.43]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n genre_name text, -- example: ['Platform', 'Action', 'Adventure']\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\non 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'\nHow many games were sold on the DS platform on average in the 4 different regions?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"split": "train"
} |
nl2sql | [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['Pro Evolution Soccer 2012', 'Pro Evolution Soccer', 'Soccer', 'Pro Evolution Soccer 2017', 'Pro Evolution Soccer 2016', 'Pro Evolution Soccer 2015']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n num_sales real, -- number sales, example: [3.5, 1.43]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nPro Evolution Soccer 2012 refers to game_name = 'Pro Evolution Soccer 2012'\nList the genre id of the game Pro Evolution Soccer 2012.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"role": "user"
}
] | nl2sql | {
"ground_truth": "SELECT T.genre_id FROM game AS T WHERE T.game_name = 'Pro Evolution Soccer 2012'",
"style": "rule"
} | {
"db_id": "video_games.sqlite",
"gt_sql": "SELECT T.genre_id FROM game AS T WHERE T.game_name = 'Pro Evolution Soccer 2012'",
"index": 1623,
"question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['Pro Evolution Soccer 2012', 'Pro Evolution Soccer', 'Soccer', 'Pro Evolution Soccer 2017', 'Pro Evolution Soccer 2016', 'Pro Evolution Soccer 2015']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n num_sales real, -- number sales, example: [3.5, 1.43]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nPro Evolution Soccer 2012 refers to game_name = 'Pro Evolution Soccer 2012'\nList the genre id of the game Pro Evolution Soccer 2012.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"split": "train"
} |
nl2sql | [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n genre_name text, -- example: ['Sports', 'Action', 'Adventure']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nthe genre of sports refers to genre_name = 'Sports'\nHow many games in the database belong to the genre of sports?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"role": "user"
}
] | nl2sql | {
"ground_truth": "SELECT COUNT(T1.id) FROM game AS T1 INNER JOIN genre AS T2 ON T1.genre_id = T2.id WHERE T2.genre_name = 'Sports'",
"style": "rule"
} | {
"db_id": "video_games.sqlite",
"gt_sql": "SELECT COUNT(T1.id) FROM game AS T1 INNER JOIN genre AS T2 ON T1.genre_id = T2.id WHERE T2.genre_name = 'Sports'",
"index": 1624,
"question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n genre_name text, -- example: ['Sports', 'Action', 'Adventure']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nthe genre of sports refers to genre_name = 'Sports'\nHow many games in the database belong to the genre of sports?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"split": "train"
} |
nl2sql | [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n genre_name text, -- example: ['Simulation', 'Sports', 'Action', 'Adventure']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n release_year integer, -- example: [2007, 2006]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n num_sales real, -- number sales, example: [3.5, 1.43]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['2 Games in 1: Sonic Advance & ChuChu Roc', '2 Games in 1: Sonic Battle & ChuChu Rock']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nsports 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'))\nHow many more sports games than simulation games?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"role": "user"
}
] | nl2sql | {
"ground_truth": "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",
"style": "rule"
} | {
"db_id": "video_games.sqlite",
"gt_sql": "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",
"index": 1625,
"question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n genre_name text, -- example: ['Simulation', 'Sports', 'Action', 'Adventure']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n release_year integer, -- example: [2007, 2006]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n num_sales real, -- number sales, example: [3.5, 1.43]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['2 Games in 1: Sonic Advance & ChuChu Roc', '2 Games in 1: Sonic Battle & ChuChu Rock']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nsports 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'))\nHow many more sports games than simulation games?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"split": "train"
} |
nl2sql | [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n region_name text, -- example: ['North America', 'Europe']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['10TACLE Studios', '1C Company']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n release_year integer, -- example: [2007, 2006]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n genre_name text, -- example: ['Action', 'Adventure']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n platform_name text, -- example: ['Wii', 'NES']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['Resident Evil: Revelations', 'Resident Evil', 'Resident Evil: Revelations 2', 'Resident Evil 6', 'Resident Evil 5', 'Resident Evil 4']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\ngenre refers to genre_name; game \"Resident Evil: Revelations\" refers to game_name = 'Resident Evil: Revelations'\nTell the genre of the game \"Resident Evil: Revelations\".\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"role": "user"
}
] | nl2sql | {
"ground_truth": "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'",
"style": "rule"
} | {
"db_id": "video_games.sqlite",
"gt_sql": "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'",
"index": 1626,
"question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n region_name text, -- example: ['North America', 'Europe']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['10TACLE Studios', '1C Company']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n release_year integer, -- example: [2007, 2006]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n genre_name text, -- example: ['Action', 'Adventure']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n platform_name text, -- example: ['Wii', 'NES']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['Resident Evil: Revelations', 'Resident Evil', 'Resident Evil: Revelations 2', 'Resident Evil 6', 'Resident Evil 5', 'Resident Evil 4']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\ngenre refers to genre_name; game \"Resident Evil: Revelations\" refers to game_name = 'Resident Evil: Revelations'\nTell the genre of the game \"Resident Evil: Revelations\".\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"split": "train"
} |
nl2sql | [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['2 Games in 1: Sonic Advance & ChuChu Roc', '2 Games in 1: Sonic Battle & ChuChu Rock']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['Ascaron Entertainment GmbH', 'Ascaron Entertainment', '10TACLE Studios', '1C Company']\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\npublished by Ascaron Entertainment GmbH refers to publisher_name = 'Ascaron Entertainment GmbH'\nGive the number of games which were published by Ascaron Entertainment GmbH.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"role": "user"
}
] | nl2sql | {
"ground_truth": "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'",
"style": "rule"
} | {
"db_id": "video_games.sqlite",
"gt_sql": "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'",
"index": 1627,
"question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['2 Games in 1: Sonic Advance & ChuChu Roc', '2 Games in 1: Sonic Battle & ChuChu Rock']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['Ascaron Entertainment GmbH', 'Ascaron Entertainment', '10TACLE Studios', '1C Company']\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\npublished by Ascaron Entertainment GmbH refers to publisher_name = 'Ascaron Entertainment GmbH'\nGive the number of games which were published by Ascaron Entertainment GmbH.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"split": "train"
} |
nl2sql | [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['2 Games in 1: Sonic Advance & ChuChu Roc', '2 Games in 1: Sonic Battle & ChuChu Rock']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n release_year integer, -- example: [2007, 2006]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n platform_name text, -- example: ['Wii', 'NES']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n genre_name text, -- example: ['Platform', 'Action', 'Adventure']\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nthe earliest refers to min(release_year); name of platform refers to platform_name\nShow the name of the earliest platform in the database.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"role": "user"
}
] | nl2sql | {
"ground_truth": "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",
"style": "rule"
} | {
"db_id": "video_games.sqlite",
"gt_sql": "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",
"index": 1628,
"question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['2 Games in 1: Sonic Advance & ChuChu Roc', '2 Games in 1: Sonic Battle & ChuChu Rock']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n release_year integer, -- example: [2007, 2006]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n platform_name text, -- example: ['Wii', 'NES']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n genre_name text, -- example: ['Platform', 'Action', 'Adventure']\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nthe earliest refers to min(release_year); name of platform refers to platform_name\nShow the name of the earliest platform in the database.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"split": "train"
} |
nl2sql | [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['Athena', 'Atari', '10TACLE Studios', '1C Company']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n release_year integer, -- example: [2007, 2006]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n genre_name text, -- example: ['Action', 'Adventure']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n platform_name text, -- example: ['Wii', 'NES']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n region_name text, -- example: ['North America', 'Europe']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n num_sales real, -- number sales, example: [3.5, 1.43]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['2 Games in 1: Sonic Advance & ChuChu Roc', '2 Games in 1: Sonic Battle & ChuChu Rock']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\npublished 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'))\nHow many times more is the number of games which were published by Atari than Athena?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"role": "user"
}
] | nl2sql | {
"ground_truth": "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",
"style": "rule"
} | {
"db_id": "video_games.sqlite",
"gt_sql": "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",
"index": 1629,
"question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['Athena', 'Atari', '10TACLE Studios', '1C Company']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n release_year integer, -- example: [2007, 2006]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n genre_name text, -- example: ['Action', 'Adventure']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n platform_name text, -- example: ['Wii', 'NES']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n region_name text, -- example: ['North America', 'Europe']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n num_sales real, -- number sales, example: [3.5, 1.43]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['2 Games in 1: Sonic Advance & ChuChu Roc', '2 Games in 1: Sonic Battle & ChuChu Rock']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\npublished 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'))\nHow many times more is the number of games which were published by Atari than Athena?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"split": "train"
} |
nl2sql | [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['Electronic Arts', '10TACLE Studios', '1C Company']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['2 Games in 1: Sonic Advance & ChuChu Roc', '2 Games in 1: Sonic Battle & ChuChu Rock']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n genre_name text, -- example: ['Action', 'Adventure']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n region_name text, -- example: ['North America', 'Europe']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nElectronic Arts refers to publisher_name = 'Electronic Arts'\nHow many games did Electronic Arts publish?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"role": "user"
}
] | nl2sql | {
"ground_truth": "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'",
"style": "rule"
} | {
"db_id": "video_games.sqlite",
"gt_sql": "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'",
"index": 1630,
"question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['Electronic Arts', '10TACLE Studios', '1C Company']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['2 Games in 1: Sonic Advance & ChuChu Roc', '2 Games in 1: Sonic Battle & ChuChu Rock']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n genre_name text, -- example: ['Action', 'Adventure']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n region_name text, -- example: ['North America', 'Europe']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nElectronic Arts refers to publisher_name = 'Electronic Arts'\nHow many games did Electronic Arts publish?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"split": "train"
} |
nl2sql | [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['Microsoft Game Studios', '10TACLE Studios', '1C Company']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['2 Games in 1: Sonic Advance & ChuChu Roc', '2 Games in 1: Sonic Battle & ChuChu Rock']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n genre_name text, -- example: ['Role-Playing', 'Action', 'Adventure']\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nrole-playing game refers to genre_name = 'Role-Playing'; Microsoft Game Studios refers to publisher_name = 'Microsoft Game Studios'\nHow many role-playing games did Microsoft Game Studios publish?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"role": "user"
}
] | nl2sql | {
"ground_truth": "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'",
"style": "rule"
} | {
"db_id": "video_games.sqlite",
"gt_sql": "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'",
"index": 1631,
"question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['Microsoft Game Studios', '10TACLE Studios', '1C Company']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['2 Games in 1: Sonic Advance & ChuChu Roc', '2 Games in 1: Sonic Battle & ChuChu Rock']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n genre_name text, -- example: ['Role-Playing', 'Action', 'Adventure']\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nrole-playing game refers to genre_name = 'Role-Playing'; Microsoft Game Studios refers to publisher_name = 'Microsoft Game Studios'\nHow many role-playing games did Microsoft Game Studios publish?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"split": "train"
} |
nl2sql | [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n num_sales real, -- number sales, example: [3.5, 1.43]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n platform_name text, -- example: ['Wii', 'NES']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n region_name text, -- example: ['North America', 'Europe']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['10TACLE Studios', '1C Company']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n release_year integer, -- example: [2007, 2006]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['2 Games in 1: Sonic Advance & ChuChu Roc', '2 Games in 1: Sonic Battle & ChuChu Rock']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\npublisher refers to publisher_name; the most games refers to max(count(publisher_id))\nWhich publisher published the most games?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"role": "user"
}
] | nl2sql | {
"ground_truth": "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",
"style": "rule"
} | {
"db_id": "video_games.sqlite",
"gt_sql": "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",
"index": 1632,
"question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n num_sales real, -- number sales, example: [3.5, 1.43]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n platform_name text, -- example: ['Wii', 'NES']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n region_name text, -- example: ['North America', 'Europe']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['10TACLE Studios', '1C Company']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n release_year integer, -- example: [2007, 2006]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['2 Games in 1: Sonic Advance & ChuChu Roc', '2 Games in 1: Sonic Battle & ChuChu Rock']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\npublisher refers to publisher_name; the most games refers to max(count(publisher_id))\nWhich publisher published the most games?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"split": "train"
} |
nl2sql | [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n platform_name text, -- example: ['PS4', 'Wii', 'NES']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n genre_name text, -- example: ['Action', 'Adventure']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n release_year integer, -- example: [2007, 2006]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\non PS4 refers to platform_name = 'PS4'; in 2014 refers to release_year = 2014\nHow many games were released on PS4 in 2014?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"role": "user"
}
] | nl2sql | {
"ground_truth": "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",
"style": "rule"
} | {
"db_id": "video_games.sqlite",
"gt_sql": "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",
"index": 1633,
"question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n platform_name text, -- example: ['PS4', 'Wii', 'NES']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n genre_name text, -- example: ['Action', 'Adventure']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n release_year integer, -- example: [2007, 2006]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\non PS4 refers to platform_name = 'PS4'; in 2014 refers to release_year = 2014\nHow many games were released on PS4 in 2014?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"split": "train"
} |
nl2sql | [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n platform_name text, -- example: ['X360', 'Wii', 'NES']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n genre_name text, -- example: ['Action', 'Adventure']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n region_name text, -- example: ['Japan', 'North America', 'Europe']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n release_year integer, -- example: [2007, 2006]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n num_sales real, -- number sales, example: [3.5, 1.43]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['10TACLE Studios', '1C Company']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['2 Games in 1: Sonic Advance & ChuChu Roc', '2 Games in 1: Sonic Battle & ChuChu Rock']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nin Japan refers to region_name = 'Japan'; on X360 refers to platform_name = 'X360'; in 2011 refers to release_year = 2011\nHow many publishers in Japan released a game on X360 in 2011?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"role": "user"
}
] | nl2sql | {
"ground_truth": "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'",
"style": "rule"
} | {
"db_id": "video_games.sqlite",
"gt_sql": "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'",
"index": 1634,
"question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n platform_name text, -- example: ['X360', 'Wii', 'NES']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n genre_name text, -- example: ['Action', 'Adventure']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n region_name text, -- example: ['Japan', 'North America', 'Europe']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n release_year integer, -- example: [2007, 2006]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n num_sales real, -- number sales, example: [3.5, 1.43]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['10TACLE Studios', '1C Company']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['2 Games in 1: Sonic Advance & ChuChu Roc', '2 Games in 1: Sonic Battle & ChuChu Rock']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nin Japan refers to region_name = 'Japan'; on X360 refers to platform_name = 'X360'; in 2011 refers to release_year = 2011\nHow many publishers in Japan released a game on X360 in 2011?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"split": "train"
} |
nl2sql | [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n region_name text, -- example: ['Europe', 'North America']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['10TACLE Studios', '1C Company']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n num_sales real, -- number sales, example: [3.5, 1.43]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n release_year integer, -- example: [2007, 2006]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n platform_name text, -- example: ['Wii', 'NES']\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\ngame platform refers to game_platform_id; the most popular refers to max(num_sales); in Europe refers to region_name = 'Europe'\nWhich game platform is the most popular in Europe?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"role": "user"
}
] | nl2sql | {
"ground_truth": "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",
"style": "rule"
} | {
"db_id": "video_games.sqlite",
"gt_sql": "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",
"index": 1635,
"question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n region_name text, -- example: ['Europe', 'North America']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['10TACLE Studios', '1C Company']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n num_sales real, -- number sales, example: [3.5, 1.43]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n release_year integer, -- example: [2007, 2006]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n platform_name text, -- example: ['Wii', 'NES']\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\ngame platform refers to game_platform_id; the most popular refers to max(num_sales); in Europe refers to region_name = 'Europe'\nWhich game platform is the most popular in Europe?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"split": "train"
} |
nl2sql | [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['25 to Life', '2 Games in 1: Sonic Advance & ChuChu Roc', '2 Games in 1: Sonic Battle & ChuChu Rock']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n region_name text, -- example: ['North America', 'Europe']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n platform_name text, -- example: ['Wii', 'NES']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n num_sales real, -- number sales, example: [3.5, 1.43]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nthe game named 25 to Life refers to game_name = '25 to Life'\nWhat is the genre ID of the game named 25 to Life?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"role": "user"
}
] | nl2sql | {
"ground_truth": "SELECT T.genre_id FROM game AS T WHERE T.game_name = '25 to Life'",
"style": "rule"
} | {
"db_id": "video_games.sqlite",
"gt_sql": "SELECT T.genre_id FROM game AS T WHERE T.game_name = '25 to Life'",
"index": 1636,
"question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['25 to Life', '2 Games in 1: Sonic Advance & ChuChu Roc', '2 Games in 1: Sonic Battle & ChuChu Rock']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n region_name text, -- example: ['North America', 'Europe']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n platform_name text, -- example: ['Wii', 'NES']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n num_sales real, -- number sales, example: [3.5, 1.43]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nthe game named 25 to Life refers to game_name = '25 to Life'\nWhat is the genre ID of the game named 25 to Life?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"split": "train"
} |
nl2sql | [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n release_year integer, -- example: [2007, 2006]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\ngame ID refers to game.id; genre ID 2 refers to genre_id = 2\nList down the game ID of games with genre ID 2.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"role": "user"
}
] | nl2sql | {
"ground_truth": "SELECT T.id FROM game AS T WHERE T.genre_id = 2",
"style": "rule"
} | {
"db_id": "video_games.sqlite",
"gt_sql": "SELECT T.id FROM game AS T WHERE T.genre_id = 2",
"index": 1637,
"question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n release_year integer, -- example: [2007, 2006]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\ngame ID refers to game.id; genre ID 2 refers to genre_id = 2\nList down the game ID of games with genre ID 2.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"split": "train"
} |
nl2sql | [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n region_name text, -- example: ['North America', 'Europe']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n platform_name text, -- example: ['Wii', 'NES']\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nplatform ID 15 refers to platform_id = 15\nGive the game publisher ID of records with platform ID 15.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"role": "user"
}
] | nl2sql | {
"ground_truth": "SELECT T.game_publisher_id FROM game_platform AS T WHERE T.platform_id = 15",
"style": "rule"
} | {
"db_id": "video_games.sqlite",
"gt_sql": "SELECT T.game_publisher_id FROM game_platform AS T WHERE T.platform_id = 15",
"index": 1638,
"question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n region_name text, -- example: ['North America', 'Europe']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n platform_name text, -- example: ['Wii', 'NES']\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nplatform ID 15 refers to platform_id = 15\nGive the game publisher ID of records with platform ID 15.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"split": "train"
} |
nl2sql | [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n release_year integer, -- example: [2007, 2006]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nrecord ID refers to game.id; released between 2000 to 2003 refers to release_year BETWEEN 2000 AND 2003\nList down the record ID of records released between 2000 to 2003.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"role": "user"
}
] | nl2sql | {
"ground_truth": "SELECT T.id FROM game_platform AS T WHERE T.release_year BETWEEN 2000 AND 2003",
"style": "rule"
} | {
"db_id": "video_games.sqlite",
"gt_sql": "SELECT T.id FROM game_platform AS T WHERE T.release_year BETWEEN 2000 AND 2003",
"index": 1639,
"question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n release_year integer, -- example: [2007, 2006]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nrecord ID refers to game.id; released between 2000 to 2003 refers to release_year BETWEEN 2000 AND 2003\nList down the record ID of records released between 2000 to 2003.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"split": "train"
} |
nl2sql | [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n region_name text, -- example: ['North America', 'Europe']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['10TACLE Studios', '1C Company']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n num_sales real, -- number sales, example: [3.5, 1.43]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['2 Games in 1: Sonic Advance & ChuChu Roc', '2 Games in 1: Sonic Battle & ChuChu Rock']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n release_year integer, -- example: [2007, 2006]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nnumber of sales refers to multiply(num_sales, 100000)\nWhat is the number of sales in region ID 2 with game platform ID 9615?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"role": "user"
}
] | nl2sql | {
"ground_truth": "SELECT T.num_sales * 100000 FROM region_sales AS T WHERE T.region_id = 2 AND T.game_platform_id = 9615",
"style": "rule"
} | {
"db_id": "video_games.sqlite",
"gt_sql": "SELECT T.num_sales * 100000 FROM region_sales AS T WHERE T.region_id = 2 AND T.game_platform_id = 9615",
"index": 1640,
"question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n region_name text, -- example: ['North America', 'Europe']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['10TACLE Studios', '1C Company']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n num_sales real, -- number sales, example: [3.5, 1.43]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['2 Games in 1: Sonic Advance & ChuChu Roc', '2 Games in 1: Sonic Battle & ChuChu Rock']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n release_year integer, -- example: [2007, 2006]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nnumber of sales refers to multiply(num_sales, 100000)\nWhat is the number of sales in region ID 2 with game platform ID 9615?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"split": "train"
} |
nl2sql | [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['10TACLE Studios', '1C Company']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n release_year integer, -- example: [2007, 2006]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n region_name text, -- example: ['North America', 'Europe']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n platform_name text, -- example: ['Wii', 'NES']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n num_sales real, -- number sales, example: [3.5, 1.43]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nname of platform refers to platform_name; released in 2016 refers to release_year = 2016\nList down the names of platform where the games released in 2016 can be played on.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"role": "user"
}
] | nl2sql | {
"ground_truth": "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",
"style": "rule"
} | {
"db_id": "video_games.sqlite",
"gt_sql": "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",
"index": 1641,
"question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['10TACLE Studios', '1C Company']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n release_year integer, -- example: [2007, 2006]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n region_name text, -- example: ['North America', 'Europe']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n platform_name text, -- example: ['Wii', 'NES']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n num_sales real, -- number sales, example: [3.5, 1.43]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nname of platform refers to platform_name; released in 2016 refers to release_year = 2016\nList down the names of platform where the games released in 2016 can be played on.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"split": "train"
} |
nl2sql | [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n genre_name text, -- example: ['Action', 'Adventure']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['10TACLE Studios', '1C Company']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['2 Games in 1: Sonic Advance & ChuChu Roc', '2 Games in 1: Sonic Battle & ChuChu Rock']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n release_year integer, -- example: [2007, 2006]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n num_sales real, -- number sales, example: [3.5, 1.43]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n platform_name text, -- example: ['Wii', 'NES']\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\ngenre refers to genre_name; released from 2000 to 2002 refers to release_year BETWEEN 2000 AND 2002\nGive the genre of the games released from 2000 to 2002.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"role": "user"
}
] | nl2sql | {
"ground_truth": "SELECT DISTINCT T4.genre_name FROM game_platform AS T1 INNER JOIN game_publisher AS T2 ON T1.game_publisher_id = T2.id INNER JOIN game AS T3 ON T2.game_id = T3.id INNER JOIN genre AS T4 ON T3.genre_id = T4.id WHERE T1.release_year BETWEEN 2000 AND 2002",
"style": "rule"
} | {
"db_id": "video_games.sqlite",
"gt_sql": "SELECT DISTINCT T4.genre_name FROM game_platform AS T1 INNER JOIN game_publisher AS T2 ON T1.game_publisher_id = T2.id INNER JOIN game AS T3 ON T2.game_id = T3.id INNER JOIN genre AS T4 ON T3.genre_id = T4.id WHERE T1.release_year BETWEEN 2000 AND 2002",
"index": 1642,
"question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n genre_name text, -- example: ['Action', 'Adventure']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['10TACLE Studios', '1C Company']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['2 Games in 1: Sonic Advance & ChuChu Roc', '2 Games in 1: Sonic Battle & ChuChu Rock']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n release_year integer, -- example: [2007, 2006]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n num_sales real, -- number sales, example: [3.5, 1.43]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n platform_name text, -- example: ['Wii', 'NES']\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\ngenre refers to genre_name; released from 2000 to 2002 refers to release_year BETWEEN 2000 AND 2002\nGive the genre of the games released from 2000 to 2002.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"split": "train"
} |
nl2sql | [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n release_year integer, -- example: [2007, 2006]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['3DO', '10TACLE Studios', '1C Company']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n genre_name text, -- example: ['Action', 'Adventure']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['2 Games in 1: Sonic Advance & ChuChu Roc', '2 Games in 1: Sonic Battle & ChuChu Rock']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n region_name text, -- example: ['North America', 'Europe']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nname of game refers to game_name; published by 3DO refers to publisher_name = '3DO'\nList down the name of games published by 3DO.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"role": "user"
}
] | nl2sql | {
"ground_truth": "SELECT T1.game_name FROM game AS T1 INNER JOIN game_publisher AS T2 ON T1.id = T2.game_id INNER JOIN publisher AS T3 ON T2.publisher_id = T3.id WHERE T3.publisher_name = '3DO'",
"style": "rule"
} | {
"db_id": "video_games.sqlite",
"gt_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 = '3DO'",
"index": 1643,
"question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n release_year integer, -- example: [2007, 2006]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['3DO', '10TACLE Studios', '1C Company']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n genre_name text, -- example: ['Action', 'Adventure']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['2 Games in 1: Sonic Advance & ChuChu Roc', '2 Games in 1: Sonic Battle & ChuChu Rock']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n region_name text, -- example: ['North America', 'Europe']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nname of game refers to game_name; published by 3DO refers to publisher_name = '3DO'\nList down the name of games published by 3DO.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"split": "train"
} |
nl2sql | [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['2 Games in 1: Sonic Advance & ChuChu Roc', '2 Games in 1: Sonic Battle & ChuChu Rock']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['10TACLE Studios', '1C Company']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n genre_name text, -- example: ['Role-Playing', 'Action', 'Adventure']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n release_year integer, -- example: [2007, 2006]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nrole-playing game refers to genre_name = 'Role-Playing'\nHow many role-playing games are there?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"role": "user"
}
] | nl2sql | {
"ground_truth": "SELECT COUNT(T1.id) FROM game AS T1 INNER JOIN genre AS T2 ON T1.genre_id = T2.id WHERE T2.genre_name = 'Role-Playing'",
"style": "rule"
} | {
"db_id": "video_games.sqlite",
"gt_sql": "SELECT COUNT(T1.id) FROM game AS T1 INNER JOIN genre AS T2 ON T1.genre_id = T2.id WHERE T2.genre_name = 'Role-Playing'",
"index": 1644,
"question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['2 Games in 1: Sonic Advance & ChuChu Roc', '2 Games in 1: Sonic Battle & ChuChu Rock']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['10TACLE Studios', '1C Company']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n genre_name text, -- example: ['Role-Playing', 'Action', 'Adventure']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n release_year integer, -- example: [2007, 2006]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nrole-playing game refers to genre_name = 'Role-Playing'\nHow many role-playing games are there?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"split": "train"
} |
nl2sql | [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n num_sales real, -- number sales, example: [3.5, 1.43]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n region_name text, -- example: ['North America', 'Europe']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['10TACLE Studios', '1C Company']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n release_year integer, -- example: [2007, 2006]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n platform_name text, -- example: ['Wii', 'NES']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\ncompany refers to publisher_name; the most sales refers to max(num_sales); in North America refers to region_name = 'North America'\nWhich company published the game with the most sales in North America?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"role": "user"
}
] | nl2sql | {
"ground_truth": "SELECT T.publisher_name FROM ( SELECT T5.publisher_name, SUM(T2.num_sales) * 100000 FROM region AS T1 INNER JOIN region_sales AS T2 ON T1.id = T2.region_id INNER JOIN game_platform AS T3 ON T2.game_platform_id = T3.id INNER JOIN game_publisher AS T4 ON T3.game_publisher_id = T4.id INNER JOIN publisher AS T5 ON T4.publisher_id = T5.id WHERE T1.region_name = 'North America' GROUP BY T5.publisher_name ORDER BY SUM(T2.num_sales) * 100000 DESC LIMIT 1 ) t",
"style": "rule"
} | {
"db_id": "video_games.sqlite",
"gt_sql": "SELECT T.publisher_name FROM ( SELECT T5.publisher_name, SUM(T2.num_sales) * 100000 FROM region AS T1 INNER JOIN region_sales AS T2 ON T1.id = T2.region_id INNER JOIN game_platform AS T3 ON T2.game_platform_id = T3.id INNER JOIN game_publisher AS T4 ON T3.game_publisher_id = T4.id INNER JOIN publisher AS T5 ON T4.publisher_id = T5.id WHERE T1.region_name = 'North America' GROUP BY T5.publisher_name ORDER BY SUM(T2.num_sales) * 100000 DESC LIMIT 1 ) t",
"index": 1645,
"question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n num_sales real, -- number sales, example: [3.5, 1.43]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n region_name text, -- example: ['North America', 'Europe']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['10TACLE Studios', '1C Company']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n release_year integer, -- example: [2007, 2006]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n platform_name text, -- example: ['Wii', 'NES']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\ncompany refers to publisher_name; the most sales refers to max(num_sales); in North America refers to region_name = 'North America'\nWhich company published the game with the most sales in North America?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"split": "train"
} |
nl2sql | [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n release_year integer, -- example: [2007, 2006]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n region_name text, -- example: ['North America', 'Europe']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n num_sales real, -- number sales, example: [3.5, 1.43]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\ngained 350000 sales refers to num_sales = 3.5; in North America refers to region_name = 'North America'\nWhat is the release year of the game that gained 350000 sales in North America?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"role": "user"
}
] | nl2sql | {
"ground_truth": "SELECT T3.release_year FROM region AS T1 INNER JOIN region_sales AS T2 ON T1.id = T2.region_id INNER JOIN game_platform AS T3 ON T2.game_platform_id = T3.id WHERE T2.num_sales * 100000 = 350000 AND T1.region_name = 'North America'",
"style": "rule"
} | {
"db_id": "video_games.sqlite",
"gt_sql": "SELECT T3.release_year FROM region AS T1 INNER JOIN region_sales AS T2 ON T1.id = T2.region_id INNER JOIN game_platform AS T3 ON T2.game_platform_id = T3.id WHERE T2.num_sales * 100000 = 350000 AND T1.region_name = 'North America'",
"index": 1646,
"question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n release_year integer, -- example: [2007, 2006]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n region_name text, -- example: ['North America', 'Europe']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n num_sales real, -- number sales, example: [3.5, 1.43]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\ngained 350000 sales refers to num_sales = 3.5; in North America refers to region_name = 'North America'\nWhat is the release year of the game that gained 350000 sales in North America?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"split": "train"
} |
nl2sql | [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n region_name text, -- example: ['Japan', 'North America', 'Europe']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['2 Games in 1: Sonic Advance & ChuChu Roc', '2 Games in 1: Sonic Battle & ChuChu Rock']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n num_sales real, -- number sales, example: [3.5, 1.43]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\ntitle of the game refers to game_name; gained the most sales refers to max(num_sales); in Japan refers to region_name = 'Japan'\nWhat is the title of the game that gained the most sales in Japan?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"role": "user"
}
] | nl2sql | {
"ground_truth": "SELECT T.game_name FROM ( SELECT T5.game_name FROM region AS T1 INNER JOIN region_sales AS T2 ON T1.id = T2.region_id INNER JOIN game_platform AS T3 ON T2.game_platform_id = T3.id INNER JOIN game_publisher AS T4 ON T3.game_publisher_id = T4.id INNER JOIN game AS T5 ON T4.game_id = T5.id WHERE T1.region_name = 'Japan' ORDER BY T2.num_sales DESC LIMIT 1 ) t",
"style": "rule"
} | {
"db_id": "video_games.sqlite",
"gt_sql": "SELECT T.game_name FROM ( SELECT T5.game_name FROM region AS T1 INNER JOIN region_sales AS T2 ON T1.id = T2.region_id INNER JOIN game_platform AS T3 ON T2.game_platform_id = T3.id INNER JOIN game_publisher AS T4 ON T3.game_publisher_id = T4.id INNER JOIN game AS T5 ON T4.game_id = T5.id WHERE T1.region_name = 'Japan' ORDER BY T2.num_sales DESC LIMIT 1 ) t",
"index": 1647,
"question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n region_name text, -- example: ['Japan', 'North America', 'Europe']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['2 Games in 1: Sonic Advance & ChuChu Roc', '2 Games in 1: Sonic Battle & ChuChu Rock']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n num_sales real, -- number sales, example: [3.5, 1.43]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\ntitle of the game refers to game_name; gained the most sales refers to max(num_sales); in Japan refers to region_name = 'Japan'\nWhat is the title of the game that gained the most sales in Japan?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"split": "train"
} |
nl2sql | [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['2 Games in 1: Sonic Advance & ChuChu Roc', '2 Games in 1: Sonic Battle & ChuChu Rock']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n region_name text, -- example: ['Japan', 'North America', 'Europe']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n num_sales real, -- number sales, example: [3.5, 1.43]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['10TACLE Studios', '1C Company']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n genre_name text, -- example: ['Action', 'Adventure']\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\ngame publisher's name refers to publisher_name; sales greater than 90% of the average sales refers to num_sales > multiply(0.9, avg(num_sales)); in Japan refers to region_name = 'Japan'\nProvide the game publisher's name of the game with sales greater than 90% of the average sales in Japan.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"role": "user"
}
] | nl2sql | {
"ground_truth": "SELECT DISTINCT T5.publisher_name FROM region AS T1 INNER JOIN region_sales AS T2 ON T1.id = T2.region_id INNER JOIN game_platform AS T3 ON T2.game_platform_id = T3.id INNER JOIN game_publisher AS T4 ON T3.game_publisher_id = T4.id INNER JOIN publisher AS T5 ON T4.publisher_id = T5.id WHERE T2.num_sales * 10000000 > ( SELECT AVG(T2.num_sales) * 100000 * 90 FROM region AS T1 INNER JOIN region_sales AS T2 ON T1.id = T2.region_id WHERE T1.region_name = 'Japan' )",
"style": "rule"
} | {
"db_id": "video_games.sqlite",
"gt_sql": "SELECT DISTINCT T5.publisher_name FROM region AS T1 INNER JOIN region_sales AS T2 ON T1.id = T2.region_id INNER JOIN game_platform AS T3 ON T2.game_platform_id = T3.id INNER JOIN game_publisher AS T4 ON T3.game_publisher_id = T4.id INNER JOIN publisher AS T5 ON T4.publisher_id = T5.id WHERE T2.num_sales * 10000000 > ( SELECT AVG(T2.num_sales) * 100000 * 90 FROM region AS T1 INNER JOIN region_sales AS T2 ON T1.id = T2.region_id WHERE T1.region_name = 'Japan' )",
"index": 1648,
"question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['2 Games in 1: Sonic Advance & ChuChu Roc', '2 Games in 1: Sonic Battle & ChuChu Rock']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n region_name text, -- example: ['Japan', 'North America', 'Europe']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n num_sales real, -- number sales, example: [3.5, 1.43]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['10TACLE Studios', '1C Company']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n genre_name text, -- example: ['Action', 'Adventure']\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\ngame publisher's name refers to publisher_name; sales greater than 90% of the average sales refers to num_sales > multiply(0.9, avg(num_sales)); in Japan refers to region_name = 'Japan'\nProvide the game publisher's name of the game with sales greater than 90% of the average sales in Japan.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"split": "train"
} |
nl2sql | [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['2Xtreme', '2 Games in 1: Sonic Advance & ChuChu Roc', '2 Games in 1: Sonic Battle & ChuChu Rock']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['10TACLE Studios', '1C Company']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n platform_name text, -- example: ['Wii', 'NES']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n release_year integer, -- example: [2007, 2006]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n genre_name text, -- example: ['Action', 'Adventure']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n num_sales real, -- number sales, example: [3.5, 1.43]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n region_name text, -- example: ['North America', 'Europe']\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nthe '2Xtreme' game refers to game_name = '2Xtreme'\nWhat is the genre ID of the '2Xtreme' game?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"role": "user"
}
] | nl2sql | {
"ground_truth": "SELECT T.genre_id FROM game AS T WHERE T.game_name = '2Xtreme'",
"style": "rule"
} | {
"db_id": "video_games.sqlite",
"gt_sql": "SELECT T.genre_id FROM game AS T WHERE T.game_name = '2Xtreme'",
"index": 1649,
"question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['2Xtreme', '2 Games in 1: Sonic Advance & ChuChu Roc', '2 Games in 1: Sonic Battle & ChuChu Rock']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['10TACLE Studios', '1C Company']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n platform_name text, -- example: ['Wii', 'NES']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n release_year integer, -- example: [2007, 2006]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n genre_name text, -- example: ['Action', 'Adventure']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n num_sales real, -- number sales, example: [3.5, 1.43]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n region_name text, -- example: ['North America', 'Europe']\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nthe '2Xtreme' game refers to game_name = '2Xtreme'\nWhat is the genre ID of the '2Xtreme' game?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"split": "train"
} |
nl2sql | [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['10TACLE Studios', '1C Company']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['2 Games in 1: Sonic Advance & ChuChu Roc', '2 Games in 1: Sonic Battle & ChuChu Rock']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n num_sales real, -- number sales, example: [3.5, 1.43]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n release_year integer, -- example: [2007, 2006]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n region_name text, -- example: ['North America', 'Europe']\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\ntotal game sales refers to multiply(sum(num_sales), 100000); platform ID 9658 refers to game_platform_id = 9658\nSum the total game sales in every region for platform ID 9658.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"role": "user"
}
] | nl2sql | {
"ground_truth": "SELECT SUM(T.num_sales) * 100000 FROM region_sales AS T WHERE T.game_platform_id = 9658",
"style": "rule"
} | {
"db_id": "video_games.sqlite",
"gt_sql": "SELECT SUM(T.num_sales) * 100000 FROM region_sales AS T WHERE T.game_platform_id = 9658",
"index": 1650,
"question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['10TACLE Studios', '1C Company']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['2 Games in 1: Sonic Advance & ChuChu Roc', '2 Games in 1: Sonic Battle & ChuChu Rock']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n num_sales real, -- number sales, example: [3.5, 1.43]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n release_year integer, -- example: [2007, 2006]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n region_name text, -- example: ['North America', 'Europe']\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\ntotal game sales refers to multiply(sum(num_sales), 100000); platform ID 9658 refers to game_platform_id = 9658\nSum the total game sales in every region for platform ID 9658.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"split": "train"
} |
nl2sql | [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n release_year integer, -- example: [2007, 2006]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['2 Games in 1: Sonic Advance & ChuChu Roc', '2 Games in 1: Sonic Battle & ChuChu Rock']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n region_name text, -- example: ['North America', 'Europe']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n platform_name text, -- example: ['Wii', 'NES']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['1C Company', '10TACLE Studios']\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nID refers to publisher.id; 1C Company refers to publisher_name = '1C Company'\nProvide the ID of 1C Company.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"role": "user"
}
] | nl2sql | {
"ground_truth": "SELECT T.id FROM publisher AS T WHERE T.publisher_name = '1C Company'",
"style": "rule"
} | {
"db_id": "video_games.sqlite",
"gt_sql": "SELECT T.id FROM publisher AS T WHERE T.publisher_name = '1C Company'",
"index": 1651,
"question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n release_year integer, -- example: [2007, 2006]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['2 Games in 1: Sonic Advance & ChuChu Roc', '2 Games in 1: Sonic Battle & ChuChu Rock']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n region_name text, -- example: ['North America', 'Europe']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n platform_name text, -- example: ['Wii', 'NES']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['1C Company', '10TACLE Studios']\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nID refers to publisher.id; 1C Company refers to publisher_name = '1C Company'\nProvide the ID of 1C Company.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"split": "train"
} |
nl2sql | [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n genre_name text, -- example: ['Action', 'Adventure']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['2 Games in 1: Sonic Advance & ChuChu Roc', '2 Games in 1: Sonic Battle & ChuChu Rock']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n release_year integer, -- example: [2007, 2006]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['10TACLE Studios', '1C Company']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\ngame ID refers to game.id; released in 2017 refers to release_year = 2017\nList the game IDs that were released in 2017.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"role": "user"
}
] | nl2sql | {
"ground_truth": "SELECT T.id FROM game_platform AS T WHERE T.release_year = 2017",
"style": "rule"
} | {
"db_id": "video_games.sqlite",
"gt_sql": "SELECT T.id FROM game_platform AS T WHERE T.release_year = 2017",
"index": 1652,
"question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n genre_name text, -- example: ['Action', 'Adventure']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['2 Games in 1: Sonic Advance & ChuChu Roc', '2 Games in 1: Sonic Battle & ChuChu Rock']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n release_year integer, -- example: [2007, 2006]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['10TACLE Studios', '1C Company']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\ngame ID refers to game.id; released in 2017 refers to release_year = 2017\nList the game IDs that were released in 2017.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"split": "train"
} |
nl2sql | [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n genre_name text, -- example: ['Puzzle', 'Action', 'Adventure']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\npuzzle genre refers to genre_name = 'Puzzle'\nHow many games are puzzle genre?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"role": "user"
}
] | nl2sql | {
"ground_truth": "SELECT COUNT(T1.id) FROM game AS T1 INNER JOIN genre AS T2 ON T1.genre_id = T2.id WHERE T2.genre_name = 'Puzzle'",
"style": "rule"
} | {
"db_id": "video_games.sqlite",
"gt_sql": "SELECT COUNT(T1.id) FROM game AS T1 INNER JOIN genre AS T2 ON T1.genre_id = T2.id WHERE T2.genre_name = 'Puzzle'",
"index": 1653,
"question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n genre_name text, -- example: ['Puzzle', 'Action', 'Adventure']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\npuzzle genre refers to genre_name = 'Puzzle'\nHow many games are puzzle genre?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"split": "train"
} |
nl2sql | [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n region_name text, -- example: ['North America', 'Europe']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n num_sales real, -- number sales, example: [3.5, 1.43]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['Acclaim Entertainment', '10TACLE Studios', '1C Company']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\npublished by Acclaim Entertainment refers to publisher_name = 'Acclaim Entertainment'\nHow many games were published by Acclaim Entertainment?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"role": "user"
}
] | nl2sql | {
"ground_truth": "SELECT COUNT(DISTINCT T1.game_id) FROM game_publisher AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.id WHERE T2.publisher_name = 'Acclaim Entertainment'",
"style": "rule"
} | {
"db_id": "video_games.sqlite",
"gt_sql": "SELECT COUNT(DISTINCT T1.game_id) FROM game_publisher AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.id WHERE T2.publisher_name = 'Acclaim Entertainment'",
"index": 1654,
"question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n region_name text, -- example: ['North America', 'Europe']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n num_sales real, -- number sales, example: [3.5, 1.43]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['Acclaim Entertainment', '10TACLE Studios', '1C Company']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\npublished by Acclaim Entertainment refers to publisher_name = 'Acclaim Entertainment'\nHow many games were published by Acclaim Entertainment?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"split": "train"
} |
nl2sql | [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n genre_name text, -- example: ['Action', 'Adventure']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n num_sales real, -- number sales, example: [3.5, 1.43]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['Chronicles of the Sword', '2 Games in 1: Sonic Advance & ChuChu Roc', '2 Games in 1: Sonic Battle & ChuChu Rock']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n platform_name text, -- example: ['Wii', 'NES']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['10TACLE Studios', '1C Company']\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\npublisher refers to publisher_name; the Chronicles of the Sword game refers to game_name = 'Chronicles of the Sword'\nName the publisher of the Chronicles of the Sword game.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"role": "user"
}
] | nl2sql | {
"ground_truth": "SELECT T3.publisher_name FROM game AS T1 INNER JOIN game_publisher AS T2 ON T1.id = T2.game_id INNER JOIN publisher AS T3 ON T2.publisher_id = T3.id WHERE T1.game_name = 'Chronicles of the Sword'",
"style": "rule"
} | {
"db_id": "video_games.sqlite",
"gt_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 = 'Chronicles of the Sword'",
"index": 1655,
"question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n genre_name text, -- example: ['Action', 'Adventure']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n num_sales real, -- number sales, example: [3.5, 1.43]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['Chronicles of the Sword', '2 Games in 1: Sonic Advance & ChuChu Roc', '2 Games in 1: Sonic Battle & ChuChu Rock']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n platform_name text, -- example: ['Wii', 'NES']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['10TACLE Studios', '1C Company']\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\npublisher refers to publisher_name; the Chronicles of the Sword game refers to game_name = 'Chronicles of the Sword'\nName the publisher of the Chronicles of the Sword game.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"split": "train"
} |
nl2sql | [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n platform_name text, -- example: ['Wii', 'NES']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n num_sales real, -- number sales, example: [3.5, 1.43]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n release_year integer, -- example: [2007, 2006]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['2 Games in 1: Sonic Advance & ChuChu Roc', '2 Games in 1: Sonic Battle & ChuChu Rock']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n region_name text, -- example: ['North America', 'Europe']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['10TACLE Studios', '1C Company']\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\ngame refers to game_name; released in 2011 refers to release_year = 2011\nName the game released in 2011.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"role": "user"
}
] | nl2sql | {
"ground_truth": "SELECT T3.game_name FROM game_platform AS T1 INNER JOIN game_publisher AS T2 ON T1.game_publisher_id = T2.id INNER JOIN game AS T3 ON T2.game_id = T3.id WHERE T1.release_year = 2011",
"style": "rule"
} | {
"db_id": "video_games.sqlite",
"gt_sql": "SELECT T3.game_name FROM game_platform AS T1 INNER JOIN game_publisher AS T2 ON T1.game_publisher_id = T2.id INNER JOIN game AS T3 ON T2.game_id = T3.id WHERE T1.release_year = 2011",
"index": 1656,
"question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n platform_name text, -- example: ['Wii', 'NES']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n num_sales real, -- number sales, example: [3.5, 1.43]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n release_year integer, -- example: [2007, 2006]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['2 Games in 1: Sonic Advance & ChuChu Roc', '2 Games in 1: Sonic Battle & ChuChu Rock']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n region_name text, -- example: ['North America', 'Europe']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['10TACLE Studios', '1C Company']\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\ngame refers to game_name; released in 2011 refers to release_year = 2011\nName the game released in 2011.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"split": "train"
} |
nl2sql | [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n region_name text, -- example: ['North America', 'Europe']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['2 Games in 1: Sonic Advance & ChuChu Roc', '2 Games in 1: Sonic Battle & ChuChu Rock']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n genre_name text, -- example: ['Sports', 'Action', 'Adventure']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n platform_name text, -- example: ['Wii', 'NES']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n num_sales real, -- number sales, example: [3.5, 1.43]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n release_year integer, -- example: [2007, 2006]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\ngame refers to game_name; under the sports genre refers to genre_name = 'Sports'\nProvide any five games and release year under the sports genre.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"role": "user"
}
] | nl2sql | {
"ground_truth": "SELECT T3.game_name, T1.release_year FROM game_platform AS T1 INNER JOIN game_publisher AS T2 ON T1.game_publisher_id = T2.id INNER JOIN game AS T3 ON T2.game_id = T3.id INNER JOIN genre AS T4 ON T3.genre_id = T4.id WHERE T4.genre_name = 'Sports' LIMIT 5",
"style": "rule"
} | {
"db_id": "video_games.sqlite",
"gt_sql": "SELECT T3.game_name, T1.release_year FROM game_platform AS T1 INNER JOIN game_publisher AS T2 ON T1.game_publisher_id = T2.id INNER JOIN game AS T3 ON T2.game_id = T3.id INNER JOIN genre AS T4 ON T3.genre_id = T4.id WHERE T4.genre_name = 'Sports' LIMIT 5",
"index": 1657,
"question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n region_name text, -- example: ['North America', 'Europe']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['2 Games in 1: Sonic Advance & ChuChu Roc', '2 Games in 1: Sonic Battle & ChuChu Rock']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n genre_name text, -- example: ['Sports', 'Action', 'Adventure']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n platform_name text, -- example: ['Wii', 'NES']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n num_sales real, -- number sales, example: [3.5, 1.43]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n release_year integer, -- example: [2007, 2006]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\ngame refers to game_name; under the sports genre refers to genre_name = 'Sports'\nProvide any five games and release year under the sports genre.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"split": "train"
} |
nl2sql | [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n platform_name text, -- example: ['Wii', 'NES']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['Panzer Tactics', '2 Games in 1: Sonic Advance & ChuChu Roc', '2 Games in 1: Sonic Battle & ChuChu Rock']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['10TACLE Studios', '1C Company']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n genre_name text, -- example: ['Platform', 'Action', 'Adventure']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n num_sales real, -- number sales, example: [3.5, 1.43]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nplatform refers to platform_name; the Panzer Tactics is a game name.\nProvide the platform where the Panzer Tactics can be played.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"role": "user"
}
] | nl2sql | {
"ground_truth": "SELECT T4.platform_name FROM game AS T1 INNER JOIN game_publisher AS T2 ON T1.id = T2.game_id INNER JOIN game_platform AS T3 ON T2.id = T3.game_publisher_id INNER JOIN platform AS T4 ON T3.platform_id = T4.id WHERE T1.game_name = 'Panzer Tactics'",
"style": "rule"
} | {
"db_id": "video_games.sqlite",
"gt_sql": "SELECT T4.platform_name FROM game AS T1 INNER JOIN game_publisher AS T2 ON T1.id = T2.game_id INNER JOIN game_platform AS T3 ON T2.id = T3.game_publisher_id INNER JOIN platform AS T4 ON T3.platform_id = T4.id WHERE T1.game_name = 'Panzer Tactics'",
"index": 1658,
"question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n platform_name text, -- example: ['Wii', 'NES']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['Panzer Tactics', '2 Games in 1: Sonic Advance & ChuChu Roc', '2 Games in 1: Sonic Battle & ChuChu Rock']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['10TACLE Studios', '1C Company']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n genre_name text, -- example: ['Platform', 'Action', 'Adventure']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n num_sales real, -- number sales, example: [3.5, 1.43]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nplatform refers to platform_name; the Panzer Tactics is a game name.\nProvide the platform where the Panzer Tactics can be played.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"split": "train"
} |
nl2sql | [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['2 Games in 1: Sonic Advance & ChuChu Roc', '2 Games in 1: Sonic Battle & ChuChu Rock']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n platform_name text, -- example: ['Wii', 'NES']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n release_year integer, -- example: [2007, 2006]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n genre_name text, -- example: ['Platform', 'Action', 'Adventure']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['10TACLE Studios', '1C Company']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n region_name text, -- example: ['North America', 'Europe']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n num_sales real, -- number sales, example: [3.5, 1.43]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nin North America refers to region_name = 'North America'; platform ID 9577 refers to game_platform_id = 9577; percent = divide(subtract(num_sales where region_name = 'North America' and game_platform_id = 9577, avg(num_sales)), avg(num_sales)) * 100%\nCalculate how many percent of sales in North America is higher than the average sale per region for platform ID 9577.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"role": "user"
}
] | nl2sql | {
"ground_truth": "SELECT (SUM(CASE WHEN T2.region_name = 'North America' THEN T1.num_sales ELSE 0 END) - AVG(T1.num_sales)) * 100.0 / AVG(T1.num_sales) FROM region_sales AS T1 INNER JOIN region AS T2 ON T1.region_id = T2.id WHERE T1.game_platform_id = 9577",
"style": "rule"
} | {
"db_id": "video_games.sqlite",
"gt_sql": "SELECT (SUM(CASE WHEN T2.region_name = 'North America' THEN T1.num_sales ELSE 0 END) - AVG(T1.num_sales)) * 100.0 / AVG(T1.num_sales) FROM region_sales AS T1 INNER JOIN region AS T2 ON T1.region_id = T2.id WHERE T1.game_platform_id = 9577",
"index": 1659,
"question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['2 Games in 1: Sonic Advance & ChuChu Roc', '2 Games in 1: Sonic Battle & ChuChu Rock']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n platform_name text, -- example: ['Wii', 'NES']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n release_year integer, -- example: [2007, 2006]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n genre_name text, -- example: ['Platform', 'Action', 'Adventure']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['10TACLE Studios', '1C Company']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n region_name text, -- example: ['North America', 'Europe']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n num_sales real, -- number sales, example: [3.5, 1.43]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nin North America refers to region_name = 'North America'; platform ID 9577 refers to game_platform_id = 9577; percent = divide(subtract(num_sales where region_name = 'North America' and game_platform_id = 9577, avg(num_sales)), avg(num_sales)) * 100%\nCalculate how many percent of sales in North America is higher than the average sale per region for platform ID 9577.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"split": "train"
} |
nl2sql | [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n num_sales real, -- number sales, example: [3.5, 1.43]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['10TACLE Studios', '1C Company']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n release_year integer, -- example: [2007, 2006]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n region_name text, -- example: ['North America', 'Europe']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['2 Games in 1: Sonic Advance & ChuChu Roc', '2 Games in 1: Sonic Battle & ChuChu Rock']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\ngame refers to game_name; the longest name refers to max(length(game_name))\nWhich game has the longest name?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"role": "user"
}
] | nl2sql | {
"ground_truth": "SELECT T.game_name FROM game AS T ORDER BY LENGTH(T.game_name) DESC LIMIT 1",
"style": "rule"
} | {
"db_id": "video_games.sqlite",
"gt_sql": "SELECT T.game_name FROM game AS T ORDER BY LENGTH(T.game_name) DESC LIMIT 1",
"index": 1660,
"question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n num_sales real, -- number sales, example: [3.5, 1.43]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['10TACLE Studios', '1C Company']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n release_year integer, -- example: [2007, 2006]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n region_name text, -- example: ['North America', 'Europe']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['2 Games in 1: Sonic Advance & ChuChu Roc', '2 Games in 1: Sonic Battle & ChuChu Rock']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\ngame refers to game_name; the longest name refers to max(length(game_name))\nWhich game has the longest name?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"split": "train"
} |
nl2sql | [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n genre_name text, -- example: ['Action', 'Adventure']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['10TACLE Studios', '1C Company']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n release_year integer, -- example: [2007, 2006]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n num_sales real, -- number sales, example: [3.5, 1.43]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n region_name text, -- example: ['North America', 'Europe']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['2 Games in 1: Sonic Advance & ChuChu Roc', '2 Games in 1: Sonic Battle & ChuChu Rock']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n platform_name text, -- example: ['Wii', 'NES']\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\ntotal number of sales = sum(num_sales)\nWhat is the total number of sales across all regions?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"role": "user"
}
] | nl2sql | {
"ground_truth": "SELECT SUM(T.num_sales) * 100000 FROM region_sales t",
"style": "rule"
} | {
"db_id": "video_games.sqlite",
"gt_sql": "SELECT SUM(T.num_sales) * 100000 FROM region_sales t",
"index": 1661,
"question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n genre_name text, -- example: ['Action', 'Adventure']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['10TACLE Studios', '1C Company']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n release_year integer, -- example: [2007, 2006]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n num_sales real, -- number sales, example: [3.5, 1.43]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n region_name text, -- example: ['North America', 'Europe']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['2 Games in 1: Sonic Advance & ChuChu Roc', '2 Games in 1: Sonic Battle & ChuChu Rock']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n platform_name text, -- example: ['Wii', 'NES']\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\ntotal number of sales = sum(num_sales)\nWhat is the total number of sales across all regions?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"split": "train"
} |
nl2sql | [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n release_year integer, -- example: [2007, 2006]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nthe first year refers to min(release_year)\nWhat is the first year a game is released?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"role": "user"
}
] | nl2sql | {
"ground_truth": "SELECT MIN(T.release_year) FROM game_platform t",
"style": "rule"
} | {
"db_id": "video_games.sqlite",
"gt_sql": "SELECT MIN(T.release_year) FROM game_platform t",
"index": 1662,
"question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n release_year integer, -- example: [2007, 2006]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nthe first year refers to min(release_year)\nWhat is the first year a game is released?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"split": "train"
} |
nl2sql | [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n num_sales real, -- number sales, example: [3.5, 1.43]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n release_year integer, -- example: [2007, 2006]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n platform_name text, -- example: ['Wii', 'NES']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n genre_name text, -- example: ['Platform', 'Action', 'Adventure']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['10TACLE Studios', '1C Company']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['2 Games in 1: Sonic Advance & ChuChu Roc', '2 Games in 1: Sonic Battle & ChuChu Rock']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nplatform refers to platform_id; the most games refers to max(count(game_publisher_id))\nList the platforms that release the most games each year.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"role": "user"
}
] | nl2sql | {
"ground_truth": "SELECT T1.platform_name FROM platform AS T1 INNER JOIN game_platform AS T2 ON T1.id = T2.platform_id INNER JOIN game_publisher AS T3 ON T2.game_publisher_id = T3.id GROUP BY T2.release_year, T1.platform_name ORDER BY COUNT(DISTINCT T3.game_id) DESC",
"style": "rule"
} | {
"db_id": "video_games.sqlite",
"gt_sql": "SELECT T1.platform_name FROM platform AS T1 INNER JOIN game_platform AS T2 ON T1.id = T2.platform_id INNER JOIN game_publisher AS T3 ON T2.game_publisher_id = T3.id GROUP BY T2.release_year, T1.platform_name ORDER BY COUNT(DISTINCT T3.game_id) DESC",
"index": 1663,
"question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n num_sales real, -- number sales, example: [3.5, 1.43]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n release_year integer, -- example: [2007, 2006]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n platform_name text, -- example: ['Wii', 'NES']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n genre_name text, -- example: ['Platform', 'Action', 'Adventure']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['10TACLE Studios', '1C Company']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['2 Games in 1: Sonic Advance & ChuChu Roc', '2 Games in 1: Sonic Battle & ChuChu Rock']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nplatform refers to platform_id; the most games refers to max(count(game_publisher_id))\nList the platforms that release the most games each year.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"split": "train"
} |
nl2sql | [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n num_sales real, -- number sales, example: [3.5, 1.43]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n region_name text, -- example: ['Europe', 'North America']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n release_year integer, -- example: [2007, 2006]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['2 Games in 1: Sonic Advance & ChuChu Roc', '2 Games in 1: Sonic Battle & ChuChu Rock']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\ndo not have any sales refers to num_sales = 0; in Europe refers to region_name = 'Europe'\nHow many games do not have any sales in Europe?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"role": "user"
}
] | nl2sql | {
"ground_truth": "SELECT COUNT(*) FROM region_sales AS T1 INNER JOIN region AS T2 ON T1.region_id = T2.id WHERE T2.region_name = 'Europe' AND T1.num_sales = 0",
"style": "rule"
} | {
"db_id": "video_games.sqlite",
"gt_sql": "SELECT COUNT(*) FROM region_sales AS T1 INNER JOIN region AS T2 ON T1.region_id = T2.id WHERE T2.region_name = 'Europe' AND T1.num_sales = 0",
"index": 1664,
"question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n num_sales real, -- number sales, example: [3.5, 1.43]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n region_name text, -- example: ['Europe', 'North America']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n release_year integer, -- example: [2007, 2006]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['2 Games in 1: Sonic Advance & ChuChu Roc', '2 Games in 1: Sonic Battle & ChuChu Rock']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\ndo not have any sales refers to num_sales = 0; in Europe refers to region_name = 'Europe'\nHow many games do not have any sales in Europe?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"split": "train"
} |
nl2sql | [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n release_year integer, -- example: [2007, 2006]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['10TACLE Studios', '1C Company']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['Mario vs. Donkey Kong', 'Donkey Kong', 'Donkey Konga', '2 Games in 1: Sonic Advance & ChuChu Roc', '2 Games in 1: Sonic Battle & ChuChu Rock']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n platform_name text, -- example: ['Wii', 'NES']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n genre_name text, -- example: ['Action', 'Adventure']\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\ngenre refers to genre_name; game \"Mario vs. Donkey Kong\" refers to game_name = 'Mario vs. Donkey Kong'\nWhat is the genre of the game \"Mario vs. Donkey Kong\"?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"role": "user"
}
] | nl2sql | {
"ground_truth": "SELECT T1.genre_name FROM genre AS T1 INNER JOIN game AS T2 ON T1.id = T2.genre_id WHERE T2.game_name = 'Mario vs. Donkey Kong'",
"style": "rule"
} | {
"db_id": "video_games.sqlite",
"gt_sql": "SELECT T1.genre_name FROM genre AS T1 INNER JOIN game AS T2 ON T1.id = T2.genre_id WHERE T2.game_name = 'Mario vs. Donkey Kong'",
"index": 1665,
"question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n release_year integer, -- example: [2007, 2006]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['10TACLE Studios', '1C Company']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['Mario vs. Donkey Kong', 'Donkey Kong', 'Donkey Konga', '2 Games in 1: Sonic Advance & ChuChu Roc', '2 Games in 1: Sonic Battle & ChuChu Rock']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n platform_name text, -- example: ['Wii', 'NES']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n genre_name text, -- example: ['Action', 'Adventure']\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\ngenre refers to genre_name; game \"Mario vs. Donkey Kong\" refers to game_name = 'Mario vs. Donkey Kong'\nWhat is the genre of the game \"Mario vs. Donkey Kong\"?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"split": "train"
} |
nl2sql | [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['2 Games in 1: Sonic Advance & ChuChu Roc', '2 Games in 1: Sonic Battle & ChuChu Rock']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n region_name text, -- example: ['North America', 'Europe']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['New', '10TACLE Studios', '1C Company']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n release_year integer, -- example: [2007, 2006]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n num_sales real, -- number sales, example: [3.5, 1.43]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n platform_name text, -- example: ['WiiU', 'Wii', 'NES']\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nyear refers to release_year; \"WiiU\" refers to platform_name = 'WiiU'\nWhat are the years that \"WiiU\" got a new game?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"role": "user"
}
] | nl2sql | {
"ground_truth": "SELECT T2.release_year FROM platform AS T1 INNER JOIN game_platform AS T2 ON T1.id = T2.platform_id WHERE T1.platform_name = 'WiiU' ORDER BY T2.release_year DESC LIMIT 1",
"style": "rule"
} | {
"db_id": "video_games.sqlite",
"gt_sql": "SELECT T2.release_year FROM platform AS T1 INNER JOIN game_platform AS T2 ON T1.id = T2.platform_id WHERE T1.platform_name = 'WiiU' ORDER BY T2.release_year DESC LIMIT 1",
"index": 1666,
"question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['2 Games in 1: Sonic Advance & ChuChu Roc', '2 Games in 1: Sonic Battle & ChuChu Rock']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n region_name text, -- example: ['North America', 'Europe']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['New', '10TACLE Studios', '1C Company']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n release_year integer, -- example: [2007, 2006]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n num_sales real, -- number sales, example: [3.5, 1.43]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n platform_name text, -- example: ['WiiU', 'Wii', 'NES']\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nyear refers to release_year; \"WiiU\" refers to platform_name = 'WiiU'\nWhat are the years that \"WiiU\" got a new game?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"split": "train"
} |
nl2sql | [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n region_name text, -- example: ['North America', 'Europe']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n release_year integer, -- example: [2007, 2006]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n platform_name text, -- example: ['Wii', 'NES']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n genre_name text, -- example: ['Action', 'Adventure']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['Activision', '10TACLE Studios', '1C Company']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['2 Games in 1: Sonic Advance & ChuChu Roc', '2 Games in 1: Sonic Battle & ChuChu Rock']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\ngames refers to game_name; \"Activision\" refers to publisher_name = 'Activision';\nList the games from the publisher \"Activision\".\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"role": "user"
}
] | nl2sql | {
"ground_truth": "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 = 'Activision'",
"style": "rule"
} | {
"db_id": "video_games.sqlite",
"gt_sql": "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 = 'Activision'",
"index": 1667,
"question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n region_name text, -- example: ['North America', 'Europe']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n release_year integer, -- example: [2007, 2006]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n platform_name text, -- example: ['Wii', 'NES']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n genre_name text, -- example: ['Action', 'Adventure']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['Activision', '10TACLE Studios', '1C Company']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['2 Games in 1: Sonic Advance & ChuChu Roc', '2 Games in 1: Sonic Battle & ChuChu Rock']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\ngames refers to game_name; \"Activision\" refers to publisher_name = 'Activision';\nList the games from the publisher \"Activision\".\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"split": "train"
} |
nl2sql | [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n num_sales real, -- number sales, example: [3.5, 1.43]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n release_year integer, -- example: [2007, 2006]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['10TACLE Studios', '1C Company']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n region_name text, -- example: ['North America', 'Europe']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['2 Games in 1: Sonic Advance & ChuChu Roc', '2 Games in 1: Sonic Battle & ChuChu Rock']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\ngame that starts with \"Marvel\" refers to game_name LIKE 'Marvel%';\nHow many different publishers have published a game that starts with \"Marvel\"?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"role": "user"
}
] | nl2sql | {
"ground_truth": "SELECT COUNT(DISTINCT T1.publisher_id) FROM game_publisher AS T1 INNER JOIN game AS T2 ON T1.game_id = T2.id WHERE T2.game_name LIKE 'Marvel%'",
"style": "rule"
} | {
"db_id": "video_games.sqlite",
"gt_sql": "SELECT COUNT(DISTINCT T1.publisher_id) FROM game_publisher AS T1 INNER JOIN game AS T2 ON T1.game_id = T2.id WHERE T2.game_name LIKE 'Marvel%'",
"index": 1668,
"question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n num_sales real, -- number sales, example: [3.5, 1.43]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n release_year integer, -- example: [2007, 2006]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['10TACLE Studios', '1C Company']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n region_name text, -- example: ['North America', 'Europe']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['2 Games in 1: Sonic Advance & ChuChu Roc', '2 Games in 1: Sonic Battle & ChuChu Rock']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\ngame that starts with \"Marvel\" refers to game_name LIKE 'Marvel%';\nHow many different publishers have published a game that starts with \"Marvel\"?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"split": "train"
} |
nl2sql | [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n region_name text, -- example: ['North America', 'Japan', 'Europe']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['10TACLE Studios', '1C Company']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n release_year integer, -- example: [2007, 2006]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n platform_name text, -- example: ['Wii', 'NES']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n num_sales real, -- number sales, example: [3.5, 1.43]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nratio = DIVIDE(SUM(num_sales WHERE region_name = 'North America'), SUM(num_sales WHERE region_name = 'Japan')); North America refers to region_name = 'North America'; Japan refers to region_name = 'Japan';\nWhat is the ratio of game sales between North America and Japan?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"role": "user"
}
] | nl2sql | {
"ground_truth": "SELECT SUM(CASE WHEN T2.region_name = 'North America' THEN T1.num_sales ELSE 0 END) / SUM(CASE WHEN T2.region_name = 'Japan' THEN T1.num_sales ELSE 0 END) FROM region_sales AS T1 INNER JOIN region AS T2 ON T1.region_id = T2.id",
"style": "rule"
} | {
"db_id": "video_games.sqlite",
"gt_sql": "SELECT SUM(CASE WHEN T2.region_name = 'North America' THEN T1.num_sales ELSE 0 END) / SUM(CASE WHEN T2.region_name = 'Japan' THEN T1.num_sales ELSE 0 END) FROM region_sales AS T1 INNER JOIN region AS T2 ON T1.region_id = T2.id",
"index": 1669,
"question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n region_name text, -- example: ['North America', 'Japan', 'Europe']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['10TACLE Studios', '1C Company']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n release_year integer, -- example: [2007, 2006]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n platform_name text, -- example: ['Wii', 'NES']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n num_sales real, -- number sales, example: [3.5, 1.43]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nratio = DIVIDE(SUM(num_sales WHERE region_name = 'North America'), SUM(num_sales WHERE region_name = 'Japan')); North America refers to region_name = 'North America'; Japan refers to region_name = 'Japan';\nWhat is the ratio of game sales between North America and Japan?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"split": "train"
} |
nl2sql | [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n release_year integer, -- example: [2007, 2006]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['10TACLE Studios', '1C Company']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n region_name text, -- example: ['North America', 'Europe']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['2 Games in 1: Sonic Advance & ChuChu Roc', '2 Games in 1: Sonic Battle & ChuChu Rock']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n genre_name text, -- example: ['Action', 'Adventure']\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nyear that has the most number of video game releases refers to MAX(COUNT(release_year));\nWhich year has the most number of video game releases?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"role": "user"
}
] | nl2sql | {
"ground_truth": "SELECT T1.release_year FROM ( SELECT T.release_year, COUNT(id) FROM game_platform AS T GROUP BY T.release_year ORDER BY COUNT(T.id) DESC LIMIT 1 ) T1",
"style": "rule"
} | {
"db_id": "video_games.sqlite",
"gt_sql": "SELECT T1.release_year FROM ( SELECT T.release_year, COUNT(id) FROM game_platform AS T GROUP BY T.release_year ORDER BY COUNT(T.id) DESC LIMIT 1 ) T1",
"index": 1670,
"question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n release_year integer, -- example: [2007, 2006]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['10TACLE Studios', '1C Company']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n region_name text, -- example: ['North America', 'Europe']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['2 Games in 1: Sonic Advance & ChuChu Roc', '2 Games in 1: Sonic Battle & ChuChu Rock']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n genre_name text, -- example: ['Action', 'Adventure']\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nyear that has the most number of video game releases refers to MAX(COUNT(release_year));\nWhich year has the most number of video game releases?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"split": "train"
} |
nl2sql | [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n release_year integer, -- example: [2007, 2006]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n platform_name text, -- example: ['Wii', 'NES']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['GT Interactive', '10TACLE Studios', '1C Company']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n region_name text, -- example: ['North America', 'Europe']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\npublishers that have Interactive in their names refers to publisher_name LIKE '%Interactive%';\nHow many video game publishers have Interactive in their names?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"role": "user"
}
] | nl2sql | {
"ground_truth": "SELECT COUNT(T.id) FROM publisher AS T WHERE T.publisher_name LIKE '%Interactive%'",
"style": "rule"
} | {
"db_id": "video_games.sqlite",
"gt_sql": "SELECT COUNT(T.id) FROM publisher AS T WHERE T.publisher_name LIKE '%Interactive%'",
"index": 1671,
"question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n release_year integer, -- example: [2007, 2006]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n platform_name text, -- example: ['Wii', 'NES']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['GT Interactive', '10TACLE Studios', '1C Company']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n region_name text, -- example: ['North America', 'Europe']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\npublishers that have Interactive in their names refers to publisher_name LIKE '%Interactive%';\nHow many video game publishers have Interactive in their names?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"split": "train"
} |
nl2sql | [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n region_name text, -- example: ['North America', 'Europe']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n release_year integer, -- example: [2007, 2006]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n genre_name text, -- example: ['Action', 'Adventure']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n num_sales real, -- number sales, example: [3.5, 1.43]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['10TACLE Studios', '1C Company']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n platform_name text, -- example: ['Wii', 'NES']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nname of the publisher refers to publisher_name; publisher that released the most video games in 2007 refers to MAX(COUNT(publisher_name)) WHERE release_year = 2007;\nWhat is the name of the publisher that released the most video games in 2007?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"role": "user"
}
] | nl2sql | {
"ground_truth": "SELECT 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 WHERE T1.release_year = 2007 GROUP BY T3.publisher_name ORDER BY COUNT(DISTINCT T2.game_id) DESC LIMIT 1",
"style": "rule"
} | {
"db_id": "video_games.sqlite",
"gt_sql": "SELECT 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 WHERE T1.release_year = 2007 GROUP BY T3.publisher_name ORDER BY COUNT(DISTINCT T2.game_id) DESC LIMIT 1",
"index": 1672,
"question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n region_name text, -- example: ['North America', 'Europe']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n release_year integer, -- example: [2007, 2006]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n genre_name text, -- example: ['Action', 'Adventure']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n num_sales real, -- number sales, example: [3.5, 1.43]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['10TACLE Studios', '1C Company']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n platform_name text, -- example: ['Wii', 'NES']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nname of the publisher refers to publisher_name; publisher that released the most video games in 2007 refers to MAX(COUNT(publisher_name)) WHERE release_year = 2007;\nWhat is the name of the publisher that released the most video games in 2007?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"split": "train"
} |
nl2sql | [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['10TACLE Studios', '1C Company']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n genre_name text, -- example: ['Action', 'Adventure']\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nwhich publisher refers to publisher_name; publisher that has published the most number of Action games refers to MAX(COUNT(publisher_name)) WHERE genre_name = 'Action'; Action games refers to game_name WHERE genre_name = 'Action';\nWhich publisher has published the most number of Action games?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"role": "user"
}
] | nl2sql | {
"ground_truth": "SELECT T.publisher_name FROM ( SELECT T4.publisher_name, COUNT(DISTINCT T2.id) FROM genre AS T1 INNER JOIN game AS T2 ON T1.id = T2.genre_id INNER JOIN game_publisher AS T3 ON T2.id = T3.game_id INNER JOIN publisher AS T4 ON T3.publisher_id = T4.id WHERE T1.genre_name = 'Action' GROUP BY T4.publisher_name ORDER BY COUNT(DISTINCT T2.id) DESC LIMIT 1 ) t",
"style": "rule"
} | {
"db_id": "video_games.sqlite",
"gt_sql": "SELECT T.publisher_name FROM ( SELECT T4.publisher_name, COUNT(DISTINCT T2.id) FROM genre AS T1 INNER JOIN game AS T2 ON T1.id = T2.genre_id INNER JOIN game_publisher AS T3 ON T2.id = T3.game_id INNER JOIN publisher AS T4 ON T3.publisher_id = T4.id WHERE T1.genre_name = 'Action' GROUP BY T4.publisher_name ORDER BY COUNT(DISTINCT T2.id) DESC LIMIT 1 ) t",
"index": 1673,
"question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['10TACLE Studios', '1C Company']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n genre_name text, -- example: ['Action', 'Adventure']\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nwhich publisher refers to publisher_name; publisher that has published the most number of Action games refers to MAX(COUNT(publisher_name)) WHERE genre_name = 'Action'; Action games refers to game_name WHERE genre_name = 'Action';\nWhich publisher has published the most number of Action games?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"split": "train"
} |
nl2sql | [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['2 Games in 1: Sonic Advance & ChuChu Roc', '2 Games in 1: Sonic Battle & ChuChu Rock']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n region_name text, -- example: ['Other', 'North America', 'Europe']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['10TACLE Studios', '1C Company']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n genre_name text, -- example: ['Platform', 'Action', 'Adventure']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n platform_name text, -- example: ['DS', 'Wii', 'NES']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n num_sales real, -- number sales, example: [3.5, 1.43]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nother regions refers to region_name = 'Other'; positive sales refers to num_sales > 0; DS platform refers to platform_name = 'DS';\nHow many times did other regions make positive sales in DS platform?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"role": "user"
}
] | nl2sql | {
"ground_truth": "SELECT COUNT(DISTINCT T2.id) FROM platform AS T1 INNER JOIN game_platform AS T2 ON T1.id = T2.platform_id INNER JOIN region_sales AS T3 ON T1.id = T3.game_platform_id INNER JOIN region AS T4 ON T3.region_id = T4.id WHERE T1.platform_name = 'DS' AND T4.region_name = 'Other' AND T3.num_sales > 0",
"style": "rule"
} | {
"db_id": "video_games.sqlite",
"gt_sql": "SELECT COUNT(DISTINCT T2.id) FROM platform AS T1 INNER JOIN game_platform AS T2 ON T1.id = T2.platform_id INNER JOIN region_sales AS T3 ON T1.id = T3.game_platform_id INNER JOIN region AS T4 ON T3.region_id = T4.id WHERE T1.platform_name = 'DS' AND T4.region_name = 'Other' AND T3.num_sales > 0",
"index": 1674,
"question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['2 Games in 1: Sonic Advance & ChuChu Roc', '2 Games in 1: Sonic Battle & ChuChu Rock']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n region_name text, -- example: ['Other', 'North America', 'Europe']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['10TACLE Studios', '1C Company']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n genre_name text, -- example: ['Platform', 'Action', 'Adventure']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n platform_name text, -- example: ['DS', 'Wii', 'NES']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n num_sales real, -- number sales, example: [3.5, 1.43]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nother regions refers to region_name = 'Other'; positive sales refers to num_sales > 0; DS platform refers to platform_name = 'DS';\nHow many times did other regions make positive sales in DS platform?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"split": "train"
} |
nl2sql | [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n region_name text, -- example: ['North America', 'Europe']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['10TACLE Studios', '1C Company']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n platform_name text, -- example: ['Wii', 'NES']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n num_sales real, -- number sales, example: [3.5, 1.43]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n genre_name text, -- example: ['Strategy', 'Action', 'Adventure']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['2 Games in 1: Sonic Advance & ChuChu Roc', '2 Games in 1: Sonic Battle & ChuChu Rock']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nstrategy games refers game_name WHERE genre_name = 'Strategy';\nHow many strategy games are there?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"role": "user"
}
] | nl2sql | {
"ground_truth": "SELECT COUNT(CASE WHEN T1.genre_name = 'Strategy' THEN T2.id ELSE NULL END) FROM genre AS T1 INNER JOIN game AS T2 ON T1.id = T2.genre_id",
"style": "rule"
} | {
"db_id": "video_games.sqlite",
"gt_sql": "SELECT COUNT(CASE WHEN T1.genre_name = 'Strategy' THEN T2.id ELSE NULL END) FROM genre AS T1 INNER JOIN game AS T2 ON T1.id = T2.genre_id",
"index": 1675,
"question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n region_name text, -- example: ['North America', 'Europe']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['10TACLE Studios', '1C Company']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n platform_name text, -- example: ['Wii', 'NES']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n num_sales real, -- number sales, example: [3.5, 1.43]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n genre_name text, -- example: ['Strategy', 'Action', 'Adventure']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['2 Games in 1: Sonic Advance & ChuChu Roc', '2 Games in 1: Sonic Battle & ChuChu Rock']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nstrategy games refers game_name WHERE genre_name = 'Strategy';\nHow many strategy games are there?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"split": "train"
} |
nl2sql | [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n genre_name text, -- example: ['Action', 'Adventure']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n region_name text, -- example: ['North America', 'Europe']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n platform_name text, -- example: ['Wii', 'NES']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n release_year integer, -- example: [2007, 2006]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n num_sales real, -- number sales, example: [3.5, 1.43]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['Overwatch', '2 Games in 1: Sonic Advance & ChuChu Roc', '2 Games in 1: Sonic Battle & ChuChu Rock']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['10TACLE Studios', '1C Company']\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nwhich publisher refers to publisher_name; Overwatch refers to game_name = 'Overwatch';\nWhich publisher published Overwatch?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"role": "user"
}
] | nl2sql | {
"ground_truth": "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 = 'Overwatch'",
"style": "rule"
} | {
"db_id": "video_games.sqlite",
"gt_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 = 'Overwatch'",
"index": 1676,
"question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n genre_name text, -- example: ['Action', 'Adventure']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n region_name text, -- example: ['North America', 'Europe']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n platform_name text, -- example: ['Wii', 'NES']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n release_year integer, -- example: [2007, 2006]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n num_sales real, -- number sales, example: [3.5, 1.43]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['Overwatch', '2 Games in 1: Sonic Advance & ChuChu Roc', '2 Games in 1: Sonic Battle & ChuChu Rock']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['10TACLE Studios', '1C Company']\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nwhich publisher refers to publisher_name; Overwatch refers to game_name = 'Overwatch';\nWhich publisher published Overwatch?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"split": "train"
} |
nl2sql | [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n genre_name text, -- example: ['Action', 'Adventure']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['10TACLE Studios', '1C Company']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['2 Games in 1: Sonic Advance & ChuChu Roc', '2 Games in 1: Sonic Battle & ChuChu Rock']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n num_sales real, -- number sales, example: [3.5, 1.43]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nname of the genre refers to genre_name; genre with the most number of video games refers to MAX(COUNT(genre_name));\nWhat is the name of the genre with the most number of video games?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"role": "user"
}
] | nl2sql | {
"ground_truth": "SELECT T2.genre_name FROM game AS T1 INNER JOIN genre AS T2 ON T2.id = T1.genre_id GROUP BY T2.genre_name ORDER BY COUNT(T1.genre_id) DESC LIMIT 1",
"style": "rule"
} | {
"db_id": "video_games.sqlite",
"gt_sql": "SELECT T2.genre_name FROM game AS T1 INNER JOIN genre AS T2 ON T2.id = T1.genre_id GROUP BY T2.genre_name ORDER BY COUNT(T1.genre_id) DESC LIMIT 1",
"index": 1677,
"question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n genre_name text, -- example: ['Action', 'Adventure']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['10TACLE Studios', '1C Company']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['2 Games in 1: Sonic Advance & ChuChu Roc', '2 Games in 1: Sonic Battle & ChuChu Rock']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n num_sales real, -- number sales, example: [3.5, 1.43]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nname of the genre refers to genre_name; genre with the most number of video games refers to MAX(COUNT(genre_name));\nWhat is the name of the genre with the most number of video games?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"split": "train"
} |
nl2sql | [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['10TACLE Studios', '1C Company']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n genre_name text, -- example: ['Action', 'Adventure']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n num_sales real, -- number sales, example: [3.5, 1.43]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\npublishers that have the word 'Entertainment' in their name refers to publisher_name LIKE '%Entertainment%';\nWhat publishers have the word 'Entertainment' in their name?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"role": "user"
}
] | nl2sql | {
"ground_truth": "SELECT T.publisher_name FROM publisher AS T WHERE T.publisher_name LIKE '%Entertainment%'",
"style": "rule"
} | {
"db_id": "video_games.sqlite",
"gt_sql": "SELECT T.publisher_name FROM publisher AS T WHERE T.publisher_name LIKE '%Entertainment%'",
"index": 1678,
"question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['10TACLE Studios', '1C Company']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n genre_name text, -- example: ['Action', 'Adventure']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n num_sales real, -- number sales, example: [3.5, 1.43]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\npublishers that have the word 'Entertainment' in their name refers to publisher_name LIKE '%Entertainment%';\nWhat publishers have the word 'Entertainment' in their name?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"split": "train"
} |
nl2sql | [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n release_year integer, -- example: [2007, 2006]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n region_name text, -- example: ['North America', 'Europe']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n num_sales real, -- number sales, example: [3.5, 1.43]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['2 Games in 1: Sonic Advance & ChuChu Roc', '2 Games in 1: Sonic Battle & ChuChu Rock']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['Pioneer LDC', '10TACLE Studios', '1C Company']\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nname of games refers to game_name; 'Pioneer LDC' refers to publisher_name = 'Pioneer LDC';\nList the name of all games published by 'Pioneer LDC'.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"role": "user"
}
] | nl2sql | {
"ground_truth": "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 = 'Pioneer LDC'",
"style": "rule"
} | {
"db_id": "video_games.sqlite",
"gt_sql": "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 = 'Pioneer LDC'",
"index": 1679,
"question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n release_year integer, -- example: [2007, 2006]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n region_name text, -- example: ['North America', 'Europe']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n num_sales real, -- number sales, example: [3.5, 1.43]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['2 Games in 1: Sonic Advance & ChuChu Roc', '2 Games in 1: Sonic Battle & ChuChu Rock']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['Pioneer LDC', '10TACLE Studios', '1C Company']\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nname of games refers to game_name; 'Pioneer LDC' refers to publisher_name = 'Pioneer LDC';\nList the name of all games published by 'Pioneer LDC'.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"split": "train"
} |
nl2sql | [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['10TACLE Studios', '1C Company']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n platform_name text, -- example: ['SCD', 'Wii', 'NES']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n genre_name text, -- example: ['Platform', 'Action', 'Adventure']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['2 Games in 1: Sonic Advance & ChuChu Roc', '2 Games in 1: Sonic Battle & ChuChu Rock']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n num_sales real, -- number sales, example: [3.5, 1.43]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nname of games refers to game_name; 'SCD' platform refers to platform_name = 'SCD';\nIndicate the name of all the games published for the 'SCD' platform.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"role": "user"
}
] | nl2sql | {
"ground_truth": "SELECT T1.game_name FROM game AS T1 INNER JOIN game_publisher AS T2 ON T1.id = T2.game_id INNER JOIN game_platform AS T3 ON T2.id = T3.game_publisher_id INNER JOIN platform AS T4 ON T3.platform_id = T4.id WHERE T4.platform_name = 'SCD'",
"style": "rule"
} | {
"db_id": "video_games.sqlite",
"gt_sql": "SELECT T1.game_name FROM game AS T1 INNER JOIN game_publisher AS T2 ON T1.id = T2.game_id INNER JOIN game_platform AS T3 ON T2.id = T3.game_publisher_id INNER JOIN platform AS T4 ON T3.platform_id = T4.id WHERE T4.platform_name = 'SCD'",
"index": 1680,
"question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['10TACLE Studios', '1C Company']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n platform_name text, -- example: ['SCD', 'Wii', 'NES']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n genre_name text, -- example: ['Platform', 'Action', 'Adventure']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['2 Games in 1: Sonic Advance & ChuChu Roc', '2 Games in 1: Sonic Battle & ChuChu Rock']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n num_sales real, -- number sales, example: [3.5, 1.43]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nname of games refers to game_name; 'SCD' platform refers to platform_name = 'SCD';\nIndicate the name of all the games published for the 'SCD' platform.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"split": "train"
} |
nl2sql | [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n region_name text, -- example: ['North America', 'Europe']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n release_year integer, -- example: [2007, 2006]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n num_sales real, -- number sales, example: [3.5, 1.43]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['10TACLE Studios', '1C Company']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n genre_name text, -- example: ['Role-Playing', 'Simulation', 'Shooter', 'Action', 'Adventure']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n platform_name text, -- example: ['Wii', 'NES']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['2 Games in 1: Sonic Advance & ChuChu Roc', '2 Games in 1: Sonic Battle & ChuChu Rock']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nnot of the genres 'Role-Playing', 'Shooter' and 'Simulation' refers to genre_name NOT IN ('Role-Playing', 'Shooter', 'Simulation');\nHow many games are not of the genres 'Role-Playing', 'Shooter' and 'Simulation'?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"role": "user"
}
] | nl2sql | {
"ground_truth": "SELECT COUNT(T2.id) FROM genre AS T1 INNER JOIN game AS T2 ON T1.id = T2.genre_id WHERE T1.genre_name NOT IN ('Role-Playing', 'Shooter', 'Simulation')",
"style": "rule"
} | {
"db_id": "video_games.sqlite",
"gt_sql": "SELECT COUNT(T2.id) FROM genre AS T1 INNER JOIN game AS T2 ON T1.id = T2.genre_id WHERE T1.genre_name NOT IN ('Role-Playing', 'Shooter', 'Simulation')",
"index": 1681,
"question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n region_name text, -- example: ['North America', 'Europe']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n release_year integer, -- example: [2007, 2006]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n num_sales real, -- number sales, example: [3.5, 1.43]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['10TACLE Studios', '1C Company']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n genre_name text, -- example: ['Role-Playing', 'Simulation', 'Shooter', 'Action', 'Adventure']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n platform_name text, -- example: ['Wii', 'NES']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['2 Games in 1: Sonic Advance & ChuChu Roc', '2 Games in 1: Sonic Battle & ChuChu Rock']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nnot of the genres 'Role-Playing', 'Shooter' and 'Simulation' refers to genre_name NOT IN ('Role-Playing', 'Shooter', 'Simulation');\nHow many games are not of the genres 'Role-Playing', 'Shooter' and 'Simulation'?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"split": "train"
} |
nl2sql | [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n release_year integer, -- example: [2007, 2006]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n platform_name text, -- example: ['Wii', 'NES']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n num_sales real, -- number sales, example: [3.5, 1.43]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['10TACLE Studios', '1C Company']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n region_name text, -- example: ['North America', 'Europe']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['2 Games in 1: Sonic Advance & ChuChu Roc', '2 Games in 1: Sonic Battle & ChuChu Rock']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nregion refers to region_name; platform refers to game_platform; sold the most games refers to MAX(SUM(num_sales));\nIndicate, by region, which platform has sold the most games.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"role": "user"
}
] | nl2sql | {
"ground_truth": "SELECT T.region_name FROM ( SELECT T1.platform_name, T4.region_name, SUM(T3.num_sales) FROM platform AS T1 INNER JOIN game_platform AS T2 ON T1.id = T2.platform_id INNER JOIN region_sales AS T3 ON T1.id = T3.game_platform_id INNER JOIN region AS T4 ON T3.region_id = T4.id GROUP BY T1.platform_name, T4.region_name ORDER BY SUM(T3.num_sales) DESC LIMIT 1 ) t",
"style": "rule"
} | {
"db_id": "video_games.sqlite",
"gt_sql": "SELECT T.region_name FROM ( SELECT T1.platform_name, T4.region_name, SUM(T3.num_sales) FROM platform AS T1 INNER JOIN game_platform AS T2 ON T1.id = T2.platform_id INNER JOIN region_sales AS T3 ON T1.id = T3.game_platform_id INNER JOIN region AS T4 ON T3.region_id = T4.id GROUP BY T1.platform_name, T4.region_name ORDER BY SUM(T3.num_sales) DESC LIMIT 1 ) t",
"index": 1682,
"question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n release_year integer, -- example: [2007, 2006]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n platform_name text, -- example: ['Wii', 'NES']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n num_sales real, -- number sales, example: [3.5, 1.43]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['10TACLE Studios', '1C Company']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n region_name text, -- example: ['North America', 'Europe']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['2 Games in 1: Sonic Advance & ChuChu Roc', '2 Games in 1: Sonic Battle & ChuChu Rock']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nregion refers to region_name; platform refers to game_platform; sold the most games refers to MAX(SUM(num_sales));\nIndicate, by region, which platform has sold the most games.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"split": "train"
} |
nl2sql | [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n platform_name text, -- example: ['Wii', 'NES']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['10TACLE Studios', '1C Company']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['2 Games in 1: Sonic Advance & ChuChu Roc', '2 Games in 1: Sonic Battle & ChuChu Rock']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n num_sales real, -- number sales, example: [3.5, 1.43]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n release_year integer, -- example: [2007, 2006]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n region_name text, -- example: ['North America', 'Europe']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nwhich game refers to game_name; sold the fewest units refers to MIN(num_sales);\nWhich game has sold the fewest units?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"role": "user"
}
] | nl2sql | {
"ground_truth": "SELECT T.game_name FROM ( SELECT T1.game_name FROM game AS T1 INNER JOIN game_publisher AS T2 ON T1.id = T2.game_id INNER JOIN game_platform AS T3 ON T2.id = T3.game_publisher_id INNER JOIN region_sales AS T4 ON T3.id = T4.game_platform_id ORDER BY T4.num_sales LIMIT 1 ) t",
"style": "rule"
} | {
"db_id": "video_games.sqlite",
"gt_sql": "SELECT T.game_name FROM ( SELECT T1.game_name FROM game AS T1 INNER JOIN game_publisher AS T2 ON T1.id = T2.game_id INNER JOIN game_platform AS T3 ON T2.id = T3.game_publisher_id INNER JOIN region_sales AS T4 ON T3.id = T4.game_platform_id ORDER BY T4.num_sales LIMIT 1 ) t",
"index": 1683,
"question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n platform_name text, -- example: ['Wii', 'NES']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['10TACLE Studios', '1C Company']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['2 Games in 1: Sonic Advance & ChuChu Roc', '2 Games in 1: Sonic Battle & ChuChu Rock']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n num_sales real, -- number sales, example: [3.5, 1.43]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n release_year integer, -- example: [2007, 2006]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n region_name text, -- example: ['North America', 'Europe']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nwhich game refers to game_name; sold the fewest units refers to MIN(num_sales);\nWhich game has sold the fewest units?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"split": "train"
} |
nl2sql | [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n num_sales real, -- number sales, example: [3.5, 1.43]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n release_year integer, -- example: [2007, 2006]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['2 Games in 1: Sonic Advance & ChuChu Roc', '2 Games in 1: Sonic Battle & ChuChu Rock']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['10TACLE Studios', '1C Company']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n genre_name text, -- example: ['Action', 'Adventure']\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nwhich publisher refers to publisher_name; 'Pachi-Slot Kanzen Kouryaku 3: Universal Koushiki Gaido Volume 3' refers to game_name = 'Pachi-Slot Kanzen Kouryaku 3: Universal Koushiki Gaido Volume 3';\nWhich publisher has published the game 'Pachi-Slot Kanzen Kouryaku 3: Universal Koushiki Gaido Volume 3'?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"role": "user"
}
] | nl2sql | {
"ground_truth": "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 = 'Pachi-Slot Kanzen Kouryaku 3: Universal Koushiki Gaido Volume 3'",
"style": "rule"
} | {
"db_id": "video_games.sqlite",
"gt_sql": "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 = 'Pachi-Slot Kanzen Kouryaku 3: Universal Koushiki Gaido Volume 3'",
"index": 1684,
"question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n num_sales real, -- number sales, example: [3.5, 1.43]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n release_year integer, -- example: [2007, 2006]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['2 Games in 1: Sonic Advance & ChuChu Roc', '2 Games in 1: Sonic Battle & ChuChu Rock']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['10TACLE Studios', '1C Company']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n genre_name text, -- example: ['Action', 'Adventure']\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nwhich publisher refers to publisher_name; 'Pachi-Slot Kanzen Kouryaku 3: Universal Koushiki Gaido Volume 3' refers to game_name = 'Pachi-Slot Kanzen Kouryaku 3: Universal Koushiki Gaido Volume 3';\nWhich publisher has published the game 'Pachi-Slot Kanzen Kouryaku 3: Universal Koushiki Gaido Volume 3'?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"split": "train"
} |
nl2sql | [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n num_sales real, -- number sales, example: [3.5, 1.43]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n platform_name text, -- example: ['PS2', 'Wii', 'NES']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\naverage = AVG(MULTIPLY(num_sales), 100000); PS2 refers to platform_name = 'PS2';\nCalculate the average game sales for the PS2 platform.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"role": "user"
}
] | nl2sql | {
"ground_truth": "SELECT SUM(T3.num_sales * 100000) / COUNT(T1.id) FROM platform AS T1 INNER JOIN game_platform AS T2 ON T1.id = T2.platform_id INNER JOIN region_sales AS T3 ON T2.id = T3.game_platform_id WHERE T1.platform_name = 'PS2'",
"style": "rule"
} | {
"db_id": "video_games.sqlite",
"gt_sql": "SELECT SUM(T3.num_sales * 100000) / COUNT(T1.id) FROM platform AS T1 INNER JOIN game_platform AS T2 ON T1.id = T2.platform_id INNER JOIN region_sales AS T3 ON T2.id = T3.game_platform_id WHERE T1.platform_name = 'PS2'",
"index": 1685,
"question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n num_sales real, -- number sales, example: [3.5, 1.43]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n platform_name text, -- example: ['PS2', 'Wii', 'NES']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\naverage = AVG(MULTIPLY(num_sales), 100000); PS2 refers to platform_name = 'PS2';\nCalculate the average game sales for the PS2 platform.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"split": "train"
} |
nl2sql | [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n num_sales real, -- number sales, example: [3.5, 1.43]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n release_year integer, -- example: [2007, 2006]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n platform_name text, -- example: ['Wii', 'NES']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n genre_name text, -- example: ['Action', 'Adventure']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['10TACLE Studios', '1C Company']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\ntotal number of games sold = MULTIPLY(SUM(num_sales), 100000);\nWhat is the total number of games sold in region ID 1?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"role": "user"
}
] | nl2sql | {
"ground_truth": "SELECT SUM(T.num_sales * 100000) FROM region_sales AS T WHERE T.region_id = 1",
"style": "rule"
} | {
"db_id": "video_games.sqlite",
"gt_sql": "SELECT SUM(T.num_sales * 100000) FROM region_sales AS T WHERE T.region_id = 1",
"index": 1686,
"question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n num_sales real, -- number sales, example: [3.5, 1.43]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n release_year integer, -- example: [2007, 2006]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n platform_name text, -- example: ['Wii', 'NES']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n genre_name text, -- example: ['Action', 'Adventure']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['10TACLE Studios', '1C Company']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\ntotal number of games sold = MULTIPLY(SUM(num_sales), 100000);\nWhat is the total number of games sold in region ID 1?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"split": "train"
} |
nl2sql | [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n region_name text, -- example: ['North America', 'Europe']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['2 Games in 1: Sonic Advance & ChuChu Roc', '2 Games in 1: Sonic Battle & ChuChu Rock']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nFIFA games refers to game_name LIKE '%FIFA%';\nHow many FIFA games are there across all platforms?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"role": "user"
}
] | nl2sql | {
"ground_truth": "SELECT COUNT(*) FROM ( SELECT T.game_name FROM game AS T WHERE T.game_name LIKE '%FIFA%' )",
"style": "rule"
} | {
"db_id": "video_games.sqlite",
"gt_sql": "SELECT COUNT(*) FROM ( SELECT T.game_name FROM game AS T WHERE T.game_name LIKE '%FIFA%' )",
"index": 1687,
"question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n region_name text, -- example: ['North America', 'Europe']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['2 Games in 1: Sonic Advance & ChuChu Roc', '2 Games in 1: Sonic Battle & ChuChu Rock']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nFIFA games refers to game_name LIKE '%FIFA%';\nHow many FIFA games are there across all platforms?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"split": "train"
} |
nl2sql | [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n platform_name text, -- example: ['Wii', 'NES']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n region_name text, -- example: ['Europe', 'North America']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n num_sales real, -- number sales, example: [3.5, 1.43]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nplatform that is the most popular refers to platform_name WHERE MAX(num_sales); in Europe refers to region_name = 'Europe' ;\nWhich platform is the most popular in Europe?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"role": "user"
}
] | nl2sql | {
"ground_truth": "SELECT T.platform_name FROM ( SELECT T4.platform_name FROM region AS T1 INNER JOIN region_sales AS T2 ON T1.id = T2.region_id INNER JOIN game_platform AS T3 ON T2.game_platform_id = T3.id INNER JOIN platform AS T4 ON T3.platform_id = T4.id WHERE T1.region_name = 'Europe' ORDER BY T2.num_sales DESC LIMIT 1 ) t",
"style": "rule"
} | {
"db_id": "video_games.sqlite",
"gt_sql": "SELECT T.platform_name FROM ( SELECT T4.platform_name FROM region AS T1 INNER JOIN region_sales AS T2 ON T1.id = T2.region_id INNER JOIN game_platform AS T3 ON T2.game_platform_id = T3.id INNER JOIN platform AS T4 ON T3.platform_id = T4.id WHERE T1.region_name = 'Europe' ORDER BY T2.num_sales DESC LIMIT 1 ) t",
"index": 1688,
"question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n platform_name text, -- example: ['Wii', 'NES']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n region_name text, -- example: ['Europe', 'North America']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n num_sales real, -- number sales, example: [3.5, 1.43]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nplatform that is the most popular refers to platform_name WHERE MAX(num_sales); in Europe refers to region_name = 'Europe' ;\nWhich platform is the most popular in Europe?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"split": "train"
} |
nl2sql | [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n region_name text, -- example: ['North America', 'Europe']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n genre_name text, -- example: ['Platform', 'Action', 'Adventure']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n num_sales real, -- number sales, example: [3.5, 1.43]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n release_year integer, -- example: [2007, 2006]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n platform_name text, -- example: ['Wii', 'NES']\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nwhich region refers to region_name; highest number of games sold on all platforms refers to MAX(SUM(num_sales));\nWhich region has the highest number of games sold on all platforms?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"role": "user"
}
] | nl2sql | {
"ground_truth": "SELECT T.region_name FROM ( SELECT T2.region_name, SUM(T1.num_sales) FROM region_sales AS T1 INNER JOIN region AS T2 ON T1.region_id = T2.id INNER JOIN game_platform AS T3 ON T1.game_platform_id = T3.id INNER JOIN platform AS T4 ON T3.platform_id = T4.id GROUP BY T4.platform_name ORDER BY SUM(T1.num_sales) DESC LIMIT 1 ) t",
"style": "rule"
} | {
"db_id": "video_games.sqlite",
"gt_sql": "SELECT T.region_name FROM ( SELECT T2.region_name, SUM(T1.num_sales) FROM region_sales AS T1 INNER JOIN region AS T2 ON T1.region_id = T2.id INNER JOIN game_platform AS T3 ON T1.game_platform_id = T3.id INNER JOIN platform AS T4 ON T3.platform_id = T4.id GROUP BY T4.platform_name ORDER BY SUM(T1.num_sales) DESC LIMIT 1 ) t",
"index": 1689,
"question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n region_name text, -- example: ['North America', 'Europe']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n genre_name text, -- example: ['Platform', 'Action', 'Adventure']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n num_sales real, -- number sales, example: [3.5, 1.43]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n release_year integer, -- example: [2007, 2006]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n platform_name text, -- example: ['Wii', 'NES']\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nwhich region refers to region_name; highest number of games sold on all platforms refers to MAX(SUM(num_sales));\nWhich region has the highest number of games sold on all platforms?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"split": "train"
} |
nl2sql | [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n num_sales real, -- number sales, example: [3.5, 1.43]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n region_name text, -- example: ['Japan', 'North America', 'Europe']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n platform_name text, -- example: ['PS3', 'Wii', 'NES']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nhow many games = MULTIPLY(SUM(num_sales), 100000); PS3 refers to platform_name = 'PS3'; Japan refers to region_name = 'Japan';\nHow many games were sold on PS3 platform in Japan?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"role": "user"
}
] | nl2sql | {
"ground_truth": "SELECT SUM(T1.num_sales * 100000) FROM region_sales AS T1 INNER JOIN region AS T2 ON T1.region_id = T2.id INNER JOIN game_platform AS T3 ON T1.game_platform_id = T3.id INNER JOIN platform AS T4 ON T3.platform_id = T4.id WHERE T2.region_name = 'Japan' AND T4.platform_name = 'PS3'",
"style": "rule"
} | {
"db_id": "video_games.sqlite",
"gt_sql": "SELECT SUM(T1.num_sales * 100000) FROM region_sales AS T1 INNER JOIN region AS T2 ON T1.region_id = T2.id INNER JOIN game_platform AS T3 ON T1.game_platform_id = T3.id INNER JOIN platform AS T4 ON T3.platform_id = T4.id WHERE T2.region_name = 'Japan' AND T4.platform_name = 'PS3'",
"index": 1690,
"question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n num_sales real, -- number sales, example: [3.5, 1.43]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n region_name text, -- example: ['Japan', 'North America', 'Europe']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n platform_name text, -- example: ['PS3', 'Wii', 'NES']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nhow many games = MULTIPLY(SUM(num_sales), 100000); PS3 refers to platform_name = 'PS3'; Japan refers to region_name = 'Japan';\nHow many games were sold on PS3 platform in Japan?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"split": "train"
} |
nl2sql | [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['10TACLE Studios', '1C Company']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n platform_name text, -- example: ['PS3', 'Wii', 'NES']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n region_name text, -- example: ['North America', 'Europe']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n release_year integer, -- example: [2007, 2006]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nin 2010 refers to release_year = 2010; PS3 refers to platform_name = 'PS3';\nIn 2010, how many PS3 games were released?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"role": "user"
}
] | nl2sql | {
"ground_truth": "SELECT COUNT(T3.game_id) FROM platform AS T1 INNER JOIN game_platform AS T2 ON T1.id = T2.platform_id INNER JOIN game_publisher AS T3 ON T2.game_publisher_id = T3.id WHERE T1.platform_name = 'PS3' AND T2.release_year = 2010",
"style": "rule"
} | {
"db_id": "video_games.sqlite",
"gt_sql": "SELECT COUNT(T3.game_id) FROM platform AS T1 INNER JOIN game_platform AS T2 ON T1.id = T2.platform_id INNER JOIN game_publisher AS T3 ON T2.game_publisher_id = T3.id WHERE T1.platform_name = 'PS3' AND T2.release_year = 2010",
"index": 1691,
"question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['10TACLE Studios', '1C Company']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n platform_name text, -- example: ['PS3', 'Wii', 'NES']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n region_name text, -- example: ['North America', 'Europe']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n release_year integer, -- example: [2007, 2006]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nin 2010 refers to release_year = 2010; PS3 refers to platform_name = 'PS3';\nIn 2010, how many PS3 games were released?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"split": "train"
} |
nl2sql | [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['2 Games in 1: Sonic Advance & ChuChu Roc', '2 Games in 1: Sonic Battle & ChuChu Rock']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n genre_name text, -- example: ['Shooter', 'Action', 'Adventure']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n platform_name text, -- example: ['Wii', 'NES']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n release_year integer, -- example: [2007, 2006]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nshooter games refers to game_name WHERE genre_name = 'shooter';\nHow many shooter games are there?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"role": "user"
}
] | nl2sql | {
"ground_truth": "SELECT COUNT(T1.id) FROM game AS T1 INNER JOIN genre AS T2 ON T1.genre_id = T2.id WHERE T2.genre_name = 'Shooter'",
"style": "rule"
} | {
"db_id": "video_games.sqlite",
"gt_sql": "SELECT COUNT(T1.id) FROM game AS T1 INNER JOIN genre AS T2 ON T1.genre_id = T2.id WHERE T2.genre_name = 'Shooter'",
"index": 1692,
"question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['2 Games in 1: Sonic Advance & ChuChu Roc', '2 Games in 1: Sonic Battle & ChuChu Rock']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n genre_name text, -- example: ['Shooter', 'Action', 'Adventure']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n platform_name text, -- example: ['Wii', 'NES']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n release_year integer, -- example: [2007, 2006]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nshooter games refers to game_name WHERE genre_name = 'shooter';\nHow many shooter games are there?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"split": "train"
} |
nl2sql | [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n genre_name text, -- example: ['Platform', 'Action', 'Adventure']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n release_year integer, -- example: [2007, 2006]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nreleased in 2007 refers to release_year = 2007;\nList down the platform IDs of the games released in 2007.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"role": "user"
}
] | nl2sql | {
"ground_truth": "SELECT DISTINCT T.platform_id FROM game_platform AS T WHERE T.release_year = 2007",
"style": "rule"
} | {
"db_id": "video_games.sqlite",
"gt_sql": "SELECT DISTINCT T.platform_id FROM game_platform AS T WHERE T.release_year = 2007",
"index": 1693,
"question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n genre_name text, -- example: ['Platform', 'Action', 'Adventure']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n release_year integer, -- example: [2007, 2006]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nreleased in 2007 refers to release_year = 2007;\nList down the platform IDs of the games released in 2007.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"split": "train"
} |
nl2sql | [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n genre_name text, -- example: ['Platform', 'Action', 'Adventure']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['2 Games in 1: Sonic Advance & ChuChu Roc', '2 Games in 1: Sonic Battle & ChuChu Rock']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n region_name text, -- example: ['North America', 'Europe']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n num_sales real, -- number sales, example: [3.5, 1.43]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nState the game publisher IDs of the games with a platform ID of 16.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"role": "user"
}
] | nl2sql | {
"ground_truth": "SELECT T.game_publisher_id FROM game_platform AS T WHERE T.platform_id = 16",
"style": "rule"
} | {
"db_id": "video_games.sqlite",
"gt_sql": "SELECT T.game_publisher_id FROM game_platform AS T WHERE T.platform_id = 16",
"index": 1694,
"question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n genre_name text, -- example: ['Platform', 'Action', 'Adventure']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['2 Games in 1: Sonic Advance & ChuChu Roc', '2 Games in 1: Sonic Battle & ChuChu Rock']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n region_name text, -- example: ['North America', 'Europe']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n num_sales real, -- number sales, example: [3.5, 1.43]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nState the game publisher IDs of the games with a platform ID of 16.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"split": "train"
} |
nl2sql | [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n region_name text, -- example: ['Japan', 'North America', 'Europe']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n genre_name text, -- example: ['Action', 'Adventure']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n num_sales real, -- number sales, example: [3.5, 1.43]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nsales = SUM(num_sales); Japan region refers to region_name = 'Japan';\nWhat are the sales made by the games in Japan region?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"role": "user"
}
] | nl2sql | {
"ground_truth": "SELECT SUM(CASE WHEN T2.region_name = 'Japan' THEN T1.num_sales ELSE 0 END) AS nums FROM region_sales AS T1 INNER JOIN region AS T2 ON T1.region_id = T2.id",
"style": "rule"
} | {
"db_id": "video_games.sqlite",
"gt_sql": "SELECT SUM(CASE WHEN T2.region_name = 'Japan' THEN T1.num_sales ELSE 0 END) AS nums FROM region_sales AS T1 INNER JOIN region AS T2 ON T1.region_id = T2.id",
"index": 1695,
"question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n region_name text, -- example: ['Japan', 'North America', 'Europe']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n genre_name text, -- example: ['Action', 'Adventure']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n num_sales real, -- number sales, example: [3.5, 1.43]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nsales = SUM(num_sales); Japan region refers to region_name = 'Japan';\nWhat are the sales made by the games in Japan region?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"split": "train"
} |
nl2sql | [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n release_year integer, -- example: [2007, 2006]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n region_name text, -- example: ['North America', 'Europe']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n num_sales real, -- number sales, example: [3.5, 1.43]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n platform_name text, -- example: ['Wii', 'NES']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['Sony Computer Entertainment', 'Capcom', '10TACLE Studios', '1C Company']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nCapcom refers to publisher_name = 'Capcom'; Sony Computer Entertainment refers to publisher_name = 'Sony Computer Entertainment';\nCalculate the total number of IDs for the game published by Capcom and Sony Computer Entertainment.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"role": "user"
}
] | nl2sql | {
"ground_truth": "SELECT COUNT(DISTINCT T1.game_id) FROM game_publisher AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.id WHERE T2.publisher_name IN ('Capcom', 'Sony Computer Entertainment')",
"style": "rule"
} | {
"db_id": "video_games.sqlite",
"gt_sql": "SELECT COUNT(DISTINCT T1.game_id) FROM game_publisher AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.id WHERE T2.publisher_name IN ('Capcom', 'Sony Computer Entertainment')",
"index": 1696,
"question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n release_year integer, -- example: [2007, 2006]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n region_name text, -- example: ['North America', 'Europe']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n num_sales real, -- number sales, example: [3.5, 1.43]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n platform_name text, -- example: ['Wii', 'NES']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['Sony Computer Entertainment', 'Capcom', '10TACLE Studios', '1C Company']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nCapcom refers to publisher_name = 'Capcom'; Sony Computer Entertainment refers to publisher_name = 'Sony Computer Entertainment';\nCalculate the total number of IDs for the game published by Capcom and Sony Computer Entertainment.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"split": "train"
} |
nl2sql | [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n genre_name text, -- example: ['Racing', 'Action', 'Adventure']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['10TACLE Studios', '1C Company']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n platform_name text, -- example: ['Wii', 'NES']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['2 Games in 1: Sonic Advance & ChuChu Roc', '2 Games in 1: Sonic Battle & ChuChu Rock']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nname of games refers to game_name; racing genre refers to genre_name = 'Racing';\nList down the names of the games in the racing genre.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"role": "user"
}
] | nl2sql | {
"ground_truth": "SELECT T1.game_name FROM game AS T1 INNER JOIN genre AS T2 ON T1.genre_id = T2.id WHERE T2.genre_name = 'Racing'",
"style": "rule"
} | {
"db_id": "video_games.sqlite",
"gt_sql": "SELECT T1.game_name FROM game AS T1 INNER JOIN genre AS T2 ON T1.genre_id = T2.id WHERE T2.genre_name = 'Racing'",
"index": 1697,
"question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n genre_name text, -- example: ['Racing', 'Action', 'Adventure']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['10TACLE Studios', '1C Company']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n platform_name text, -- example: ['Wii', 'NES']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['2 Games in 1: Sonic Advance & ChuChu Roc', '2 Games in 1: Sonic Battle & ChuChu Rock']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nname of games refers to game_name; racing genre refers to genre_name = 'Racing';\nList down the names of the games in the racing genre.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"split": "train"
} |
nl2sql | [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n num_sales real, -- number sales, example: [3.5, 1.43]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['10TACLE Studios', '1C Company']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n region_name text, -- example: ['North America', 'Europe']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n genre_name text, -- example: ['Fighting', 'Action', 'Adventure']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['2 Games in 1: Sonic Advance & ChuChu Roc', '2 Games in 1: Sonic Battle & ChuChu Rock']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n release_year integer, -- example: [2007, 2006]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nfighting genre refers to genre_name = 'Fighting';\nCalculate the number of games in the fighting genre.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"role": "user"
}
] | nl2sql | {
"ground_truth": "SELECT COUNT(T1.id) FROM game AS T1 INNER JOIN genre AS T2 ON T1.genre_id = T2.id WHERE T2.genre_name = 'Fighting'",
"style": "rule"
} | {
"db_id": "video_games.sqlite",
"gt_sql": "SELECT COUNT(T1.id) FROM game AS T1 INNER JOIN genre AS T2 ON T1.genre_id = T2.id WHERE T2.genre_name = 'Fighting'",
"index": 1698,
"question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n num_sales real, -- number sales, example: [3.5, 1.43]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n publisher_name text, -- example: ['10TACLE Studios', '1C Company']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n region_name text, -- example: ['North America', 'Europe']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n genre_name text, -- example: ['Fighting', 'Action', 'Adventure']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['2 Games in 1: Sonic Advance & ChuChu Roc', '2 Games in 1: Sonic Battle & ChuChu Rock']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n release_year integer, -- example: [2007, 2006]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nfighting genre refers to genre_name = 'Fighting';\nCalculate the number of games in the fighting genre.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"split": "train"
} |
nl2sql | [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n num_sales real, -- number sales, example: [3.5, 1.43]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['2 Games in 1: Sonic Advance & ChuChu Roc', '2 Games in 1: Sonic Battle & ChuChu Rock']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n release_year integer, -- example: [2007, 2006]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\ndifference = SUBTRACT(SUM(num_sales WHERE release_year = 2000), SUM(num_sales WHERE release_year = 1990));\nCalculate the difference in sales between the games released in 1990 and 2000.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"role": "user"
}
] | nl2sql | {
"ground_truth": "SELECT SUM(CASE WHEN T2.release_year = 2000 THEN T1.num_sales ELSE 0 END) - SUM(CASE WHEN T2.release_year = 1990 THEN T1.num_sales ELSE 0 END) FROM region_sales AS T1 INNER JOIN game_platform AS T2 ON T1.game_platform_id = T2.id",
"style": "rule"
} | {
"db_id": "video_games.sqlite",
"gt_sql": "SELECT SUM(CASE WHEN T2.release_year = 2000 THEN T1.num_sales ELSE 0 END) - SUM(CASE WHEN T2.release_year = 1990 THEN T1.num_sales ELSE 0 END) FROM region_sales AS T1 INNER JOIN game_platform AS T2 ON T1.game_platform_id = T2.id",
"index": 1699,
"question": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE platform (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_publisher (\n id integer, -- example: [1, 2]\n game_id integer, -- example: [10866, 9244]\n publisher_id integer, -- example: [369, 328]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_publisher_game_id FOREIGN KEY (game_id) REFERENCES game (id),\n CONSTRAINT fk_game_publisher_publisher_id FOREIGN KEY (publisher_id) REFERENCES publisher (id)\n);\n\nCREATE TABLE publisher (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE region_sales (\n region_id integer, -- example: [1, 2]\n game_platform_id integer, -- example: [50, 51]\n num_sales real, -- number sales, example: [3.5, 1.43]\n CONSTRAINT fk_region_sales_region_id FOREIGN KEY (region_id) REFERENCES region (id),\n CONSTRAINT fk_region_sales_game_platform_id FOREIGN KEY (game_platform_id) REFERENCES game_platform (id)\n);\n\nCREATE TABLE genre (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game (\n id integer, -- example: [44, 45]\n genre_id integer, -- example: [4, 5]\n game_name text, -- example: ['2 Games in 1: Sonic Advance & ChuChu Roc', '2 Games in 1: Sonic Battle & ChuChu Rock']\n PRIMARY KEY (id),\n CONSTRAINT fk_game_genre_id FOREIGN KEY (genre_id) REFERENCES genre (id)\n);\n\nCREATE TABLE region (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE game_platform (\n id integer, -- example: [1, 2]\n game_publisher_id integer, -- example: [8564, 9852]\n platform_id integer, -- example: [4, 7]\n release_year integer, -- example: [2007, 2006]\n PRIMARY KEY (id),\n CONSTRAINT fk_game_platform_game_publisher_id FOREIGN KEY (game_publisher_id) REFERENCES game_publisher (id),\n CONSTRAINT fk_game_platform_platform_id FOREIGN KEY (platform_id) REFERENCES platform (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\ndifference = SUBTRACT(SUM(num_sales WHERE release_year = 2000), SUM(num_sales WHERE release_year = 1990));\nCalculate the difference in sales between the games released in 1990 and 2000.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"split": "train"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.