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 characters (\n id integer, -- example: [1, 2]\n CharName text, -- example: ['Third Servingman', 'First Apparition', 'First Citizen']\n Description text, -- example: ['a servingman', 'A senator of Venice', 'a Moor, beloved by Tamora']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE paragraphs (\n id integer, -- example: [630863, 630864]\n character_id integer, -- example: [1261, 840]\n chapter_id integer, -- example: [18704, 18705]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE chapters (\n id integer, -- example: [18704, 18705]\n Act integer, -- example: [1, 2]\n Description text, -- example: ['DUKE ORSINO’s palace.', 'The sea-coast.']\n work_id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE works (\n id integer, -- example: [1, 2]\n Title text, -- example: ['Twelfth Night', \"All's Well That Ends Well\"]\n LongTitle text, -- example: ['Twelfth Night, Or What You Will', \"All's Well That Ends Well\"]\n `Date` integer, -- character id, example: [1599, 1602]\n GenreType text, -- example: ['Comedy', 'Tragedy']\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:\nbetween 1600 to 1610 refers to DATE > = 1600 AND DATE < = 1610; \"Third Servingman\" refers to CharName = 'Third Servingman'\nIn Shakespeare's works between 1600 to 1610, how many of these have a character as a \"Third Servingman\"?\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.work_id) FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id INNER JOIN paragraphs AS T3 ON T2.id = T3.chapter_id INNER JOIN characters AS T4 ON T3.character_id = T4.id WHERE T1.DATE BETWEEN 1600 AND 1610 AND T4.CharName = 'Third Servingman'",
"style": "rule"
} | {
"db_id": "shakespeare.sqlite",
"gt_sql": "SELECT COUNT(DISTINCT T2.work_id) FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id INNER JOIN paragraphs AS T3 ON T2.id = T3.chapter_id INNER JOIN characters AS T4 ON T3.character_id = T4.id WHERE T1.DATE BETWEEN 1600 AND 1610 AND T4.CharName = 'Third Servingman'",
"index": 1500,
"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 characters (\n id integer, -- example: [1, 2]\n CharName text, -- example: ['Third Servingman', 'First Apparition', 'First Citizen']\n Description text, -- example: ['a servingman', 'A senator of Venice', 'a Moor, beloved by Tamora']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE paragraphs (\n id integer, -- example: [630863, 630864]\n character_id integer, -- example: [1261, 840]\n chapter_id integer, -- example: [18704, 18705]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE chapters (\n id integer, -- example: [18704, 18705]\n Act integer, -- example: [1, 2]\n Description text, -- example: ['DUKE ORSINO’s palace.', 'The sea-coast.']\n work_id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE works (\n id integer, -- example: [1, 2]\n Title text, -- example: ['Twelfth Night', \"All's Well That Ends Well\"]\n LongTitle text, -- example: ['Twelfth Night, Or What You Will', \"All's Well That Ends Well\"]\n `Date` integer, -- character id, example: [1599, 1602]\n GenreType text, -- example: ['Comedy', 'Tragedy']\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:\nbetween 1600 to 1610 refers to DATE > = 1600 AND DATE < = 1610; \"Third Servingman\" refers to CharName = 'Third Servingman'\nIn Shakespeare's works between 1600 to 1610, how many of these have a character as a \"Third Servingman\"?\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 works (\n id integer, -- example: [1, 2]\n Title text, -- example: ['Venus and Adonis', 'Twelfth Night', \"All's Well That Ends Well\"]\n `Date` integer, -- character id, example: [1599, 1602]\n GenreType text, -- example: ['Comedy', 'Tragedy']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE paragraphs (\n id integer, -- example: [630863, 630864]\n chapter_id integer, -- example: [18704, 18705]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE chapters (\n id integer, -- example: [18704, 18705]\n Scene integer, -- example: [1, 2]\n Description text, -- example: ['Venus and Adonis.', 'DUKE ORSINO’s palace.', 'The sea-coast.']\n work_id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE characters (\n id integer, -- example: [1, 2]\n Description text, -- example: ['A senator of Venice', 'a Moor, beloved by Tamora']\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:\nVenus and Adonis refers to Title = 'Venus and Adonis'; last scene refers to max(Scene)\nIn the Venus and Adonis, what is the description of the last scene listed?\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.Description FROM works AS T1 RIGHT JOIN chapters AS T2 ON T1.id = T2.work_id WHERE T1.Title = 'Venus and Adonis' ORDER BY T2.Scene DESC LIMIT 1",
"style": "rule"
} | {
"db_id": "shakespeare.sqlite",
"gt_sql": "SELECT T2.Description FROM works AS T1 RIGHT JOIN chapters AS T2 ON T1.id = T2.work_id WHERE T1.Title = 'Venus and Adonis' ORDER BY T2.Scene DESC LIMIT 1",
"index": 1501,
"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 works (\n id integer, -- example: [1, 2]\n Title text, -- example: ['Venus and Adonis', 'Twelfth Night', \"All's Well That Ends Well\"]\n `Date` integer, -- character id, example: [1599, 1602]\n GenreType text, -- example: ['Comedy', 'Tragedy']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE paragraphs (\n id integer, -- example: [630863, 630864]\n chapter_id integer, -- example: [18704, 18705]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE chapters (\n id integer, -- example: [18704, 18705]\n Scene integer, -- example: [1, 2]\n Description text, -- example: ['Venus and Adonis.', 'DUKE ORSINO’s palace.', 'The sea-coast.']\n work_id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE characters (\n id integer, -- example: [1, 2]\n Description text, -- example: ['A senator of Venice', 'a Moor, beloved by Tamora']\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:\nVenus and Adonis refers to Title = 'Venus and Adonis'; last scene refers to max(Scene)\nIn the Venus and Adonis, what is the description of the last scene listed?\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 paragraphs (\n id integer, -- example: [630863, 630864]\n PlainText text, -- example: ['Here.', 'Nothing.', 'Nothing?', '[Enter DUKE ORSINO, CURIO, and other Lor', 'If music be the food of love, play on;\\nG']\n character_id integer, -- example: [1261, 840]\n chapter_id integer, -- example: [18704, 18705]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE characters (\n id integer, -- example: [1, 2]\n CharName text, -- example: ['Man', 'First Apparition', 'First Citizen']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE chapters (\n id integer, -- example: [18704, 18705]\n Act integer, -- example: [1, 2]\n Scene integer, -- example: [1, 2]\n work_id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE works (\n id integer, -- example: [1, 2]\n Title text, -- example: ['Twelfth Night', \"All's Well That Ends Well\"]\n LongTitle text, -- example: ['Twelfth Night, Or What You Will', \"All's Well That Ends Well\"]\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:\ncharacter refers to chapter_id; text \"Fear not thou, man, thou shalt lose nothing here.\" refers to PlainText = 'Fear not thou, man, thou shalt lose nothing here.'\nWhat is the character and work ID of the text \"Fear not thou, man, thou shalt lose nothing here.\"?\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.character_id, T1.work_id FROM chapters AS T1 INNER JOIN paragraphs AS T2 ON T1.id = T2.chapter_id WHERE T2.PlainText = 'Fear not thou, man, thou shalt lose nothing here.'",
"style": "rule"
} | {
"db_id": "shakespeare.sqlite",
"gt_sql": "SELECT T2.character_id, T1.work_id FROM chapters AS T1 INNER JOIN paragraphs AS T2 ON T1.id = T2.chapter_id WHERE T2.PlainText = 'Fear not thou, man, thou shalt lose nothing here.'",
"index": 1502,
"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 paragraphs (\n id integer, -- example: [630863, 630864]\n PlainText text, -- example: ['Here.', 'Nothing.', 'Nothing?', '[Enter DUKE ORSINO, CURIO, and other Lor', 'If music be the food of love, play on;\\nG']\n character_id integer, -- example: [1261, 840]\n chapter_id integer, -- example: [18704, 18705]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE characters (\n id integer, -- example: [1, 2]\n CharName text, -- example: ['Man', 'First Apparition', 'First Citizen']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE chapters (\n id integer, -- example: [18704, 18705]\n Act integer, -- example: [1, 2]\n Scene integer, -- example: [1, 2]\n work_id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE works (\n id integer, -- example: [1, 2]\n Title text, -- example: ['Twelfth Night', \"All's Well That Ends Well\"]\n LongTitle text, -- example: ['Twelfth Night, Or What You Will', \"All's Well That Ends Well\"]\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:\ncharacter refers to chapter_id; text \"Fear not thou, man, thou shalt lose nothing here.\" refers to PlainText = 'Fear not thou, man, thou shalt lose nothing here.'\nWhat is the character and work ID of the text \"Fear not thou, man, thou shalt lose nothing here.\"?\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 chapters (\n id integer, -- example: [18704, 18705]\n Act integer, -- example: [1, 2]\n Scene integer, -- example: [1, 2]\n work_id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE characters (\n id integer, -- example: [1, 2]\n CharName text, -- example: ['Sir Toby Belch', 'First Apparition', 'First Citizen']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE paragraphs (\n id integer, -- example: [630863, 630864]\n character_id integer, -- example: [1261, 840]\n chapter_id integer, -- example: [18704, 18705]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE works (\n id integer, -- example: [1, 2]\n Title text, -- example: ['Twelfth Night', \"All's Well That Ends Well\"]\n `Date` integer, -- character id, example: [1599, 1602]\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:\nscene numbers refers to Scene; character named Sir Toby Belch refers to CharName = 'Sir Toby Belch'; in the Twelfth Night refers to Title = 'Twelfth Night'\nList the scene numbers involving the character named Sir Toby Belch in the Twelfth Night.\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.Scene FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id INNER JOIN paragraphs AS T3 ON T2.id = T3.chapter_id INNER JOIN characters AS T4 ON T3.character_id = T4.id WHERE T1.Title = 'Twelfth Night' AND T4.CharName = 'Sir Toby Belch'",
"style": "rule"
} | {
"db_id": "shakespeare.sqlite",
"gt_sql": "SELECT DISTINCT T2.Scene FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id INNER JOIN paragraphs AS T3 ON T2.id = T3.chapter_id INNER JOIN characters AS T4 ON T3.character_id = T4.id WHERE T1.Title = 'Twelfth Night' AND T4.CharName = 'Sir Toby Belch'",
"index": 1503,
"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 chapters (\n id integer, -- example: [18704, 18705]\n Act integer, -- example: [1, 2]\n Scene integer, -- example: [1, 2]\n work_id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE characters (\n id integer, -- example: [1, 2]\n CharName text, -- example: ['Sir Toby Belch', 'First Apparition', 'First Citizen']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE paragraphs (\n id integer, -- example: [630863, 630864]\n character_id integer, -- example: [1261, 840]\n chapter_id integer, -- example: [18704, 18705]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE works (\n id integer, -- example: [1, 2]\n Title text, -- example: ['Twelfth Night', \"All's Well That Ends Well\"]\n `Date` integer, -- character id, example: [1599, 1602]\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:\nscene numbers refers to Scene; character named Sir Toby Belch refers to CharName = 'Sir Toby Belch'; in the Twelfth Night refers to Title = 'Twelfth Night'\nList the scene numbers involving the character named Sir Toby Belch in the Twelfth Night.\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 chapters (\n id integer, -- example: [18704, 18705]\n Act integer, -- example: [1, 2]\n Scene integer, -- example: [1, 2]\n Description text, -- example: ['DUKE ORSINO’s palace.', 'The sea-coast.']\n work_id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE characters (\n id integer, -- example: [1, 2]\n CharName text, -- example: ['Tybalt', 'First Apparition', 'First Citizen']\n Abbrev text, -- abbreviation, example: ['TYBALT', 'First Apparition', 'First Citizen']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE works (\n id integer, -- example: [1, 2]\n Title text, -- example: ['Twelfth Night', \"All's Well That Ends Well\"]\n LongTitle text, -- example: ['Twelfth Night, Or What You Will', \"All's Well That Ends Well\"]\n `Date` integer, -- character id, example: [1599, 1602]\n GenreType text, -- example: ['Tragedy', 'Comedy']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE paragraphs (\n id integer, -- example: [630863, 630864]\n ParagraphNum integer, -- paragraph number, example: [3, 4]\n PlainText text, -- example: ['[Enter DUKE ORSINO, CURIO, and other Lor', 'If music be the food of love, play on;\\nG']\n character_id integer, -- example: [1261, 840]\n chapter_id integer, -- example: [18704, 18705]\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:\nworks before 1600 refers to DATE < 1600; tragic story refers to GenreType = 'Tragedy'; character named \"Tybalt\" refers to CharName = 'Tybalt'\nIn Shakespeare's works before 1600, list down the title of the tragic story he had written that involved a character named \"Tybalt\".\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.title FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id INNER JOIN paragraphs AS T3 ON T2.id = T3.chapter_id INNER JOIN characters AS T4 ON T3.character_id = T4.id WHERE T1.DATE < 1600 AND T1.GenreType = 'Tragedy' AND T4.CharName = 'Tybalt'",
"style": "rule"
} | {
"db_id": "shakespeare.sqlite",
"gt_sql": "SELECT DISTINCT T1.title FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id INNER JOIN paragraphs AS T3 ON T2.id = T3.chapter_id INNER JOIN characters AS T4 ON T3.character_id = T4.id WHERE T1.DATE < 1600 AND T1.GenreType = 'Tragedy' AND T4.CharName = 'Tybalt'",
"index": 1504,
"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 chapters (\n id integer, -- example: [18704, 18705]\n Act integer, -- example: [1, 2]\n Scene integer, -- example: [1, 2]\n Description text, -- example: ['DUKE ORSINO’s palace.', 'The sea-coast.']\n work_id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE characters (\n id integer, -- example: [1, 2]\n CharName text, -- example: ['Tybalt', 'First Apparition', 'First Citizen']\n Abbrev text, -- abbreviation, example: ['TYBALT', 'First Apparition', 'First Citizen']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE works (\n id integer, -- example: [1, 2]\n Title text, -- example: ['Twelfth Night', \"All's Well That Ends Well\"]\n LongTitle text, -- example: ['Twelfth Night, Or What You Will', \"All's Well That Ends Well\"]\n `Date` integer, -- character id, example: [1599, 1602]\n GenreType text, -- example: ['Tragedy', 'Comedy']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE paragraphs (\n id integer, -- example: [630863, 630864]\n ParagraphNum integer, -- paragraph number, example: [3, 4]\n PlainText text, -- example: ['[Enter DUKE ORSINO, CURIO, and other Lor', 'If music be the food of love, play on;\\nG']\n character_id integer, -- example: [1261, 840]\n chapter_id integer, -- example: [18704, 18705]\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:\nworks before 1600 refers to DATE < 1600; tragic story refers to GenreType = 'Tragedy'; character named \"Tybalt\" refers to CharName = 'Tybalt'\nIn Shakespeare's works before 1600, list down the title of the tragic story he had written that involved a character named \"Tybalt\".\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 paragraphs (\n id integer, -- example: [630863, 630864]\n ParagraphNum integer, -- paragraph number, example: [3, 4]\n PlainText text, -- example: ['[Enter DUKE ORSINO, CURIO, and other Lor', 'If music be the food of love, play on;\\nG']\n character_id integer, -- example: [1261, 840]\n chapter_id integer, -- example: [18704, 18705]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE works (\n id integer, -- example: [1, 2]\n Title text, -- example: ['Twelfth Night', \"All's Well That Ends Well\"]\n LongTitle text, -- example: ['Twelfth Night, Or What You Will', \"All's Well That Ends Well\"]\n `Date` integer, -- character id, example: [1599, 1602]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE characters (\n id integer, -- example: [1, 2]\n Abbrev text, -- abbreviation, example: ['ALL', 'All', 'First Apparition', 'First Citizen']\n Description text, -- example: ['A senator of Venice', 'a Moor, beloved by Tamora']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE chapters (\n id integer, -- example: [18704, 18705]\n Act integer, -- example: [1, 2]\n Scene integer, -- example: [1, 2]\n Description text, -- example: ['DUKE ORSINO’s palace.', 'The sea-coast.']\n work_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:\na year greater than the 89% of average year refers to DATE > multiply(divide(SUM(DATE) , COUNT(DATE)), 0.89)\nList the chapter ID of the works with a year greater than the 89% of average year of all listed works of Shakespeare.\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.id FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id WHERE T1.DATE > ( SELECT AVG(DATE) FROM works ) * 0.89",
"style": "rule"
} | {
"db_id": "shakespeare.sqlite",
"gt_sql": "SELECT T2.id FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id WHERE T1.DATE > ( SELECT AVG(DATE) FROM works ) * 0.89",
"index": 1505,
"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 paragraphs (\n id integer, -- example: [630863, 630864]\n ParagraphNum integer, -- paragraph number, example: [3, 4]\n PlainText text, -- example: ['[Enter DUKE ORSINO, CURIO, and other Lor', 'If music be the food of love, play on;\\nG']\n character_id integer, -- example: [1261, 840]\n chapter_id integer, -- example: [18704, 18705]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE works (\n id integer, -- example: [1, 2]\n Title text, -- example: ['Twelfth Night', \"All's Well That Ends Well\"]\n LongTitle text, -- example: ['Twelfth Night, Or What You Will', \"All's Well That Ends Well\"]\n `Date` integer, -- character id, example: [1599, 1602]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE characters (\n id integer, -- example: [1, 2]\n Abbrev text, -- abbreviation, example: ['ALL', 'All', 'First Apparition', 'First Citizen']\n Description text, -- example: ['A senator of Venice', 'a Moor, beloved by Tamora']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE chapters (\n id integer, -- example: [18704, 18705]\n Act integer, -- example: [1, 2]\n Scene integer, -- example: [1, 2]\n Description text, -- example: ['DUKE ORSINO’s palace.', 'The sea-coast.']\n work_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:\na year greater than the 89% of average year refers to DATE > multiply(divide(SUM(DATE) , COUNT(DATE)), 0.89)\nList the chapter ID of the works with a year greater than the 89% of average year of all listed works of Shakespeare.\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 chapters (\n id integer, -- example: [18704, 18705]\n Act integer, -- example: [1, 2]\n Description text, -- example: ['DUKE ORSINO’s palace.', 'The sea-coast.']\n work_id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE paragraphs (\n id integer, -- example: [630863, 630864]\n ParagraphNum integer, -- paragraph number, example: [3, 4]\n PlainText text, -- example: ['[Enter DUKE ORSINO, CURIO, and other Lor', 'If music be the food of love, play on;\\nG']\n character_id integer, -- example: [1261, 840]\n chapter_id integer, -- example: [18704, 18705]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE works (\n id integer, -- example: [1, 2]\n Title text, -- example: ['Twelfth Night', \"All's Well That Ends Well\"]\n LongTitle text, -- example: ['Twelfth Night, Or What You Will', \"All's Well That Ends Well\"]\n `Date` integer, -- character id, example: [1599, 1602]\n GenreType text, -- example: ['Comedy', 'Tragedy']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE characters (\n id integer, -- example: [1, 2]\n CharName text, -- example: ['Antonio', 'First Apparition', 'First Citizen']\n Description text, -- example: ['A senator of Venice', 'a Moor, beloved by Tamora']\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:\ncomedy works refers to GenreType = 'Comedy'; a character named \"antonio\" refers to CharName = 'antonio'; percentage = divide(sum(CharName = 'Antonio'), count(CharName)) as percentage\nAmong the comedy works of Shakespeare, what is the percentage of his works with a character named \"antonio\"?\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(IIF(T4.CharName = 'antonio', 1, 0)) AS REAL) * 100 / COUNT(T1.id) FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id INNER JOIN paragraphs AS T3 ON T2.id = T3.chapter_id INNER JOIN characters AS T4 ON T3.character_id = T4.id WHERE T1.GenreType = 'Comedy'",
"style": "rule"
} | {
"db_id": "shakespeare.sqlite",
"gt_sql": "SELECT CAST(SUM(IIF(T4.CharName = 'antonio', 1, 0)) AS REAL) * 100 / COUNT(T1.id) FROM works AS T1 INNER JOIN chapters AS T2 ON T1.id = T2.work_id INNER JOIN paragraphs AS T3 ON T2.id = T3.chapter_id INNER JOIN characters AS T4 ON T3.character_id = T4.id WHERE T1.GenreType = 'Comedy'",
"index": 1506,
"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 chapters (\n id integer, -- example: [18704, 18705]\n Act integer, -- example: [1, 2]\n Description text, -- example: ['DUKE ORSINO’s palace.', 'The sea-coast.']\n work_id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE paragraphs (\n id integer, -- example: [630863, 630864]\n ParagraphNum integer, -- paragraph number, example: [3, 4]\n PlainText text, -- example: ['[Enter DUKE ORSINO, CURIO, and other Lor', 'If music be the food of love, play on;\\nG']\n character_id integer, -- example: [1261, 840]\n chapter_id integer, -- example: [18704, 18705]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE works (\n id integer, -- example: [1, 2]\n Title text, -- example: ['Twelfth Night', \"All's Well That Ends Well\"]\n LongTitle text, -- example: ['Twelfth Night, Or What You Will', \"All's Well That Ends Well\"]\n `Date` integer, -- character id, example: [1599, 1602]\n GenreType text, -- example: ['Comedy', 'Tragedy']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE characters (\n id integer, -- example: [1, 2]\n CharName text, -- example: ['Antonio', 'First Apparition', 'First Citizen']\n Description text, -- example: ['A senator of Venice', 'a Moor, beloved by Tamora']\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:\ncomedy works refers to GenreType = 'Comedy'; a character named \"antonio\" refers to CharName = 'antonio'; percentage = divide(sum(CharName = 'Antonio'), count(CharName)) as percentage\nAmong the comedy works of Shakespeare, what is the percentage of his works with a character named \"antonio\"?\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 country (\n origin integer, -- example: [1, 2]\n country text, -- example: ['USA', 'Europe']\n PRIMARY KEY (origin)\n);\n\nCREATE TABLE price (\n ID integer, -- example: [1, 2]\n price real, -- example: [25561.59078, 24221.42273]\n PRIMARY KEY (ID)\n);\n\nCREATE TABLE production (\n ID integer, -- example: [1, 2]\n model_year integer, -- example: [1970, 1971]\n country integer, -- example: [1, 3]\n PRIMARY KEY (ID, model_year),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES price (ID),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES data (ID),\n CONSTRAINT fk_production_country FOREIGN KEY (country) REFERENCES country (origin)\n);\n\nCREATE TABLE data (\n ID integer, -- example: [1, 2]\n mpg real, -- mileage per gallon, example: [18.0, 15.0]\n cylinders integer, -- number of cylinders, example: [8, 4]\n displacement real, -- example: [307.0, 350.0]\n horsepower integer, -- example: [130, 165]\n weight integer, -- example: [3504, 3693]\n acceleration real, -- example: [12.0, 11.5]\n model integer, -- example: [70, 71]\n car_name text, -- example: ['chevrolet chevelle malibu', 'buick skylark 320']\n PRIMARY KEY (ID),\n CONSTRAINT fk_data_id FOREIGN KEY (ID) REFERENCES price (ID)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nwith 8 cylinders refers to cylinders = 8; name of the car refers to car_name; the most expensive refers to max(price)\nAmong the cars with 8 cylinders, what is the name of the one that's 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.car_name FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T1.cylinders = 8 ORDER BY T2.price DESC LIMIT 1",
"style": "rule"
} | {
"db_id": "cars.sqlite",
"gt_sql": "SELECT T1.car_name FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T1.cylinders = 8 ORDER BY T2.price DESC LIMIT 1",
"index": 1507,
"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 country (\n origin integer, -- example: [1, 2]\n country text, -- example: ['USA', 'Europe']\n PRIMARY KEY (origin)\n);\n\nCREATE TABLE price (\n ID integer, -- example: [1, 2]\n price real, -- example: [25561.59078, 24221.42273]\n PRIMARY KEY (ID)\n);\n\nCREATE TABLE production (\n ID integer, -- example: [1, 2]\n model_year integer, -- example: [1970, 1971]\n country integer, -- example: [1, 3]\n PRIMARY KEY (ID, model_year),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES price (ID),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES data (ID),\n CONSTRAINT fk_production_country FOREIGN KEY (country) REFERENCES country (origin)\n);\n\nCREATE TABLE data (\n ID integer, -- example: [1, 2]\n mpg real, -- mileage per gallon, example: [18.0, 15.0]\n cylinders integer, -- number of cylinders, example: [8, 4]\n displacement real, -- example: [307.0, 350.0]\n horsepower integer, -- example: [130, 165]\n weight integer, -- example: [3504, 3693]\n acceleration real, -- example: [12.0, 11.5]\n model integer, -- example: [70, 71]\n car_name text, -- example: ['chevrolet chevelle malibu', 'buick skylark 320']\n PRIMARY KEY (ID),\n CONSTRAINT fk_data_id FOREIGN KEY (ID) REFERENCES price (ID)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nwith 8 cylinders refers to cylinders = 8; name of the car refers to car_name; the most expensive refers to max(price)\nAmong the cars with 8 cylinders, what is the name of the one that's 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 data (\n ID integer, -- example: [1, 2]\n cylinders integer, -- number of cylinders, example: [8, 4]\n horsepower integer, -- example: [130, 165]\n weight integer, -- example: [3504, 3693]\n model integer, -- example: [70, 71]\n PRIMARY KEY (ID),\n CONSTRAINT fk_data_id FOREIGN KEY (ID) REFERENCES price (ID)\n);\n\nCREATE TABLE country (\n origin integer, -- example: [1, 2]\n country text, -- example: ['USA', 'Europe']\n PRIMARY KEY (origin)\n);\n\nCREATE TABLE production (\n ID integer, -- example: [1, 2]\n model_year integer, -- example: [1970, 1971]\n country integer, -- example: [1, 3]\n PRIMARY KEY (ID, model_year),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES price (ID),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES data (ID),\n CONSTRAINT fk_production_country FOREIGN KEY (country) REFERENCES country (origin)\n);\n\nCREATE TABLE price (\n ID integer, -- example: [1, 2]\n price real, -- example: [25561.59078, 24221.42273]\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:\nover 3000lbs refers to weight > 3000; cost less than $30000 refers to price < 30000\nAmong the cars over 3000lbs, how many of them cost less than $30000?\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.car_name) FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T1.weight > 3000 AND T2.price < 30000",
"style": "rule"
} | {
"db_id": "cars.sqlite",
"gt_sql": "SELECT COUNT(T1.car_name) FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T1.weight > 3000 AND T2.price < 30000",
"index": 1508,
"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 data (\n ID integer, -- example: [1, 2]\n cylinders integer, -- number of cylinders, example: [8, 4]\n horsepower integer, -- example: [130, 165]\n weight integer, -- example: [3504, 3693]\n model integer, -- example: [70, 71]\n PRIMARY KEY (ID),\n CONSTRAINT fk_data_id FOREIGN KEY (ID) REFERENCES price (ID)\n);\n\nCREATE TABLE country (\n origin integer, -- example: [1, 2]\n country text, -- example: ['USA', 'Europe']\n PRIMARY KEY (origin)\n);\n\nCREATE TABLE production (\n ID integer, -- example: [1, 2]\n model_year integer, -- example: [1970, 1971]\n country integer, -- example: [1, 3]\n PRIMARY KEY (ID, model_year),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES price (ID),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES data (ID),\n CONSTRAINT fk_production_country FOREIGN KEY (country) REFERENCES country (origin)\n);\n\nCREATE TABLE price (\n ID integer, -- example: [1, 2]\n price real, -- example: [25561.59078, 24221.42273]\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:\nover 3000lbs refers to weight > 3000; cost less than $30000 refers to price < 30000\nAmong the cars over 3000lbs, how many of them cost less than $30000?\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 data (\n ID integer, -- example: [1, 2]\n model integer, -- example: [70, 71]\n car_name text, -- example: ['chevrolet chevelle malibu', 'buick skylark 320']\n PRIMARY KEY (ID),\n CONSTRAINT fk_data_id FOREIGN KEY (ID) REFERENCES price (ID)\n);\n\nCREATE TABLE price (\n ID integer, -- example: [1, 2]\n PRIMARY KEY (ID)\n);\n\nCREATE TABLE country (\n origin integer, -- example: [1, 2]\n country text, -- example: ['USA', 'Europe']\n PRIMARY KEY (origin)\n);\n\nCREATE TABLE production (\n ID integer, -- example: [1, 2]\n model_year integer, -- example: [1970, 1971]\n country integer, -- example: [1, 3]\n PRIMARY KEY (ID, model_year),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES price (ID),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES data (ID),\n CONSTRAINT fk_production_country FOREIGN KEY (country) REFERENCES country (origin)\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 car model refers to car_name; origin country is the USA refers to country = 'USA'\nPlease list the names of all the car models whose origin country is the USA.\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.car_name FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID INNER JOIN country AS T3 ON T2.country = T3.origin WHERE T3.country = 'USA'",
"style": "rule"
} | {
"db_id": "cars.sqlite",
"gt_sql": "SELECT DISTINCT T1.car_name FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID INNER JOIN country AS T3 ON T2.country = T3.origin WHERE T3.country = 'USA'",
"index": 1509,
"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 data (\n ID integer, -- example: [1, 2]\n model integer, -- example: [70, 71]\n car_name text, -- example: ['chevrolet chevelle malibu', 'buick skylark 320']\n PRIMARY KEY (ID),\n CONSTRAINT fk_data_id FOREIGN KEY (ID) REFERENCES price (ID)\n);\n\nCREATE TABLE price (\n ID integer, -- example: [1, 2]\n PRIMARY KEY (ID)\n);\n\nCREATE TABLE country (\n origin integer, -- example: [1, 2]\n country text, -- example: ['USA', 'Europe']\n PRIMARY KEY (origin)\n);\n\nCREATE TABLE production (\n ID integer, -- example: [1, 2]\n model_year integer, -- example: [1970, 1971]\n country integer, -- example: [1, 3]\n PRIMARY KEY (ID, model_year),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES price (ID),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES data (ID),\n CONSTRAINT fk_production_country FOREIGN KEY (country) REFERENCES country (origin)\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 car model refers to car_name; origin country is the USA refers to country = 'USA'\nPlease list the names of all the car models whose origin country is the USA.\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 production (\n ID integer, -- example: [1, 2]\n model_year integer, -- example: [1970, 1971]\n country integer, -- example: [1, 3]\n PRIMARY KEY (ID, model_year),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES price (ID),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES data (ID),\n CONSTRAINT fk_production_country FOREIGN KEY (country) REFERENCES country (origin)\n);\n\nCREATE TABLE country (\n origin integer, -- example: [1, 2]\n PRIMARY KEY (origin)\n);\n\nCREATE TABLE data (\n ID integer, -- example: [1, 2]\n cylinders integer, -- number of cylinders, example: [8, 4]\n horsepower integer, -- example: [130, 165]\n weight integer, -- example: [3504, 3693]\n acceleration real, -- example: [12.0, 11.5]\n car_name text, -- example: ['chevrolet chevelle malibu', 'buick skylark 320']\n PRIMARY KEY (ID),\n CONSTRAINT fk_data_id FOREIGN KEY (ID) REFERENCES price (ID)\n);\n\nCREATE TABLE price (\n ID integer, -- example: [1, 2]\n price real, -- example: [25561.59078, 24221.42273]\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 car refers to car_name; the most expensive refers to max(price)\nPlease list the names of the top 3 most expensive cars.\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.car_name FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID ORDER BY T2.price DESC LIMIT 3",
"style": "rule"
} | {
"db_id": "cars.sqlite",
"gt_sql": "SELECT T1.car_name FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID ORDER BY T2.price DESC LIMIT 3",
"index": 1510,
"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 production (\n ID integer, -- example: [1, 2]\n model_year integer, -- example: [1970, 1971]\n country integer, -- example: [1, 3]\n PRIMARY KEY (ID, model_year),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES price (ID),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES data (ID),\n CONSTRAINT fk_production_country FOREIGN KEY (country) REFERENCES country (origin)\n);\n\nCREATE TABLE country (\n origin integer, -- example: [1, 2]\n PRIMARY KEY (origin)\n);\n\nCREATE TABLE data (\n ID integer, -- example: [1, 2]\n cylinders integer, -- number of cylinders, example: [8, 4]\n horsepower integer, -- example: [130, 165]\n weight integer, -- example: [3504, 3693]\n acceleration real, -- example: [12.0, 11.5]\n car_name text, -- example: ['chevrolet chevelle malibu', 'buick skylark 320']\n PRIMARY KEY (ID),\n CONSTRAINT fk_data_id FOREIGN KEY (ID) REFERENCES price (ID)\n);\n\nCREATE TABLE price (\n ID integer, -- example: [1, 2]\n price real, -- example: [25561.59078, 24221.42273]\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 car refers to car_name; the most expensive refers to max(price)\nPlease list the names of the top 3 most expensive cars.\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 price (\n ID integer, -- example: [1, 2]\n price real, -- example: [25561.59078, 24221.42273]\n PRIMARY KEY (ID)\n);\n\nCREATE TABLE production (\n ID integer, -- example: [1, 2]\n model_year integer, -- example: [1970, 1971]\n country integer, -- example: [1, 3]\n PRIMARY KEY (ID, model_year),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES price (ID),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES data (ID),\n CONSTRAINT fk_production_country FOREIGN KEY (country) REFERENCES country (origin)\n);\n\nCREATE TABLE country (\n origin integer, -- example: [1, 2]\n PRIMARY KEY (origin)\n);\n\nCREATE TABLE data (\n ID integer, -- example: [1, 2]\n cylinders integer, -- number of cylinders, example: [8, 4]\n displacement real, -- example: [307.0, 350.0]\n horsepower integer, -- example: [130, 165]\n acceleration real, -- example: [12.0, 11.5]\n PRIMARY KEY (ID),\n CONSTRAINT fk_data_id FOREIGN KEY (ID) REFERENCES price (ID)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nan acceleration of over 10 miles per squared hour refers to acceleration > 10; cost more than $20000 and less than $30000 refers to price < 30000 AND price > 20000\nAmong the cars with an acceleration of over 10 miles per squared hour, how many of them cost more than $20000 and less than $30000?\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 data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T1.acceleration > 10 AND T2.price BETWEEN 20000 AND 30000",
"style": "rule"
} | {
"db_id": "cars.sqlite",
"gt_sql": "SELECT COUNT(*) FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T1.acceleration > 10 AND T2.price BETWEEN 20000 AND 30000",
"index": 1511,
"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 price (\n ID integer, -- example: [1, 2]\n price real, -- example: [25561.59078, 24221.42273]\n PRIMARY KEY (ID)\n);\n\nCREATE TABLE production (\n ID integer, -- example: [1, 2]\n model_year integer, -- example: [1970, 1971]\n country integer, -- example: [1, 3]\n PRIMARY KEY (ID, model_year),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES price (ID),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES data (ID),\n CONSTRAINT fk_production_country FOREIGN KEY (country) REFERENCES country (origin)\n);\n\nCREATE TABLE country (\n origin integer, -- example: [1, 2]\n PRIMARY KEY (origin)\n);\n\nCREATE TABLE data (\n ID integer, -- example: [1, 2]\n cylinders integer, -- number of cylinders, example: [8, 4]\n displacement real, -- example: [307.0, 350.0]\n horsepower integer, -- example: [130, 165]\n acceleration real, -- example: [12.0, 11.5]\n PRIMARY KEY (ID),\n CONSTRAINT fk_data_id FOREIGN KEY (ID) REFERENCES price (ID)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nan acceleration of over 10 miles per squared hour refers to acceleration > 10; cost more than $20000 and less than $30000 refers to price < 30000 AND price > 20000\nAmong the cars with an acceleration of over 10 miles per squared hour, how many of them cost more than $20000 and less than $30000?\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 price (\n ID integer, -- example: [1, 2]\n price real, -- example: [25561.59078, 24221.42273]\n PRIMARY KEY (ID)\n);\n\nCREATE TABLE production (\n ID integer, -- example: [1, 2]\n model_year integer, -- example: [1970, 1971]\n country integer, -- example: [1, 3]\n PRIMARY KEY (ID, model_year),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES price (ID),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES data (ID),\n CONSTRAINT fk_production_country FOREIGN KEY (country) REFERENCES country (origin)\n);\n\nCREATE TABLE data (\n ID integer, -- example: [1, 2]\n cylinders integer, -- number of cylinders, example: [8, 4]\n acceleration real, -- example: [12.0, 11.5]\n PRIMARY KEY (ID),\n CONSTRAINT fk_data_id FOREIGN KEY (ID) REFERENCES price (ID)\n);\n\nCREATE TABLE country (\n origin integer, -- example: [1, 2]\n PRIMARY KEY (origin)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nwith 8 cylinders refers to cylinders = 8; average price = avg(price) where cylinders = 8\nWhat is the average price of cars with 8 cylinders?\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 AVG(T2.price) FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T1.cylinders = 8",
"style": "rule"
} | {
"db_id": "cars.sqlite",
"gt_sql": "SELECT AVG(T2.price) FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T1.cylinders = 8",
"index": 1512,
"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 price (\n ID integer, -- example: [1, 2]\n price real, -- example: [25561.59078, 24221.42273]\n PRIMARY KEY (ID)\n);\n\nCREATE TABLE production (\n ID integer, -- example: [1, 2]\n model_year integer, -- example: [1970, 1971]\n country integer, -- example: [1, 3]\n PRIMARY KEY (ID, model_year),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES price (ID),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES data (ID),\n CONSTRAINT fk_production_country FOREIGN KEY (country) REFERENCES country (origin)\n);\n\nCREATE TABLE data (\n ID integer, -- example: [1, 2]\n cylinders integer, -- number of cylinders, example: [8, 4]\n acceleration real, -- example: [12.0, 11.5]\n PRIMARY KEY (ID),\n CONSTRAINT fk_data_id FOREIGN KEY (ID) REFERENCES price (ID)\n);\n\nCREATE TABLE country (\n origin integer, -- example: [1, 2]\n PRIMARY KEY (origin)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nwith 8 cylinders refers to cylinders = 8; average price = avg(price) where cylinders = 8\nWhat is the average price of cars with 8 cylinders?\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 production (\n ID integer, -- example: [1, 2]\n model_year integer, -- example: [1970, 1971]\n country integer, -- example: [1, 3]\n PRIMARY KEY (ID, model_year),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES price (ID),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES data (ID),\n CONSTRAINT fk_production_country FOREIGN KEY (country) REFERENCES country (origin)\n);\n\nCREATE TABLE data (\n ID integer, -- example: [1, 2]\n cylinders integer, -- number of cylinders, example: [8, 4]\n displacement real, -- example: [307.0, 350.0]\n horsepower integer, -- example: [130, 165]\n weight integer, -- example: [3504, 3693]\n acceleration real, -- example: [12.0, 11.5]\n model integer, -- example: [70, 71]\n car_name text, -- example: ['chevrolet chevelle malibu', 'buick skylark 320']\n PRIMARY KEY (ID),\n CONSTRAINT fk_data_id FOREIGN KEY (ID) REFERENCES price (ID)\n);\n\nCREATE TABLE country (\n origin integer, -- example: [1, 2]\n PRIMARY KEY (origin)\n);\n\nCREATE TABLE price (\n ID integer, -- example: [1, 2]\n price real, -- example: [25561.59078, 24221.42273]\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:\ncost less than $30000 refers to price < 30000; the maximum sweep volume = max(divide(displacement, cylinders)) where price < 30000\nWhat is the maximum sweep volume of a car that costs less than $30000?\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 MAX(T1.displacement / T1.cylinders) FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T2.price < 30000",
"style": "rule"
} | {
"db_id": "cars.sqlite",
"gt_sql": "SELECT MAX(T1.displacement / T1.cylinders) FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T2.price < 30000",
"index": 1513,
"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 production (\n ID integer, -- example: [1, 2]\n model_year integer, -- example: [1970, 1971]\n country integer, -- example: [1, 3]\n PRIMARY KEY (ID, model_year),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES price (ID),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES data (ID),\n CONSTRAINT fk_production_country FOREIGN KEY (country) REFERENCES country (origin)\n);\n\nCREATE TABLE data (\n ID integer, -- example: [1, 2]\n cylinders integer, -- number of cylinders, example: [8, 4]\n displacement real, -- example: [307.0, 350.0]\n horsepower integer, -- example: [130, 165]\n weight integer, -- example: [3504, 3693]\n acceleration real, -- example: [12.0, 11.5]\n model integer, -- example: [70, 71]\n car_name text, -- example: ['chevrolet chevelle malibu', 'buick skylark 320']\n PRIMARY KEY (ID),\n CONSTRAINT fk_data_id FOREIGN KEY (ID) REFERENCES price (ID)\n);\n\nCREATE TABLE country (\n origin integer, -- example: [1, 2]\n PRIMARY KEY (origin)\n);\n\nCREATE TABLE price (\n ID integer, -- example: [1, 2]\n price real, -- example: [25561.59078, 24221.42273]\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:\ncost less than $30000 refers to price < 30000; the maximum sweep volume = max(divide(displacement, cylinders)) where price < 30000\nWhat is the maximum sweep volume of a car that costs less than $30000?\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 price (\n ID integer, -- example: [1, 2]\n price real, -- example: [25561.59078, 24221.42273]\n PRIMARY KEY (ID)\n);\n\nCREATE TABLE data (\n ID integer, -- example: [1, 2]\n cylinders integer, -- number of cylinders, example: [8, 4]\n displacement real, -- example: [307.0, 350.0]\n horsepower integer, -- example: [130, 165]\n car_name text, -- example: ['chevrolet malibu', 'chevrolet chevelle malibu', 'buick skylark 320']\n PRIMARY KEY (ID),\n CONSTRAINT fk_data_id FOREIGN KEY (ID) REFERENCES price (ID)\n);\n\nCREATE TABLE country (\n origin integer, -- example: [1, 2]\n country text, -- example: ['USA', 'Europe']\n PRIMARY KEY (origin)\n);\n\nCREATE TABLE production (\n ID integer, -- example: [1, 2]\n model_year integer, -- example: [1970, 1971]\n country integer, -- example: [1, 3]\n PRIMARY KEY (ID, model_year),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES price (ID),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES data (ID),\n CONSTRAINT fk_production_country FOREIGN KEY (country) REFERENCES country (origin)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\norigin country refers to country; Chevrolet Malibu refers to car_name = 'chevrolet malibu'\nShow the origin country of Chevrolet Malibu.\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.country FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID INNER JOIN country AS T3 ON T3.origin = T2.country WHERE T1.car_name = 'chevrolet malibu'",
"style": "rule"
} | {
"db_id": "cars.sqlite",
"gt_sql": "SELECT T3.country FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID INNER JOIN country AS T3 ON T3.origin = T2.country WHERE T1.car_name = 'chevrolet malibu'",
"index": 1514,
"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 price (\n ID integer, -- example: [1, 2]\n price real, -- example: [25561.59078, 24221.42273]\n PRIMARY KEY (ID)\n);\n\nCREATE TABLE data (\n ID integer, -- example: [1, 2]\n cylinders integer, -- number of cylinders, example: [8, 4]\n displacement real, -- example: [307.0, 350.0]\n horsepower integer, -- example: [130, 165]\n car_name text, -- example: ['chevrolet malibu', 'chevrolet chevelle malibu', 'buick skylark 320']\n PRIMARY KEY (ID),\n CONSTRAINT fk_data_id FOREIGN KEY (ID) REFERENCES price (ID)\n);\n\nCREATE TABLE country (\n origin integer, -- example: [1, 2]\n country text, -- example: ['USA', 'Europe']\n PRIMARY KEY (origin)\n);\n\nCREATE TABLE production (\n ID integer, -- example: [1, 2]\n model_year integer, -- example: [1970, 1971]\n country integer, -- example: [1, 3]\n PRIMARY KEY (ID, model_year),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES price (ID),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES data (ID),\n CONSTRAINT fk_production_country FOREIGN KEY (country) REFERENCES country (origin)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\norigin country refers to country; Chevrolet Malibu refers to car_name = 'chevrolet malibu'\nShow the origin country of Chevrolet Malibu.\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 data (\n ID integer, -- example: [1, 2]\n mpg real, -- mileage per gallon, example: [18.0, 15.0]\n horsepower integer, -- example: [130, 165]\n acceleration real, -- example: [12.0, 11.5]\n model integer, -- example: [70, 71]\n PRIMARY KEY (ID),\n CONSTRAINT fk_data_id FOREIGN KEY (ID) REFERENCES price (ID)\n);\n\nCREATE TABLE production (\n ID integer, -- example: [1, 2]\n model_year integer, -- example: [1970, 1971]\n country integer, -- example: [1, 3]\n PRIMARY KEY (ID, model_year),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES price (ID),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES data (ID),\n CONSTRAINT fk_production_country FOREIGN KEY (country) REFERENCES country (origin)\n);\n\nCREATE TABLE country (\n origin integer, -- example: [1, 2]\n PRIMARY KEY (origin)\n);\n\nCREATE TABLE price (\n ID integer, -- example: [1, 2]\n price real, -- example: [25561.59078, 24221.42273]\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:\nmiles per gallon refers to mpg; the most expensive refers to max(price)\nWhat are the miles per gallon of the most expensive car?\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.mpg FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID ORDER BY T2.price DESC LIMIT 1",
"style": "rule"
} | {
"db_id": "cars.sqlite",
"gt_sql": "SELECT T1.mpg FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID ORDER BY T2.price DESC LIMIT 1",
"index": 1515,
"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 data (\n ID integer, -- example: [1, 2]\n mpg real, -- mileage per gallon, example: [18.0, 15.0]\n horsepower integer, -- example: [130, 165]\n acceleration real, -- example: [12.0, 11.5]\n model integer, -- example: [70, 71]\n PRIMARY KEY (ID),\n CONSTRAINT fk_data_id FOREIGN KEY (ID) REFERENCES price (ID)\n);\n\nCREATE TABLE production (\n ID integer, -- example: [1, 2]\n model_year integer, -- example: [1970, 1971]\n country integer, -- example: [1, 3]\n PRIMARY KEY (ID, model_year),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES price (ID),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES data (ID),\n CONSTRAINT fk_production_country FOREIGN KEY (country) REFERENCES country (origin)\n);\n\nCREATE TABLE country (\n origin integer, -- example: [1, 2]\n PRIMARY KEY (origin)\n);\n\nCREATE TABLE price (\n ID integer, -- example: [1, 2]\n price real, -- example: [25561.59078, 24221.42273]\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:\nmiles per gallon refers to mpg; the most expensive refers to max(price)\nWhat are the miles per gallon of the most expensive car?\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 country (\n origin integer, -- example: [1, 2]\n country text, -- example: ['USA', 'Europe']\n PRIMARY KEY (origin)\n);\n\nCREATE TABLE data (\n ID integer, -- example: [1, 2]\n mpg real, -- mileage per gallon, example: [18.0, 15.0]\n cylinders integer, -- number of cylinders, example: [8, 4]\n displacement real, -- example: [307.0, 350.0]\n horsepower integer, -- example: [130, 165]\n weight integer, -- example: [3504, 3693]\n acceleration real, -- example: [12.0, 11.5]\n model integer, -- example: [70, 71]\n car_name text, -- example: ['chevrolet chevelle malibu', 'buick skylark 320']\n PRIMARY KEY (ID),\n CONSTRAINT fk_data_id FOREIGN KEY (ID) REFERENCES price (ID)\n);\n\nCREATE TABLE price (\n ID integer, -- example: [1, 2]\n price real, -- example: [25561.59078, 24221.42273]\n PRIMARY KEY (ID)\n);\n\nCREATE TABLE production (\n ID integer, -- example: [1, 2]\n model_year integer, -- example: [1970, 1971]\n country integer, -- example: [1, 3]\n PRIMARY KEY (ID, model_year),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES price (ID),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES data (ID),\n CONSTRAINT fk_production_country FOREIGN KEY (country) REFERENCES country (origin)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\norigin country refers to country; car no.382 refers to ID = 382\nTell the origin country of car no.382.\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.country FROM production AS T1 INNER JOIN country AS T2 ON T1.country = T2.origin WHERE T1.ID = 382",
"style": "rule"
} | {
"db_id": "cars.sqlite",
"gt_sql": "SELECT DISTINCT T2.country FROM production AS T1 INNER JOIN country AS T2 ON T1.country = T2.origin WHERE T1.ID = 382",
"index": 1516,
"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 country (\n origin integer, -- example: [1, 2]\n country text, -- example: ['USA', 'Europe']\n PRIMARY KEY (origin)\n);\n\nCREATE TABLE data (\n ID integer, -- example: [1, 2]\n mpg real, -- mileage per gallon, example: [18.0, 15.0]\n cylinders integer, -- number of cylinders, example: [8, 4]\n displacement real, -- example: [307.0, 350.0]\n horsepower integer, -- example: [130, 165]\n weight integer, -- example: [3504, 3693]\n acceleration real, -- example: [12.0, 11.5]\n model integer, -- example: [70, 71]\n car_name text, -- example: ['chevrolet chevelle malibu', 'buick skylark 320']\n PRIMARY KEY (ID),\n CONSTRAINT fk_data_id FOREIGN KEY (ID) REFERENCES price (ID)\n);\n\nCREATE TABLE price (\n ID integer, -- example: [1, 2]\n price real, -- example: [25561.59078, 24221.42273]\n PRIMARY KEY (ID)\n);\n\nCREATE TABLE production (\n ID integer, -- example: [1, 2]\n model_year integer, -- example: [1970, 1971]\n country integer, -- example: [1, 3]\n PRIMARY KEY (ID, model_year),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES price (ID),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES data (ID),\n CONSTRAINT fk_production_country FOREIGN KEY (country) REFERENCES country (origin)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\norigin country refers to country; car no.382 refers to ID = 382\nTell the origin country of car no.382.\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 production (\n ID integer, -- example: [1, 2]\n model_year integer, -- example: [1970, 1971]\n country integer, -- example: [1, 3]\n PRIMARY KEY (ID, model_year),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES price (ID),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES data (ID),\n CONSTRAINT fk_production_country FOREIGN KEY (country) REFERENCES country (origin)\n);\n\nCREATE TABLE price (\n ID integer, -- example: [1, 2]\n price real, -- example: [25561.59078, 24221.42273]\n PRIMARY KEY (ID)\n);\n\nCREATE TABLE country (\n origin integer, -- example: [1, 2]\n PRIMARY KEY (origin)\n);\n\nCREATE TABLE data (\n ID integer, -- example: [1, 2]\n cylinders integer, -- number of cylinders, example: [8, 4]\n displacement real, -- example: [307.0, 350.0]\n horsepower integer, -- example: [130, 165]\n weight integer, -- example: [3504, 3693]\n acceleration real, -- example: [12.0, 11.5]\n PRIMARY KEY (ID),\n CONSTRAINT fk_data_id FOREIGN KEY (ID) REFERENCES price (ID)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nengine displacement status refers to displacement; the $37443.85589 car refers to price = 37443.85589\nProvide the engine displacement status of the $37443.85589 car.\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.displacement FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T2.price = '37443.85589'",
"style": "rule"
} | {
"db_id": "cars.sqlite",
"gt_sql": "SELECT T1.displacement FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T2.price = '37443.85589'",
"index": 1517,
"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 production (\n ID integer, -- example: [1, 2]\n model_year integer, -- example: [1970, 1971]\n country integer, -- example: [1, 3]\n PRIMARY KEY (ID, model_year),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES price (ID),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES data (ID),\n CONSTRAINT fk_production_country FOREIGN KEY (country) REFERENCES country (origin)\n);\n\nCREATE TABLE price (\n ID integer, -- example: [1, 2]\n price real, -- example: [25561.59078, 24221.42273]\n PRIMARY KEY (ID)\n);\n\nCREATE TABLE country (\n origin integer, -- example: [1, 2]\n PRIMARY KEY (origin)\n);\n\nCREATE TABLE data (\n ID integer, -- example: [1, 2]\n cylinders integer, -- number of cylinders, example: [8, 4]\n displacement real, -- example: [307.0, 350.0]\n horsepower integer, -- example: [130, 165]\n weight integer, -- example: [3504, 3693]\n acceleration real, -- example: [12.0, 11.5]\n PRIMARY KEY (ID),\n CONSTRAINT fk_data_id FOREIGN KEY (ID) REFERENCES price (ID)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nengine displacement status refers to displacement; the $37443.85589 car refers to price = 37443.85589\nProvide the engine displacement status of the $37443.85589 car.\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 data (\n ID integer, -- example: [1, 2]\n mpg real, -- mileage per gallon, example: [18.0, 15.0]\n cylinders integer, -- number of cylinders, example: [8, 4]\n displacement real, -- example: [307.0, 350.0]\n weight integer, -- example: [3504, 3693]\n model integer, -- example: [70, 71]\n car_name text, -- example: ['chevrolet chevelle malibu', 'buick skylark 320']\n PRIMARY KEY (ID),\n CONSTRAINT fk_data_id FOREIGN KEY (ID) REFERENCES price (ID)\n);\n\nCREATE TABLE price (\n ID integer, -- example: [1, 2]\n price real, -- example: [25561.59078, 24221.42273]\n PRIMARY KEY (ID)\n);\n\nCREATE TABLE country (\n origin integer, -- example: [1, 2]\n PRIMARY KEY (origin)\n);\n\nCREATE TABLE production (\n ID integer, -- example: [1, 2]\n model_year integer, -- example: [1970, 1971]\n country integer, -- example: [1, 3]\n PRIMARY KEY (ID, model_year),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES price (ID),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES data (ID),\n CONSTRAINT fk_production_country FOREIGN KEY (country) REFERENCES country (origin)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nthe $32650.65157 car refers to price = 32650.65157; year refers to model\nWhen was the $32650.65157 car introduced to the market? State the 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.model FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T2.price = '32650.65157'",
"style": "rule"
} | {
"db_id": "cars.sqlite",
"gt_sql": "SELECT T1.model FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T2.price = '32650.65157'",
"index": 1518,
"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 data (\n ID integer, -- example: [1, 2]\n mpg real, -- mileage per gallon, example: [18.0, 15.0]\n cylinders integer, -- number of cylinders, example: [8, 4]\n displacement real, -- example: [307.0, 350.0]\n weight integer, -- example: [3504, 3693]\n model integer, -- example: [70, 71]\n car_name text, -- example: ['chevrolet chevelle malibu', 'buick skylark 320']\n PRIMARY KEY (ID),\n CONSTRAINT fk_data_id FOREIGN KEY (ID) REFERENCES price (ID)\n);\n\nCREATE TABLE price (\n ID integer, -- example: [1, 2]\n price real, -- example: [25561.59078, 24221.42273]\n PRIMARY KEY (ID)\n);\n\nCREATE TABLE country (\n origin integer, -- example: [1, 2]\n PRIMARY KEY (origin)\n);\n\nCREATE TABLE production (\n ID integer, -- example: [1, 2]\n model_year integer, -- example: [1970, 1971]\n country integer, -- example: [1, 3]\n PRIMARY KEY (ID, model_year),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES price (ID),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES data (ID),\n CONSTRAINT fk_production_country FOREIGN KEY (country) REFERENCES country (origin)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nthe $32650.65157 car refers to price = 32650.65157; year refers to model\nWhen was the $32650.65157 car introduced to the market? State the 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 country (\n origin integer, -- example: [1, 2]\n PRIMARY KEY (origin)\n);\n\nCREATE TABLE production (\n ID integer, -- example: [1, 2]\n model_year integer, -- example: [1970, 1971]\n country integer, -- example: [1, 3]\n PRIMARY KEY (ID, model_year),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES price (ID),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES data (ID),\n CONSTRAINT fk_production_country FOREIGN KEY (country) REFERENCES country (origin)\n);\n\nCREATE TABLE data (\n ID integer, -- example: [1, 2]\n cylinders integer, -- number of cylinders, example: [8, 4]\n displacement real, -- example: [307.0, 350.0]\n weight integer, -- example: [3504, 3693]\n acceleration real, -- example: [12.0, 11.5]\n car_name text, -- example: ['toyota corona hardtop', 'toyota corona', 'chevrolet chevelle malibu', 'buick skylark 320']\n PRIMARY KEY (ID),\n CONSTRAINT fk_data_id FOREIGN KEY (ID) REFERENCES price (ID)\n);\n\nCREATE TABLE price (\n ID integer, -- example: [1, 2]\n price real, -- example: [25561.59078, 24221.42273]\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:\nToyota Corona hardtop refers to car_name = 'toyota corona hardtop'\nProvide the price of the only Toyota Corona hardtop 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.price FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T1.car_name = 'toyota corona hardtop'",
"style": "rule"
} | {
"db_id": "cars.sqlite",
"gt_sql": "SELECT T2.price FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T1.car_name = 'toyota corona hardtop'",
"index": 1519,
"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 country (\n origin integer, -- example: [1, 2]\n PRIMARY KEY (origin)\n);\n\nCREATE TABLE production (\n ID integer, -- example: [1, 2]\n model_year integer, -- example: [1970, 1971]\n country integer, -- example: [1, 3]\n PRIMARY KEY (ID, model_year),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES price (ID),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES data (ID),\n CONSTRAINT fk_production_country FOREIGN KEY (country) REFERENCES country (origin)\n);\n\nCREATE TABLE data (\n ID integer, -- example: [1, 2]\n cylinders integer, -- number of cylinders, example: [8, 4]\n displacement real, -- example: [307.0, 350.0]\n weight integer, -- example: [3504, 3693]\n acceleration real, -- example: [12.0, 11.5]\n car_name text, -- example: ['toyota corona hardtop', 'toyota corona', 'chevrolet chevelle malibu', 'buick skylark 320']\n PRIMARY KEY (ID),\n CONSTRAINT fk_data_id FOREIGN KEY (ID) REFERENCES price (ID)\n);\n\nCREATE TABLE price (\n ID integer, -- example: [1, 2]\n price real, -- example: [25561.59078, 24221.42273]\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:\nToyota Corona hardtop refers to car_name = 'toyota corona hardtop'\nProvide the price of the only Toyota Corona hardtop 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 country (\n origin integer, -- example: [1, 2]\n PRIMARY KEY (origin)\n);\n\nCREATE TABLE production (\n ID integer, -- example: [1, 2]\n model_year integer, -- example: [1970, 1971]\n country integer, -- example: [1, 3]\n PRIMARY KEY (ID, model_year),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES price (ID),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES data (ID),\n CONSTRAINT fk_production_country FOREIGN KEY (country) REFERENCES country (origin)\n);\n\nCREATE TABLE price (\n ID integer, -- example: [1, 2]\n price real, -- example: [25561.59078, 24221.42273]\n PRIMARY KEY (ID)\n);\n\nCREATE TABLE data (\n ID integer, -- example: [1, 2]\n mpg real, -- mileage per gallon, example: [18.0, 15.0]\n weight integer, -- example: [3504, 3693]\n car_name text, -- example: ['chevrolet chevelle malibu', 'buick skylark 320']\n PRIMARY KEY (ID),\n CONSTRAINT fk_data_id FOREIGN KEY (ID) REFERENCES price (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 best crash protection refers to max(weight); cost refers to price\nWhich car in the database provides the best crash protection based on its weight? How much is it?\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.ID, T2.price FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID ORDER BY T1.weight DESC LIMIT 1",
"style": "rule"
} | {
"db_id": "cars.sqlite",
"gt_sql": "SELECT T1.ID, T2.price FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID ORDER BY T1.weight DESC LIMIT 1",
"index": 1520,
"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 country (\n origin integer, -- example: [1, 2]\n PRIMARY KEY (origin)\n);\n\nCREATE TABLE production (\n ID integer, -- example: [1, 2]\n model_year integer, -- example: [1970, 1971]\n country integer, -- example: [1, 3]\n PRIMARY KEY (ID, model_year),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES price (ID),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES data (ID),\n CONSTRAINT fk_production_country FOREIGN KEY (country) REFERENCES country (origin)\n);\n\nCREATE TABLE price (\n ID integer, -- example: [1, 2]\n price real, -- example: [25561.59078, 24221.42273]\n PRIMARY KEY (ID)\n);\n\nCREATE TABLE data (\n ID integer, -- example: [1, 2]\n mpg real, -- mileage per gallon, example: [18.0, 15.0]\n weight integer, -- example: [3504, 3693]\n car_name text, -- example: ['chevrolet chevelle malibu', 'buick skylark 320']\n PRIMARY KEY (ID),\n CONSTRAINT fk_data_id FOREIGN KEY (ID) REFERENCES price (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 best crash protection refers to max(weight); cost refers to price\nWhich car in the database provides the best crash protection based on its weight? How much is it?\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 price (\n ID integer, -- example: [1, 2]\n price real, -- example: [25561.59078, 24221.42273]\n PRIMARY KEY (ID)\n);\n\nCREATE TABLE country (\n origin integer, -- example: [1, 2]\n country text, -- example: ['USA', 'Europe']\n PRIMARY KEY (origin)\n);\n\nCREATE TABLE data (\n ID integer, -- example: [1, 2]\n mpg real, -- mileage per gallon, example: [18.0, 15.0]\n cylinders integer, -- number of cylinders, example: [8, 4]\n displacement real, -- example: [307.0, 350.0]\n horsepower integer, -- example: [130, 165]\n weight integer, -- example: [3504, 3693]\n acceleration real, -- example: [12.0, 11.5]\n model integer, -- example: [70, 71]\n car_name text, -- example: ['chevrolet chevelle malibu', 'buick skylark 320']\n PRIMARY KEY (ID),\n CONSTRAINT fk_data_id FOREIGN KEY (ID) REFERENCES price (ID)\n);\n\nCREATE TABLE production (\n ID integer, -- example: [1, 2]\n model_year integer, -- example: [1970, 1971]\n country integer, -- example: [1, 3]\n PRIMARY KEY (ID, model_year),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES price (ID),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES data (ID),\n CONSTRAINT fk_production_country FOREIGN KEY (country) REFERENCES country (origin)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\norigin country refers to country; the fastest refers to max(horsepower)\nState the origin country of the fastest car 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 T3.country FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID INNER JOIN country AS T3 ON T3.origin = T2.country ORDER BY T1.horsepower DESC LIMIT 1",
"style": "rule"
} | {
"db_id": "cars.sqlite",
"gt_sql": "SELECT T3.country FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID INNER JOIN country AS T3 ON T3.origin = T2.country ORDER BY T1.horsepower DESC LIMIT 1",
"index": 1521,
"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 price (\n ID integer, -- example: [1, 2]\n price real, -- example: [25561.59078, 24221.42273]\n PRIMARY KEY (ID)\n);\n\nCREATE TABLE country (\n origin integer, -- example: [1, 2]\n country text, -- example: ['USA', 'Europe']\n PRIMARY KEY (origin)\n);\n\nCREATE TABLE data (\n ID integer, -- example: [1, 2]\n mpg real, -- mileage per gallon, example: [18.0, 15.0]\n cylinders integer, -- number of cylinders, example: [8, 4]\n displacement real, -- example: [307.0, 350.0]\n horsepower integer, -- example: [130, 165]\n weight integer, -- example: [3504, 3693]\n acceleration real, -- example: [12.0, 11.5]\n model integer, -- example: [70, 71]\n car_name text, -- example: ['chevrolet chevelle malibu', 'buick skylark 320']\n PRIMARY KEY (ID),\n CONSTRAINT fk_data_id FOREIGN KEY (ID) REFERENCES price (ID)\n);\n\nCREATE TABLE production (\n ID integer, -- example: [1, 2]\n model_year integer, -- example: [1970, 1971]\n country integer, -- example: [1, 3]\n PRIMARY KEY (ID, model_year),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES price (ID),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES data (ID),\n CONSTRAINT fk_production_country FOREIGN KEY (country) REFERENCES country (origin)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\norigin country refers to country; the fastest refers to max(horsepower)\nState the origin country of the fastest car 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 production (\n ID integer, -- example: [1, 2]\n model_year integer, -- example: [1970, 1971]\n country integer, -- example: [1, 3]\n PRIMARY KEY (ID, model_year),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES price (ID),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES data (ID),\n CONSTRAINT fk_production_country FOREIGN KEY (country) REFERENCES country (origin)\n);\n\nCREATE TABLE country (\n origin integer, -- example: [1, 2]\n PRIMARY KEY (origin)\n);\n\nCREATE TABLE price (\n ID integer, -- example: [1, 2]\n price real, -- example: [25561.59078, 24221.42273]\n PRIMARY KEY (ID)\n);\n\nCREATE TABLE data (\n ID integer, -- example: [1, 2]\n car_name text, -- example: ['chevrolet chevelle malibu', 'buick skylark 320']\n PRIMARY KEY (ID),\n CONSTRAINT fk_data_id FOREIGN KEY (ID) REFERENCES price (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 car refers to car_name; the most expensive refers to max(price)\nWhat is the name of the most expensive car?\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.car_name FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID ORDER BY T2.price DESC LIMIT 1",
"style": "rule"
} | {
"db_id": "cars.sqlite",
"gt_sql": "SELECT T1.car_name FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID ORDER BY T2.price DESC LIMIT 1",
"index": 1522,
"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 production (\n ID integer, -- example: [1, 2]\n model_year integer, -- example: [1970, 1971]\n country integer, -- example: [1, 3]\n PRIMARY KEY (ID, model_year),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES price (ID),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES data (ID),\n CONSTRAINT fk_production_country FOREIGN KEY (country) REFERENCES country (origin)\n);\n\nCREATE TABLE country (\n origin integer, -- example: [1, 2]\n PRIMARY KEY (origin)\n);\n\nCREATE TABLE price (\n ID integer, -- example: [1, 2]\n price real, -- example: [25561.59078, 24221.42273]\n PRIMARY KEY (ID)\n);\n\nCREATE TABLE data (\n ID integer, -- example: [1, 2]\n car_name text, -- example: ['chevrolet chevelle malibu', 'buick skylark 320']\n PRIMARY KEY (ID),\n CONSTRAINT fk_data_id FOREIGN KEY (ID) REFERENCES price (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 car refers to car_name; the most expensive refers to max(price)\nWhat is the name of the most expensive car?\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 price (\n ID integer, -- example: [1, 2]\n PRIMARY KEY (ID)\n);\n\nCREATE TABLE production (\n ID integer, -- example: [1, 2]\n model_year integer, -- example: [1970, 1971]\n country integer, -- example: [1, 3]\n PRIMARY KEY (ID, model_year),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES price (ID),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES data (ID),\n CONSTRAINT fk_production_country FOREIGN KEY (country) REFERENCES country (origin)\n);\n\nCREATE TABLE country (\n origin integer, -- example: [1, 2]\n country text, -- example: ['USA', 'Europe']\n PRIMARY KEY (origin)\n);\n\nCREATE TABLE data (\n ID integer, -- example: [1, 2]\n mpg real, -- mileage per gallon, example: [18.0, 15.0]\n displacement real, -- example: [307.0, 350.0]\n horsepower integer, -- example: [130, 165]\n weight integer, -- example: [3504, 3693]\n model integer, -- example: [70, 71]\n PRIMARY KEY (ID),\n CONSTRAINT fk_data_id FOREIGN KEY (ID) REFERENCES price (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 the USA refers to country = 'USA'; in 1981 refers to model_year = 1981\nHow many cars were released in the USA in 1981?\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 production AS T1 INNER JOIN country AS T2 ON T1.country = T2.origin WHERE T2.country = 'USA' AND T1.model_year = 1981",
"style": "rule"
} | {
"db_id": "cars.sqlite",
"gt_sql": "SELECT COUNT(*) FROM production AS T1 INNER JOIN country AS T2 ON T1.country = T2.origin WHERE T2.country = 'USA' AND T1.model_year = 1981",
"index": 1523,
"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 price (\n ID integer, -- example: [1, 2]\n PRIMARY KEY (ID)\n);\n\nCREATE TABLE production (\n ID integer, -- example: [1, 2]\n model_year integer, -- example: [1970, 1971]\n country integer, -- example: [1, 3]\n PRIMARY KEY (ID, model_year),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES price (ID),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES data (ID),\n CONSTRAINT fk_production_country FOREIGN KEY (country) REFERENCES country (origin)\n);\n\nCREATE TABLE country (\n origin integer, -- example: [1, 2]\n country text, -- example: ['USA', 'Europe']\n PRIMARY KEY (origin)\n);\n\nCREATE TABLE data (\n ID integer, -- example: [1, 2]\n mpg real, -- mileage per gallon, example: [18.0, 15.0]\n displacement real, -- example: [307.0, 350.0]\n horsepower integer, -- example: [130, 165]\n weight integer, -- example: [3504, 3693]\n model integer, -- example: [70, 71]\n PRIMARY KEY (ID),\n CONSTRAINT fk_data_id FOREIGN KEY (ID) REFERENCES price (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 the USA refers to country = 'USA'; in 1981 refers to model_year = 1981\nHow many cars were released in the USA in 1981?\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 production (\n ID integer, -- example: [1, 2]\n model_year integer, -- example: [1970, 1971]\n country integer, -- example: [1, 3]\n PRIMARY KEY (ID, model_year),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES price (ID),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES data (ID),\n CONSTRAINT fk_production_country FOREIGN KEY (country) REFERENCES country (origin)\n);\n\nCREATE TABLE data (\n ID integer, -- example: [1, 2]\n mpg real, -- mileage per gallon, example: [18.0, 15.0]\n displacement real, -- example: [307.0, 350.0]\n horsepower integer, -- example: [130, 165]\n model integer, -- example: [70, 71]\n car_name text, -- example: ['ford maverick', 'chevrolet chevelle malibu', 'buick skylark 320']\n PRIMARY KEY (ID),\n CONSTRAINT fk_data_id FOREIGN KEY (ID) REFERENCES price (ID)\n);\n\nCREATE TABLE country (\n origin integer, -- example: [1, 2]\n country text, -- example: ['USA', 'Europe']\n PRIMARY KEY (origin)\n);\n\nCREATE TABLE price (\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:\nFord Maverick refers to car_name = 'ford maverick';\nHow many times was Ford Maverick introduced to the market?\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.model_year) FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID WHERE T1.car_name = 'ford maverick'",
"style": "rule"
} | {
"db_id": "cars.sqlite",
"gt_sql": "SELECT COUNT(T2.model_year) FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID WHERE T1.car_name = 'ford maverick'",
"index": 1524,
"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 production (\n ID integer, -- example: [1, 2]\n model_year integer, -- example: [1970, 1971]\n country integer, -- example: [1, 3]\n PRIMARY KEY (ID, model_year),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES price (ID),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES data (ID),\n CONSTRAINT fk_production_country FOREIGN KEY (country) REFERENCES country (origin)\n);\n\nCREATE TABLE data (\n ID integer, -- example: [1, 2]\n mpg real, -- mileage per gallon, example: [18.0, 15.0]\n displacement real, -- example: [307.0, 350.0]\n horsepower integer, -- example: [130, 165]\n model integer, -- example: [70, 71]\n car_name text, -- example: ['ford maverick', 'chevrolet chevelle malibu', 'buick skylark 320']\n PRIMARY KEY (ID),\n CONSTRAINT fk_data_id FOREIGN KEY (ID) REFERENCES price (ID)\n);\n\nCREATE TABLE country (\n origin integer, -- example: [1, 2]\n country text, -- example: ['USA', 'Europe']\n PRIMARY KEY (origin)\n);\n\nCREATE TABLE price (\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:\nFord Maverick refers to car_name = 'ford maverick';\nHow many times was Ford Maverick introduced to the market?\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 country (\n origin integer, -- example: [1, 2]\n country text, -- example: ['USA', 'Europe']\n PRIMARY KEY (origin)\n);\n\nCREATE TABLE price (\n ID integer, -- example: [1, 2]\n price real, -- example: [25561.59078, 24221.42273]\n PRIMARY KEY (ID)\n);\n\nCREATE TABLE production (\n ID integer, -- example: [1, 2]\n model_year integer, -- example: [1970, 1971]\n country integer, -- example: [1, 3]\n PRIMARY KEY (ID, model_year),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES price (ID),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES data (ID),\n CONSTRAINT fk_production_country FOREIGN KEY (country) REFERENCES country (origin)\n);\n\nCREATE TABLE data (\n ID integer, -- example: [1, 2]\n mpg real, -- mileage per gallon, example: [18.0, 15.0]\n horsepower integer, -- example: [130, 165]\n acceleration real, -- example: [12.0, 11.5]\n model integer, -- example: [70, 71]\n PRIMARY KEY (ID),\n CONSTRAINT fk_data_id FOREIGN KEY (ID) REFERENCES price (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 most fuel-efficient refers to max(mpg)\nWhich country produced the most fuel-efficient car?\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.country FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID INNER JOIN country AS T3 ON T3.origin = T2.country ORDER BY T1.mpg DESC LIMIT 1",
"style": "rule"
} | {
"db_id": "cars.sqlite",
"gt_sql": "SELECT T3.country FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID INNER JOIN country AS T3 ON T3.origin = T2.country ORDER BY T1.mpg DESC LIMIT 1",
"index": 1525,
"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 country (\n origin integer, -- example: [1, 2]\n country text, -- example: ['USA', 'Europe']\n PRIMARY KEY (origin)\n);\n\nCREATE TABLE price (\n ID integer, -- example: [1, 2]\n price real, -- example: [25561.59078, 24221.42273]\n PRIMARY KEY (ID)\n);\n\nCREATE TABLE production (\n ID integer, -- example: [1, 2]\n model_year integer, -- example: [1970, 1971]\n country integer, -- example: [1, 3]\n PRIMARY KEY (ID, model_year),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES price (ID),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES data (ID),\n CONSTRAINT fk_production_country FOREIGN KEY (country) REFERENCES country (origin)\n);\n\nCREATE TABLE data (\n ID integer, -- example: [1, 2]\n mpg real, -- mileage per gallon, example: [18.0, 15.0]\n horsepower integer, -- example: [130, 165]\n acceleration real, -- example: [12.0, 11.5]\n model integer, -- example: [70, 71]\n PRIMARY KEY (ID),\n CONSTRAINT fk_data_id FOREIGN KEY (ID) REFERENCES price (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 most fuel-efficient refers to max(mpg)\nWhich country produced the most fuel-efficient car?\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 country (\n origin integer, -- example: [1, 2]\n country text, -- example: ['USA', 'Europe']\n PRIMARY KEY (origin)\n);\n\nCREATE TABLE price (\n ID integer, -- example: [1, 2]\n price real, -- example: [25561.59078, 24221.42273]\n PRIMARY KEY (ID)\n);\n\nCREATE TABLE production (\n ID integer, -- example: [1, 2]\n model_year integer, -- example: [1970, 1971]\n country integer, -- example: [1, 3]\n PRIMARY KEY (ID, model_year),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES price (ID),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES data (ID),\n CONSTRAINT fk_production_country FOREIGN KEY (country) REFERENCES country (origin)\n);\n\nCREATE TABLE data (\n ID integer, -- example: [1, 2]\n cylinders integer, -- number of cylinders, example: [8, 4]\n horsepower integer, -- example: [130, 165]\n acceleration real, -- example: [12.0, 11.5]\n car_name text, -- example: ['chevrolet chevelle malibu', 'buick skylark 320']\n PRIMARY KEY (ID),\n CONSTRAINT fk_data_id FOREIGN KEY (ID) REFERENCES price (ID)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nDodge car refers to car_name LIKE 'dodge%'; the cheapest refers to min(price); name of the car refers to car_name\nWhich Dodge car is the cheapest?\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.car_name FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T1.car_name LIKE 'dodge%' ORDER BY T2.price ASC LIMIT 1",
"style": "rule"
} | {
"db_id": "cars.sqlite",
"gt_sql": "SELECT T1.car_name FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T1.car_name LIKE 'dodge%' ORDER BY T2.price ASC LIMIT 1",
"index": 1526,
"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 country (\n origin integer, -- example: [1, 2]\n country text, -- example: ['USA', 'Europe']\n PRIMARY KEY (origin)\n);\n\nCREATE TABLE price (\n ID integer, -- example: [1, 2]\n price real, -- example: [25561.59078, 24221.42273]\n PRIMARY KEY (ID)\n);\n\nCREATE TABLE production (\n ID integer, -- example: [1, 2]\n model_year integer, -- example: [1970, 1971]\n country integer, -- example: [1, 3]\n PRIMARY KEY (ID, model_year),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES price (ID),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES data (ID),\n CONSTRAINT fk_production_country FOREIGN KEY (country) REFERENCES country (origin)\n);\n\nCREATE TABLE data (\n ID integer, -- example: [1, 2]\n cylinders integer, -- number of cylinders, example: [8, 4]\n horsepower integer, -- example: [130, 165]\n acceleration real, -- example: [12.0, 11.5]\n car_name text, -- example: ['chevrolet chevelle malibu', 'buick skylark 320']\n PRIMARY KEY (ID),\n CONSTRAINT fk_data_id FOREIGN KEY (ID) REFERENCES price (ID)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nDodge car refers to car_name LIKE 'dodge%'; the cheapest refers to min(price); name of the car refers to car_name\nWhich Dodge car is the cheapest?\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 data (\n ID integer, -- example: [1, 2]\n car_name text, -- example: ['chevrolet chevelle malibu', 'buick skylark 320']\n PRIMARY KEY (ID),\n CONSTRAINT fk_data_id FOREIGN KEY (ID) REFERENCES price (ID)\n);\n\nCREATE TABLE price (\n ID integer, -- example: [1, 2]\n price real, -- example: [25561.59078, 24221.42273]\n PRIMARY KEY (ID)\n);\n\nCREATE TABLE production (\n ID integer, -- example: [1, 2]\n model_year integer, -- example: [1970, 1971]\n country integer, -- example: [1, 3]\n PRIMARY KEY (ID, model_year),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES price (ID),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES data (ID),\n CONSTRAINT fk_production_country FOREIGN KEY (country) REFERENCES country (origin)\n);\n\nCREATE TABLE country (\n origin integer, -- example: [1, 2]\n country text, -- example: ['USA', 'Europe']\n PRIMARY KEY (origin)\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 car refers to car_name; the most expensive refers to max(price); produced by the USA refers to country = 'USA'\nWhat is the name of the most expensive car that was produced by the USA?\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.car_name FROM price AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID INNER JOIN country AS T3 ON T3.origin = T2.country INNER JOIN data AS T4 ON T4.ID = T1.ID WHERE T3.country = 'USA' ORDER BY T1.price DESC LIMIT 1",
"style": "rule"
} | {
"db_id": "cars.sqlite",
"gt_sql": "SELECT T4.car_name FROM price AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID INNER JOIN country AS T3 ON T3.origin = T2.country INNER JOIN data AS T4 ON T4.ID = T1.ID WHERE T3.country = 'USA' ORDER BY T1.price DESC LIMIT 1",
"index": 1527,
"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 data (\n ID integer, -- example: [1, 2]\n car_name text, -- example: ['chevrolet chevelle malibu', 'buick skylark 320']\n PRIMARY KEY (ID),\n CONSTRAINT fk_data_id FOREIGN KEY (ID) REFERENCES price (ID)\n);\n\nCREATE TABLE price (\n ID integer, -- example: [1, 2]\n price real, -- example: [25561.59078, 24221.42273]\n PRIMARY KEY (ID)\n);\n\nCREATE TABLE production (\n ID integer, -- example: [1, 2]\n model_year integer, -- example: [1970, 1971]\n country integer, -- example: [1, 3]\n PRIMARY KEY (ID, model_year),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES price (ID),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES data (ID),\n CONSTRAINT fk_production_country FOREIGN KEY (country) REFERENCES country (origin)\n);\n\nCREATE TABLE country (\n origin integer, -- example: [1, 2]\n country text, -- example: ['USA', 'Europe']\n PRIMARY KEY (origin)\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 car refers to car_name; the most expensive refers to max(price); produced by the USA refers to country = 'USA'\nWhat is the name of the most expensive car that was produced by the USA?\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 country (\n origin integer, -- example: [1, 2]\n country text, -- example: ['USA', 'Europe']\n PRIMARY KEY (origin)\n);\n\nCREATE TABLE data (\n ID integer, -- example: [1, 2]\n model integer, -- example: [70, 71]\n car_name text, -- example: ['peugeot 505s turbo diesel', 'peugeot 504', 'chevrolet chevelle malibu', 'buick skylark 320']\n PRIMARY KEY (ID),\n CONSTRAINT fk_data_id FOREIGN KEY (ID) REFERENCES price (ID)\n);\n\nCREATE TABLE production (\n ID integer, -- example: [1, 2]\n model_year integer, -- example: [1970, 1971]\n country integer, -- example: [1, 3]\n PRIMARY KEY (ID, model_year),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES price (ID),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES data (ID),\n CONSTRAINT fk_production_country FOREIGN KEY (country) REFERENCES country (origin)\n);\n\nCREATE TABLE price (\n ID integer, -- example: [1, 2]\n price real, -- example: [25561.59078, 24221.42273]\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:\ncost refers to price; Peugeot 505s Turbo Diesel refers to car_name = 'peugeot 505s turbo diesel'\nHow much is the Peugeot 505s Turbo Diesel?\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.price FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T1.car_name = 'peugeot 505s turbo diesel'",
"style": "rule"
} | {
"db_id": "cars.sqlite",
"gt_sql": "SELECT T2.price FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T1.car_name = 'peugeot 505s turbo diesel'",
"index": 1528,
"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 country (\n origin integer, -- example: [1, 2]\n country text, -- example: ['USA', 'Europe']\n PRIMARY KEY (origin)\n);\n\nCREATE TABLE data (\n ID integer, -- example: [1, 2]\n model integer, -- example: [70, 71]\n car_name text, -- example: ['peugeot 505s turbo diesel', 'peugeot 504', 'chevrolet chevelle malibu', 'buick skylark 320']\n PRIMARY KEY (ID),\n CONSTRAINT fk_data_id FOREIGN KEY (ID) REFERENCES price (ID)\n);\n\nCREATE TABLE production (\n ID integer, -- example: [1, 2]\n model_year integer, -- example: [1970, 1971]\n country integer, -- example: [1, 3]\n PRIMARY KEY (ID, model_year),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES price (ID),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES data (ID),\n CONSTRAINT fk_production_country FOREIGN KEY (country) REFERENCES country (origin)\n);\n\nCREATE TABLE price (\n ID integer, -- example: [1, 2]\n price real, -- example: [25561.59078, 24221.42273]\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:\ncost refers to price; Peugeot 505s Turbo Diesel refers to car_name = 'peugeot 505s turbo diesel'\nHow much is the Peugeot 505s Turbo Diesel?\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 price (\n ID integer, -- example: [1, 2]\n price real, -- example: [25561.59078, 24221.42273]\n PRIMARY KEY (ID)\n);\n\nCREATE TABLE data (\n ID integer, -- example: [1, 2]\n mpg real, -- mileage per gallon, example: [18.0, 15.0]\n horsepower integer, -- example: [130, 165]\n weight integer, -- example: [3504, 3693]\n acceleration real, -- example: [12.0, 11.5]\n model integer, -- example: [70, 71]\n PRIMARY KEY (ID),\n CONSTRAINT fk_data_id FOREIGN KEY (ID) REFERENCES price (ID)\n);\n\nCREATE TABLE production (\n ID integer, -- example: [1, 2]\n model_year integer, -- example: [1970, 1971]\n country integer, -- example: [1, 3]\n PRIMARY KEY (ID, model_year),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES price (ID),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES data (ID),\n CONSTRAINT fk_production_country FOREIGN KEY (country) REFERENCES country (origin)\n);\n\nCREATE TABLE country (\n origin integer, -- example: [1, 2]\n country text, -- example: ['USA', 'Europe']\n PRIMARY KEY (origin)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nmiles per square hour refers to acceleration; the cheapest refers to min(price); produced by the USA refers to country = 'USA'\nWhat is the miles per square hour of the cheapest car produced by the USA?\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.acceleration FROM price AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID INNER JOIN country AS T3 ON T3.origin = T2.country INNER JOIN data AS T4 ON T4.ID = T1.ID WHERE T3.country = 'USA' ORDER BY T1.price ASC LIMIT 1",
"style": "rule"
} | {
"db_id": "cars.sqlite",
"gt_sql": "SELECT T4.acceleration FROM price AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID INNER JOIN country AS T3 ON T3.origin = T2.country INNER JOIN data AS T4 ON T4.ID = T1.ID WHERE T3.country = 'USA' ORDER BY T1.price ASC LIMIT 1",
"index": 1529,
"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 price (\n ID integer, -- example: [1, 2]\n price real, -- example: [25561.59078, 24221.42273]\n PRIMARY KEY (ID)\n);\n\nCREATE TABLE data (\n ID integer, -- example: [1, 2]\n mpg real, -- mileage per gallon, example: [18.0, 15.0]\n horsepower integer, -- example: [130, 165]\n weight integer, -- example: [3504, 3693]\n acceleration real, -- example: [12.0, 11.5]\n model integer, -- example: [70, 71]\n PRIMARY KEY (ID),\n CONSTRAINT fk_data_id FOREIGN KEY (ID) REFERENCES price (ID)\n);\n\nCREATE TABLE production (\n ID integer, -- example: [1, 2]\n model_year integer, -- example: [1970, 1971]\n country integer, -- example: [1, 3]\n PRIMARY KEY (ID, model_year),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES price (ID),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES data (ID),\n CONSTRAINT fk_production_country FOREIGN KEY (country) REFERENCES country (origin)\n);\n\nCREATE TABLE country (\n origin integer, -- example: [1, 2]\n country text, -- example: ['USA', 'Europe']\n PRIMARY KEY (origin)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nmiles per square hour refers to acceleration; the cheapest refers to min(price); produced by the USA refers to country = 'USA'\nWhat is the miles per square hour of the cheapest car produced by the USA?\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 data (\n ID integer, -- example: [1, 2]\n mpg real, -- mileage per gallon, example: [18.0, 15.0]\n cylinders integer, -- number of cylinders, example: [8, 4]\n horsepower integer, -- example: [130, 165]\n weight integer, -- example: [3504, 3693]\n acceleration real, -- example: [12.0, 11.5]\n car_name text, -- example: ['chevrolet chevelle malibu', 'buick skylark 320']\n PRIMARY KEY (ID),\n CONSTRAINT fk_data_id FOREIGN KEY (ID) REFERENCES price (ID)\n);\n\nCREATE TABLE price (\n ID integer, -- example: [1, 2]\n price real, -- example: [25561.59078, 24221.42273]\n PRIMARY KEY (ID)\n);\n\nCREATE TABLE country (\n origin integer, -- example: [1, 2]\n country text, -- example: ['Europe', 'USA']\n PRIMARY KEY (origin)\n);\n\nCREATE TABLE production (\n ID integer, -- example: [1, 2]\n model_year integer, -- example: [1970, 1971]\n country integer, -- example: [1, 3]\n PRIMARY KEY (ID, model_year),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES price (ID),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES data (ID),\n CONSTRAINT fk_production_country FOREIGN KEY (country) REFERENCES country (origin)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nfrom Europe refers to country = 'Europe'; average price = avg(price) where country = 'Europe'\nCalculate the average price of cars from 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 AVG(T1.price) FROM price AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID INNER JOIN country AS T3 ON T3.origin = T2.country WHERE T3.country = 'Europe'",
"style": "rule"
} | {
"db_id": "cars.sqlite",
"gt_sql": "SELECT AVG(T1.price) FROM price AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID INNER JOIN country AS T3 ON T3.origin = T2.country WHERE T3.country = 'Europe'",
"index": 1530,
"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 data (\n ID integer, -- example: [1, 2]\n mpg real, -- mileage per gallon, example: [18.0, 15.0]\n cylinders integer, -- number of cylinders, example: [8, 4]\n horsepower integer, -- example: [130, 165]\n weight integer, -- example: [3504, 3693]\n acceleration real, -- example: [12.0, 11.5]\n car_name text, -- example: ['chevrolet chevelle malibu', 'buick skylark 320']\n PRIMARY KEY (ID),\n CONSTRAINT fk_data_id FOREIGN KEY (ID) REFERENCES price (ID)\n);\n\nCREATE TABLE price (\n ID integer, -- example: [1, 2]\n price real, -- example: [25561.59078, 24221.42273]\n PRIMARY KEY (ID)\n);\n\nCREATE TABLE country (\n origin integer, -- example: [1, 2]\n country text, -- example: ['Europe', 'USA']\n PRIMARY KEY (origin)\n);\n\nCREATE TABLE production (\n ID integer, -- example: [1, 2]\n model_year integer, -- example: [1970, 1971]\n country integer, -- example: [1, 3]\n PRIMARY KEY (ID, model_year),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES price (ID),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES data (ID),\n CONSTRAINT fk_production_country FOREIGN KEY (country) REFERENCES country (origin)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nfrom Europe refers to country = 'Europe'; average price = avg(price) where country = 'Europe'\nCalculate the average price of cars from 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 production (\n ID integer, -- example: [1, 2]\n model_year integer, -- example: [1970, 1971]\n country integer, -- example: [1, 3]\n PRIMARY KEY (ID, model_year),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES price (ID),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES data (ID),\n CONSTRAINT fk_production_country FOREIGN KEY (country) REFERENCES country (origin)\n);\n\nCREATE TABLE data (\n ID integer, -- example: [1, 2]\n mpg real, -- mileage per gallon, example: [18.0, 15.0]\n cylinders integer, -- number of cylinders, example: [8, 4]\n horsepower integer, -- example: [130, 165]\n weight integer, -- example: [3504, 3693]\n car_name text, -- example: ['chevrolet chevelle malibu', 'buick skylark 320']\n PRIMARY KEY (ID),\n CONSTRAINT fk_data_id FOREIGN KEY (ID) REFERENCES price (ID)\n);\n\nCREATE TABLE country (\n origin integer, -- example: [1, 2]\n country text, -- example: ['Japan', 'USA', 'Europe']\n PRIMARY KEY (origin)\n);\n\nCREATE TABLE price (\n ID integer, -- example: [1, 2]\n price real, -- example: [25561.59078, 24221.42273]\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:\nfrom Japan refers to country = 'Japan'; weighed less than 3000 refers to weight < 3000\nHow many of the cars from Japan weighed less than 3000?\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 price AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID INNER JOIN country AS T3 ON T3.origin = T2.country INNER JOIN data AS T4 ON T4.ID = T1.ID WHERE T3.country = 'Japan' AND T4.weight < 3000",
"style": "rule"
} | {
"db_id": "cars.sqlite",
"gt_sql": "SELECT COUNT(*) FROM price AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID INNER JOIN country AS T3 ON T3.origin = T2.country INNER JOIN data AS T4 ON T4.ID = T1.ID WHERE T3.country = 'Japan' AND T4.weight < 3000",
"index": 1531,
"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 production (\n ID integer, -- example: [1, 2]\n model_year integer, -- example: [1970, 1971]\n country integer, -- example: [1, 3]\n PRIMARY KEY (ID, model_year),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES price (ID),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES data (ID),\n CONSTRAINT fk_production_country FOREIGN KEY (country) REFERENCES country (origin)\n);\n\nCREATE TABLE data (\n ID integer, -- example: [1, 2]\n mpg real, -- mileage per gallon, example: [18.0, 15.0]\n cylinders integer, -- number of cylinders, example: [8, 4]\n horsepower integer, -- example: [130, 165]\n weight integer, -- example: [3504, 3693]\n car_name text, -- example: ['chevrolet chevelle malibu', 'buick skylark 320']\n PRIMARY KEY (ID),\n CONSTRAINT fk_data_id FOREIGN KEY (ID) REFERENCES price (ID)\n);\n\nCREATE TABLE country (\n origin integer, -- example: [1, 2]\n country text, -- example: ['Japan', 'USA', 'Europe']\n PRIMARY KEY (origin)\n);\n\nCREATE TABLE price (\n ID integer, -- example: [1, 2]\n price real, -- example: [25561.59078, 24221.42273]\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:\nfrom Japan refers to country = 'Japan'; weighed less than 3000 refers to weight < 3000\nHow many of the cars from Japan weighed less than 3000?\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 data (\n ID integer, -- example: [1, 2]\n horsepower integer, -- example: [130, 165]\n acceleration real, -- example: [12.0, 11.5]\n model integer, -- example: [70, 71]\n PRIMARY KEY (ID),\n CONSTRAINT fk_data_id FOREIGN KEY (ID) REFERENCES price (ID)\n);\n\nCREATE TABLE production (\n ID integer, -- example: [1, 2]\n model_year integer, -- example: [1970, 1971]\n country integer, -- example: [1, 3]\n PRIMARY KEY (ID, model_year),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES price (ID),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES data (ID),\n CONSTRAINT fk_production_country FOREIGN KEY (country) REFERENCES country (origin)\n);\n\nCREATE TABLE country (\n origin integer, -- example: [1, 2]\n PRIMARY KEY (origin)\n);\n\nCREATE TABLE price (\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:\nproduced in year 1973 refers to model_year = 1973; have horsepower less than 100 refers to horsepower < 100\nAmong the cars produced in year 1973, how many of the cars have horsepower less than 100?\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 data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID WHERE T2.model_year = 1973 AND T1.horsepower < 100",
"style": "rule"
} | {
"db_id": "cars.sqlite",
"gt_sql": "SELECT COUNT(*) FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID WHERE T2.model_year = 1973 AND T1.horsepower < 100",
"index": 1532,
"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 data (\n ID integer, -- example: [1, 2]\n horsepower integer, -- example: [130, 165]\n acceleration real, -- example: [12.0, 11.5]\n model integer, -- example: [70, 71]\n PRIMARY KEY (ID),\n CONSTRAINT fk_data_id FOREIGN KEY (ID) REFERENCES price (ID)\n);\n\nCREATE TABLE production (\n ID integer, -- example: [1, 2]\n model_year integer, -- example: [1970, 1971]\n country integer, -- example: [1, 3]\n PRIMARY KEY (ID, model_year),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES price (ID),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES data (ID),\n CONSTRAINT fk_production_country FOREIGN KEY (country) REFERENCES country (origin)\n);\n\nCREATE TABLE country (\n origin integer, -- example: [1, 2]\n PRIMARY KEY (origin)\n);\n\nCREATE TABLE price (\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:\nproduced in year 1973 refers to model_year = 1973; have horsepower less than 100 refers to horsepower < 100\nAmong the cars produced in year 1973, how many of the cars have horsepower less than 100?\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 country (\n origin integer, -- example: [1, 2]\n country text, -- example: ['Japan', 'USA', 'Europe']\n PRIMARY KEY (origin)\n);\n\nCREATE TABLE price (\n ID integer, -- example: [1, 2]\n price real, -- example: [25561.59078, 24221.42273]\n PRIMARY KEY (ID)\n);\n\nCREATE TABLE data (\n ID integer, -- example: [1, 2]\n weight integer, -- example: [3504, 3693]\n acceleration real, -- example: [12.0, 11.5]\n PRIMARY KEY (ID),\n CONSTRAINT fk_data_id FOREIGN KEY (ID) REFERENCES price (ID)\n);\n\nCREATE TABLE production (\n ID integer, -- example: [1, 2]\n model_year integer, -- example: [1970, 1971]\n country integer, -- example: [1, 3]\n PRIMARY KEY (ID, model_year),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES price (ID),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES data (ID),\n CONSTRAINT fk_production_country FOREIGN KEY (country) REFERENCES country (origin)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nfrom Japan refers to country = 'Japan'; worth greater than 35000 refers to price > 35000; have an acceleration of 14 refers to acceleration = 14\nProvide the ID of cars from Japan worth greater than 35000 and have an acceleration of 14.\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.ID FROM price AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID INNER JOIN country AS T3 ON T3.origin = T2.country INNER JOIN data AS T4 ON T4.ID = T1.ID WHERE T3.country = 'Japan' AND T1.price > 3500 AND T4.acceleration = 14",
"style": "rule"
} | {
"db_id": "cars.sqlite",
"gt_sql": "SELECT T4.ID FROM price AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID INNER JOIN country AS T3 ON T3.origin = T2.country INNER JOIN data AS T4 ON T4.ID = T1.ID WHERE T3.country = 'Japan' AND T1.price > 3500 AND T4.acceleration = 14",
"index": 1533,
"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 country (\n origin integer, -- example: [1, 2]\n country text, -- example: ['Japan', 'USA', 'Europe']\n PRIMARY KEY (origin)\n);\n\nCREATE TABLE price (\n ID integer, -- example: [1, 2]\n price real, -- example: [25561.59078, 24221.42273]\n PRIMARY KEY (ID)\n);\n\nCREATE TABLE data (\n ID integer, -- example: [1, 2]\n weight integer, -- example: [3504, 3693]\n acceleration real, -- example: [12.0, 11.5]\n PRIMARY KEY (ID),\n CONSTRAINT fk_data_id FOREIGN KEY (ID) REFERENCES price (ID)\n);\n\nCREATE TABLE production (\n ID integer, -- example: [1, 2]\n model_year integer, -- example: [1970, 1971]\n country integer, -- example: [1, 3]\n PRIMARY KEY (ID, model_year),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES price (ID),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES data (ID),\n CONSTRAINT fk_production_country FOREIGN KEY (country) REFERENCES country (origin)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nfrom Japan refers to country = 'Japan'; worth greater than 35000 refers to price > 35000; have an acceleration of 14 refers to acceleration = 14\nProvide the ID of cars from Japan worth greater than 35000 and have an acceleration of 14.\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 country (\n origin integer, -- example: [1, 2]\n PRIMARY KEY (origin)\n);\n\nCREATE TABLE price (\n ID integer, -- example: [1, 2]\n PRIMARY KEY (ID)\n);\n\nCREATE TABLE data (\n ID integer, -- example: [1, 2]\n displacement real, -- example: [307.0, 350.0]\n horsepower integer, -- example: [130, 165]\n weight integer, -- example: [3504, 3693]\n model integer, -- example: [70, 71]\n car_name text, -- example: ['subaru dl', 'subaru', 'chevrolet chevelle malibu', 'buick skylark 320']\n PRIMARY KEY (ID),\n CONSTRAINT fk_data_id FOREIGN KEY (ID) REFERENCES price (ID)\n);\n\nCREATE TABLE production (\n ID integer, -- example: [1, 2]\n model_year integer, -- example: [1970, 1971]\n country integer, -- example: [1, 3]\n PRIMARY KEY (ID, model_year),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES price (ID),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES data (ID),\n CONSTRAINT fk_production_country FOREIGN KEY (country) REFERENCES country (origin)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nthe car named Subaru Dl refers to car_name = 'subaru dl'\nWhat is the horsepower and model year of the car named Subaru Dl?\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.horsepower, T2.model_year FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID WHERE T1.car_name = 'subaru dl'",
"style": "rule"
} | {
"db_id": "cars.sqlite",
"gt_sql": "SELECT T1.horsepower, T2.model_year FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID WHERE T1.car_name = 'subaru dl'",
"index": 1534,
"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 country (\n origin integer, -- example: [1, 2]\n PRIMARY KEY (origin)\n);\n\nCREATE TABLE price (\n ID integer, -- example: [1, 2]\n PRIMARY KEY (ID)\n);\n\nCREATE TABLE data (\n ID integer, -- example: [1, 2]\n displacement real, -- example: [307.0, 350.0]\n horsepower integer, -- example: [130, 165]\n weight integer, -- example: [3504, 3693]\n model integer, -- example: [70, 71]\n car_name text, -- example: ['subaru dl', 'subaru', 'chevrolet chevelle malibu', 'buick skylark 320']\n PRIMARY KEY (ID),\n CONSTRAINT fk_data_id FOREIGN KEY (ID) REFERENCES price (ID)\n);\n\nCREATE TABLE production (\n ID integer, -- example: [1, 2]\n model_year integer, -- example: [1970, 1971]\n country integer, -- example: [1, 3]\n PRIMARY KEY (ID, model_year),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES price (ID),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES data (ID),\n CONSTRAINT fk_production_country FOREIGN KEY (country) REFERENCES country (origin)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nthe car named Subaru Dl refers to car_name = 'subaru dl'\nWhat is the horsepower and model year of the car named Subaru Dl?\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 production (\n ID integer, -- example: [1, 2]\n model_year integer, -- example: [1970, 1971]\n country integer, -- example: [1, 3]\n PRIMARY KEY (ID, model_year),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES price (ID),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES data (ID),\n CONSTRAINT fk_production_country FOREIGN KEY (country) REFERENCES country (origin)\n);\n\nCREATE TABLE data (\n ID integer, -- example: [1, 2]\n mpg real, -- mileage per gallon, example: [18.0, 15.0]\n horsepower integer, -- example: [130, 165]\n weight integer, -- example: [3504, 3693]\n acceleration real, -- example: [12.0, 11.5]\n model integer, -- example: [70, 71]\n car_name text, -- example: ['chevrolet chevelle malibu', 'buick skylark 320']\n PRIMARY KEY (ID),\n CONSTRAINT fk_data_id FOREIGN KEY (ID) REFERENCES price (ID)\n);\n\nCREATE TABLE country (\n origin integer, -- example: [1, 2]\n country text, -- example: ['Japan', 'USA', 'Europe']\n PRIMARY KEY (origin)\n);\n\nCREATE TABLE price (\n ID integer, -- example: [1, 2]\n price real, -- example: [25561.59078, 24221.42273]\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:\nfrom Japan refers to country = 'Japan'; name of the car refers to car_name; the highest price refers to max(price)\nAmong the cars originated from Japan, what is the name of the car with the highest price?\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.car_name FROM price AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID INNER JOIN country AS T3 ON T3.origin = T2.country INNER JOIN data AS T4 ON T4.ID = T1.ID WHERE T3.country = 'Japan' ORDER BY T1.price DESC LIMIT 1",
"style": "rule"
} | {
"db_id": "cars.sqlite",
"gt_sql": "SELECT T4.car_name FROM price AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID INNER JOIN country AS T3 ON T3.origin = T2.country INNER JOIN data AS T4 ON T4.ID = T1.ID WHERE T3.country = 'Japan' ORDER BY T1.price DESC LIMIT 1",
"index": 1535,
"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 production (\n ID integer, -- example: [1, 2]\n model_year integer, -- example: [1970, 1971]\n country integer, -- example: [1, 3]\n PRIMARY KEY (ID, model_year),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES price (ID),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES data (ID),\n CONSTRAINT fk_production_country FOREIGN KEY (country) REFERENCES country (origin)\n);\n\nCREATE TABLE data (\n ID integer, -- example: [1, 2]\n mpg real, -- mileage per gallon, example: [18.0, 15.0]\n horsepower integer, -- example: [130, 165]\n weight integer, -- example: [3504, 3693]\n acceleration real, -- example: [12.0, 11.5]\n model integer, -- example: [70, 71]\n car_name text, -- example: ['chevrolet chevelle malibu', 'buick skylark 320']\n PRIMARY KEY (ID),\n CONSTRAINT fk_data_id FOREIGN KEY (ID) REFERENCES price (ID)\n);\n\nCREATE TABLE country (\n origin integer, -- example: [1, 2]\n country text, -- example: ['Japan', 'USA', 'Europe']\n PRIMARY KEY (origin)\n);\n\nCREATE TABLE price (\n ID integer, -- example: [1, 2]\n price real, -- example: [25561.59078, 24221.42273]\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:\nfrom Japan refers to country = 'Japan'; name of the car refers to car_name; the highest price refers to max(price)\nAmong the cars originated from Japan, what is the name of the car with the highest price?\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 production (\n ID integer, -- example: [1, 2]\n model_year integer, -- example: [1970, 1971]\n country integer, -- example: [1, 3]\n PRIMARY KEY (ID, model_year),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES price (ID),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES data (ID),\n CONSTRAINT fk_production_country FOREIGN KEY (country) REFERENCES country (origin)\n);\n\nCREATE TABLE country (\n origin integer, -- example: [1, 2]\n PRIMARY KEY (origin)\n);\n\nCREATE TABLE price (\n ID integer, -- example: [1, 2]\n price real, -- example: [25561.59078, 24221.42273]\n PRIMARY KEY (ID)\n);\n\nCREATE TABLE data (\n ID integer, -- example: [1, 2]\n car_name text, -- example: ['chevrolet chevelle malibu', 'buick skylark 320']\n PRIMARY KEY (ID),\n CONSTRAINT fk_data_id FOREIGN KEY (ID) REFERENCES price (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 car refers to car_name; worth 20000 refers to price = 20000\nWhat are the names of the cars worth 20000?\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.car_name FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T2.price = 20000",
"style": "rule"
} | {
"db_id": "cars.sqlite",
"gt_sql": "SELECT T1.car_name FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T2.price = 20000",
"index": 1536,
"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 production (\n ID integer, -- example: [1, 2]\n model_year integer, -- example: [1970, 1971]\n country integer, -- example: [1, 3]\n PRIMARY KEY (ID, model_year),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES price (ID),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES data (ID),\n CONSTRAINT fk_production_country FOREIGN KEY (country) REFERENCES country (origin)\n);\n\nCREATE TABLE country (\n origin integer, -- example: [1, 2]\n PRIMARY KEY (origin)\n);\n\nCREATE TABLE price (\n ID integer, -- example: [1, 2]\n price real, -- example: [25561.59078, 24221.42273]\n PRIMARY KEY (ID)\n);\n\nCREATE TABLE data (\n ID integer, -- example: [1, 2]\n car_name text, -- example: ['chevrolet chevelle malibu', 'buick skylark 320']\n PRIMARY KEY (ID),\n CONSTRAINT fk_data_id FOREIGN KEY (ID) REFERENCES price (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 car refers to car_name; worth 20000 refers to price = 20000\nWhat are the names of the cars worth 20000?\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 price (\n ID integer, -- example: [1, 2]\n price real, -- example: [25561.59078, 24221.42273]\n PRIMARY KEY (ID)\n);\n\nCREATE TABLE country (\n origin integer, -- example: [1, 2]\n country text, -- example: ['USA', 'Europe']\n PRIMARY KEY (origin)\n);\n\nCREATE TABLE production (\n ID integer, -- example: [1, 2]\n model_year integer, -- example: [1970, 1971]\n country integer, -- example: [1, 3]\n PRIMARY KEY (ID, model_year),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES price (ID),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES data (ID),\n CONSTRAINT fk_production_country FOREIGN KEY (country) REFERENCES country (origin)\n);\n\nCREATE TABLE data (\n ID integer, -- example: [1, 2]\n model integer, -- example: [70, 71]\n PRIMARY KEY (ID),\n CONSTRAINT fk_data_id FOREIGN KEY (ID) REFERENCES price (ID)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nworth greater than 40000 refers to price > 40000; from the USA refers to country = 'USA'\nHow many cars worth greater than 40000 were from the USA?\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 price AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID INNER JOIN country AS T3 ON T3.origin = T2.country WHERE T3.country = 'USA' AND T1.price > 40000",
"style": "rule"
} | {
"db_id": "cars.sqlite",
"gt_sql": "SELECT COUNT(*) FROM price AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID INNER JOIN country AS T3 ON T3.origin = T2.country WHERE T3.country = 'USA' AND T1.price > 40000",
"index": 1537,
"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 price (\n ID integer, -- example: [1, 2]\n price real, -- example: [25561.59078, 24221.42273]\n PRIMARY KEY (ID)\n);\n\nCREATE TABLE country (\n origin integer, -- example: [1, 2]\n country text, -- example: ['USA', 'Europe']\n PRIMARY KEY (origin)\n);\n\nCREATE TABLE production (\n ID integer, -- example: [1, 2]\n model_year integer, -- example: [1970, 1971]\n country integer, -- example: [1, 3]\n PRIMARY KEY (ID, model_year),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES price (ID),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES data (ID),\n CONSTRAINT fk_production_country FOREIGN KEY (country) REFERENCES country (origin)\n);\n\nCREATE TABLE data (\n ID integer, -- example: [1, 2]\n model integer, -- example: [70, 71]\n PRIMARY KEY (ID),\n CONSTRAINT fk_data_id FOREIGN KEY (ID) REFERENCES price (ID)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nworth greater than 40000 refers to price > 40000; from the USA refers to country = 'USA'\nHow many cars worth greater than 40000 were from the USA?\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 country (\n origin integer, -- example: [1, 2]\n country text, -- example: ['USA', 'Europe']\n PRIMARY KEY (origin)\n);\n\nCREATE TABLE data (\n ID integer, -- example: [1, 2]\n displacement real, -- example: [307.0, 350.0]\n horsepower integer, -- example: [130, 165]\n weight integer, -- example: [3504, 3693]\n acceleration real, -- example: [12.0, 11.5]\n model integer, -- example: [70, 71]\n car_name text, -- example: ['chevrolet chevelle malibu', 'buick skylark 320']\n PRIMARY KEY (ID),\n CONSTRAINT fk_data_id FOREIGN KEY (ID) REFERENCES price (ID)\n);\n\nCREATE TABLE price (\n ID integer, -- example: [1, 2]\n price real, -- example: [25561.59078, 24221.42273]\n PRIMARY KEY (ID)\n);\n\nCREATE TABLE production (\n ID integer, -- example: [1, 2]\n model_year integer, -- example: [1970, 1971]\n country integer, -- example: [1, 3]\n PRIMARY KEY (ID, model_year),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES price (ID),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES data (ID),\n CONSTRAINT fk_production_country FOREIGN KEY (country) REFERENCES country (origin)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\na horsepower of 130 refers to horsepower = 130; difference = subtract(count(ID where model_year = 1970), count(ID where model_year = 1976)) where horsepower = 130\nCalculate the difference between the number of cars that has a horsepower of 130 with the model year 1970 and model year 1976\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.model_year = 1970 THEN 1 ELSE 0 END) - SUM(CASE WHEN T2.model_year = 1976 THEN 1 ELSE 0 END) FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID WHERE T1.horsepower = 130",
"style": "rule"
} | {
"db_id": "cars.sqlite",
"gt_sql": "SELECT SUM(CASE WHEN T2.model_year = 1970 THEN 1 ELSE 0 END) - SUM(CASE WHEN T2.model_year = 1976 THEN 1 ELSE 0 END) FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID WHERE T1.horsepower = 130",
"index": 1538,
"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 country (\n origin integer, -- example: [1, 2]\n country text, -- example: ['USA', 'Europe']\n PRIMARY KEY (origin)\n);\n\nCREATE TABLE data (\n ID integer, -- example: [1, 2]\n displacement real, -- example: [307.0, 350.0]\n horsepower integer, -- example: [130, 165]\n weight integer, -- example: [3504, 3693]\n acceleration real, -- example: [12.0, 11.5]\n model integer, -- example: [70, 71]\n car_name text, -- example: ['chevrolet chevelle malibu', 'buick skylark 320']\n PRIMARY KEY (ID),\n CONSTRAINT fk_data_id FOREIGN KEY (ID) REFERENCES price (ID)\n);\n\nCREATE TABLE price (\n ID integer, -- example: [1, 2]\n price real, -- example: [25561.59078, 24221.42273]\n PRIMARY KEY (ID)\n);\n\nCREATE TABLE production (\n ID integer, -- example: [1, 2]\n model_year integer, -- example: [1970, 1971]\n country integer, -- example: [1, 3]\n PRIMARY KEY (ID, model_year),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES price (ID),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES data (ID),\n CONSTRAINT fk_production_country FOREIGN KEY (country) REFERENCES country (origin)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\na horsepower of 130 refers to horsepower = 130; difference = subtract(count(ID where model_year = 1970), count(ID where model_year = 1976)) where horsepower = 130\nCalculate the difference between the number of cars that has a horsepower of 130 with the model year 1970 and model year 1976\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 data (\n ID integer, -- example: [1, 2]\n mpg real, -- mileage per gallon, example: [18.0, 15.0]\n cylinders integer, -- number of cylinders, example: [8, 4]\n weight integer, -- example: [3504, 3693]\n model integer, -- example: [70, 71]\n car_name text, -- example: ['chevrolet chevelle malibu', 'buick skylark 320']\n PRIMARY KEY (ID),\n CONSTRAINT fk_data_id FOREIGN KEY (ID) REFERENCES price (ID)\n);\n\nCREATE TABLE production (\n ID integer, -- example: [1, 2]\n model_year integer, -- example: [1970, 1971]\n country integer, -- example: [1, 3]\n PRIMARY KEY (ID, model_year),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES price (ID),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES data (ID),\n CONSTRAINT fk_production_country FOREIGN KEY (country) REFERENCES country (origin)\n);\n\nCREATE TABLE price (\n ID integer, -- example: [1, 2]\n PRIMARY KEY (ID)\n);\n\nCREATE TABLE country (\n origin integer, -- example: [1, 2]\n country text, -- example: ['USA', 'Europe']\n PRIMARY KEY (origin)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nthe lowest mileage per gallon refers to min(mpg)\nWhich country produced the car with the lowest mileage per gallon?\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.country FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID INNER JOIN country AS T3 ON T3.origin = T2.country ORDER BY T1.mpg ASC LIMIT 1",
"style": "rule"
} | {
"db_id": "cars.sqlite",
"gt_sql": "SELECT T3.country FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID INNER JOIN country AS T3 ON T3.origin = T2.country ORDER BY T1.mpg ASC LIMIT 1",
"index": 1539,
"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 data (\n ID integer, -- example: [1, 2]\n mpg real, -- mileage per gallon, example: [18.0, 15.0]\n cylinders integer, -- number of cylinders, example: [8, 4]\n weight integer, -- example: [3504, 3693]\n model integer, -- example: [70, 71]\n car_name text, -- example: ['chevrolet chevelle malibu', 'buick skylark 320']\n PRIMARY KEY (ID),\n CONSTRAINT fk_data_id FOREIGN KEY (ID) REFERENCES price (ID)\n);\n\nCREATE TABLE production (\n ID integer, -- example: [1, 2]\n model_year integer, -- example: [1970, 1971]\n country integer, -- example: [1, 3]\n PRIMARY KEY (ID, model_year),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES price (ID),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES data (ID),\n CONSTRAINT fk_production_country FOREIGN KEY (country) REFERENCES country (origin)\n);\n\nCREATE TABLE price (\n ID integer, -- example: [1, 2]\n PRIMARY KEY (ID)\n);\n\nCREATE TABLE country (\n origin integer, -- example: [1, 2]\n country text, -- example: ['USA', 'Europe']\n PRIMARY KEY (origin)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nthe lowest mileage per gallon refers to min(mpg)\nWhich country produced the car with the lowest mileage per gallon?\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 price (\n ID integer, -- example: [1, 2]\n PRIMARY KEY (ID)\n);\n\nCREATE TABLE country (\n origin integer, -- example: [1, 2]\n country text, -- example: ['Europe', 'USA']\n PRIMARY KEY (origin)\n);\n\nCREATE TABLE data (\n ID integer, -- example: [1, 2]\n displacement real, -- example: [307.0, 350.0]\n horsepower integer, -- example: [130, 165]\n weight integer, -- example: [3504, 3693]\n acceleration real, -- example: [12.0, 11.5]\n model integer, -- example: [70, 71]\n car_name text, -- example: ['chevrolet chevelle malibu', 'buick skylark 320']\n PRIMARY KEY (ID),\n CONSTRAINT fk_data_id FOREIGN KEY (ID) REFERENCES price (ID)\n);\n\nCREATE TABLE production (\n ID integer, -- example: [1, 2]\n model_year integer, -- example: [1970, 1971]\n country integer, -- example: [1, 3]\n PRIMARY KEY (ID, model_year),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES price (ID),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES data (ID),\n CONSTRAINT fk_production_country FOREIGN KEY (country) REFERENCES country (origin)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nintroduced in 1977 refers to model_year = 1977; car's name refers to car_name; from Europe refers to country = 'Europe'\nAmong the cars introduced in 1977, provide the names and the horse powers of cars from 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 T1.car_name, T1.horsepower FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID INNER JOIN country AS T3 ON T3.origin = T2.country WHERE T2.model_year = 1977 AND T3.country = 'Europe'",
"style": "rule"
} | {
"db_id": "cars.sqlite",
"gt_sql": "SELECT T1.car_name, T1.horsepower FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID INNER JOIN country AS T3 ON T3.origin = T2.country WHERE T2.model_year = 1977 AND T3.country = 'Europe'",
"index": 1540,
"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 price (\n ID integer, -- example: [1, 2]\n PRIMARY KEY (ID)\n);\n\nCREATE TABLE country (\n origin integer, -- example: [1, 2]\n country text, -- example: ['Europe', 'USA']\n PRIMARY KEY (origin)\n);\n\nCREATE TABLE data (\n ID integer, -- example: [1, 2]\n displacement real, -- example: [307.0, 350.0]\n horsepower integer, -- example: [130, 165]\n weight integer, -- example: [3504, 3693]\n acceleration real, -- example: [12.0, 11.5]\n model integer, -- example: [70, 71]\n car_name text, -- example: ['chevrolet chevelle malibu', 'buick skylark 320']\n PRIMARY KEY (ID),\n CONSTRAINT fk_data_id FOREIGN KEY (ID) REFERENCES price (ID)\n);\n\nCREATE TABLE production (\n ID integer, -- example: [1, 2]\n model_year integer, -- example: [1970, 1971]\n country integer, -- example: [1, 3]\n PRIMARY KEY (ID, model_year),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES price (ID),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES data (ID),\n CONSTRAINT fk_production_country FOREIGN KEY (country) REFERENCES country (origin)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nintroduced in 1977 refers to model_year = 1977; car's name refers to car_name; from Europe refers to country = 'Europe'\nAmong the cars introduced in 1977, provide the names and the horse powers of cars from 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 country (\n origin integer, -- example: [1, 2]\n PRIMARY KEY (origin)\n);\n\nCREATE TABLE data (\n ID integer, -- example: [1, 2]\n cylinders integer, -- number of cylinders, example: [8, 4]\n horsepower integer, -- example: [130, 165]\n model integer, -- example: [70, 71]\n car_name text, -- example: ['chevrolet chevelle malibu', 'buick skylark 320']\n PRIMARY KEY (ID),\n CONSTRAINT fk_data_id FOREIGN KEY (ID) REFERENCES price (ID)\n);\n\nCREATE TABLE production (\n ID integer, -- example: [1, 2]\n model_year integer, -- example: [1970, 1971]\n country integer, -- example: [1, 3]\n PRIMARY KEY (ID, model_year),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES price (ID),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES data (ID),\n CONSTRAINT fk_production_country FOREIGN KEY (country) REFERENCES country (origin)\n);\n\nCREATE TABLE price (\n ID integer, -- example: [1, 2]\n price real, -- example: [25561.59078, 24221.42273]\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:\ncar's name refers to car_name; the highest price refers to max(price)\nProvide the name and model of the car with the highest price.\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.car_name, T1.model FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID ORDER BY T2.price DESC LIMIT 1",
"style": "rule"
} | {
"db_id": "cars.sqlite",
"gt_sql": "SELECT T1.car_name, T1.model FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID ORDER BY T2.price DESC LIMIT 1",
"index": 1541,
"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 country (\n origin integer, -- example: [1, 2]\n PRIMARY KEY (origin)\n);\n\nCREATE TABLE data (\n ID integer, -- example: [1, 2]\n cylinders integer, -- number of cylinders, example: [8, 4]\n horsepower integer, -- example: [130, 165]\n model integer, -- example: [70, 71]\n car_name text, -- example: ['chevrolet chevelle malibu', 'buick skylark 320']\n PRIMARY KEY (ID),\n CONSTRAINT fk_data_id FOREIGN KEY (ID) REFERENCES price (ID)\n);\n\nCREATE TABLE production (\n ID integer, -- example: [1, 2]\n model_year integer, -- example: [1970, 1971]\n country integer, -- example: [1, 3]\n PRIMARY KEY (ID, model_year),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES price (ID),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES data (ID),\n CONSTRAINT fk_production_country FOREIGN KEY (country) REFERENCES country (origin)\n);\n\nCREATE TABLE price (\n ID integer, -- example: [1, 2]\n price real, -- example: [25561.59078, 24221.42273]\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:\ncar's name refers to car_name; the highest price refers to max(price)\nProvide the name and model of the car with the highest price.\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 price (\n ID integer, -- example: [1, 2]\n price real, -- example: [25561.59078, 24221.42273]\n PRIMARY KEY (ID)\n);\n\nCREATE TABLE data (\n ID integer, -- example: [1, 2]\n mpg real, -- mileage per gallon, example: [18.0, 15.0]\n cylinders integer, -- number of cylinders, example: [8, 4]\n horsepower integer, -- example: [130, 165]\n acceleration real, -- example: [12.0, 11.5]\n model integer, -- example: [70, 71]\n car_name text, -- example: ['chevrolet chevelle malibu', 'buick skylark 320']\n PRIMARY KEY (ID),\n CONSTRAINT fk_data_id FOREIGN KEY (ID) REFERENCES price (ID)\n);\n\nCREATE TABLE country (\n origin integer, -- example: [1, 2]\n country text, -- example: ['USA', 'Europe']\n PRIMARY KEY (origin)\n);\n\nCREATE TABLE production (\n ID integer, -- example: [1, 2]\n model_year integer, -- example: [1970, 1971]\n country integer, -- example: [1, 3]\n PRIMARY KEY (ID, model_year),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES price (ID),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES data (ID),\n CONSTRAINT fk_production_country FOREIGN KEY (country) REFERENCES country (origin)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nproduced in 1975 refers to model_year = 1975; names refers to car_name; producing countries refers to country; the maximum number of cylinders refers to max(cylinders)\nAmong the cars produced in 1975, provide IDs, names, and producing countries of the cars with the maximum number of cylinders.\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.ID, T1.car_name, T3.country FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID INNER JOIN country AS T3 ON T3.origin = T2.country WHERE T2.model_year = 1975 ORDER BY T1.cylinders DESC LIMIT 1",
"style": "rule"
} | {
"db_id": "cars.sqlite",
"gt_sql": "SELECT T1.ID, T1.car_name, T3.country FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID INNER JOIN country AS T3 ON T3.origin = T2.country WHERE T2.model_year = 1975 ORDER BY T1.cylinders DESC LIMIT 1",
"index": 1542,
"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 price (\n ID integer, -- example: [1, 2]\n price real, -- example: [25561.59078, 24221.42273]\n PRIMARY KEY (ID)\n);\n\nCREATE TABLE data (\n ID integer, -- example: [1, 2]\n mpg real, -- mileage per gallon, example: [18.0, 15.0]\n cylinders integer, -- number of cylinders, example: [8, 4]\n horsepower integer, -- example: [130, 165]\n acceleration real, -- example: [12.0, 11.5]\n model integer, -- example: [70, 71]\n car_name text, -- example: ['chevrolet chevelle malibu', 'buick skylark 320']\n PRIMARY KEY (ID),\n CONSTRAINT fk_data_id FOREIGN KEY (ID) REFERENCES price (ID)\n);\n\nCREATE TABLE country (\n origin integer, -- example: [1, 2]\n country text, -- example: ['USA', 'Europe']\n PRIMARY KEY (origin)\n);\n\nCREATE TABLE production (\n ID integer, -- example: [1, 2]\n model_year integer, -- example: [1970, 1971]\n country integer, -- example: [1, 3]\n PRIMARY KEY (ID, model_year),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES price (ID),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES data (ID),\n CONSTRAINT fk_production_country FOREIGN KEY (country) REFERENCES country (origin)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nproduced in 1975 refers to model_year = 1975; names refers to car_name; producing countries refers to country; the maximum number of cylinders refers to max(cylinders)\nAmong the cars produced in 1975, provide IDs, names, and producing countries of the cars with the maximum number of cylinders.\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 country (\n origin integer, -- example: [1, 2]\n country text, -- example: ['USA', 'Europe']\n PRIMARY KEY (origin)\n);\n\nCREATE TABLE data (\n ID integer, -- example: [1, 2]\n mpg real, -- mileage per gallon, example: [18.0, 15.0]\n cylinders integer, -- number of cylinders, example: [8, 4]\n displacement real, -- example: [307.0, 350.0]\n horsepower integer, -- example: [130, 165]\n weight integer, -- example: [3504, 3693]\n acceleration real, -- example: [12.0, 11.5]\n model integer, -- example: [70, 71]\n car_name text, -- example: ['chevrolet chevelle malibu', 'buick skylark 320']\n PRIMARY KEY (ID),\n CONSTRAINT fk_data_id FOREIGN KEY (ID) REFERENCES price (ID)\n);\n\nCREATE TABLE production (\n ID integer, -- example: [1, 2]\n model_year integer, -- example: [1970, 1971]\n country integer, -- example: [1, 3]\n PRIMARY KEY (ID, model_year),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES price (ID),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES data (ID),\n CONSTRAINT fk_production_country FOREIGN KEY (country) REFERENCES country (origin)\n);\n\nCREATE TABLE price (\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:\nbelong to the USA refers to country = 'USA'; percentage = divide(count(ID where country = 'USA'), count(ID)) * 100%\nCalculate the percentage of cars that belong to the USA.\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 T2.country = 'USA' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM production AS T1 INNER JOIN country AS T2 ON T1.country = T2.origin",
"style": "rule"
} | {
"db_id": "cars.sqlite",
"gt_sql": "SELECT CAST(SUM(CASE WHEN T2.country = 'USA' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM production AS T1 INNER JOIN country AS T2 ON T1.country = T2.origin",
"index": 1543,
"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 country (\n origin integer, -- example: [1, 2]\n country text, -- example: ['USA', 'Europe']\n PRIMARY KEY (origin)\n);\n\nCREATE TABLE data (\n ID integer, -- example: [1, 2]\n mpg real, -- mileage per gallon, example: [18.0, 15.0]\n cylinders integer, -- number of cylinders, example: [8, 4]\n displacement real, -- example: [307.0, 350.0]\n horsepower integer, -- example: [130, 165]\n weight integer, -- example: [3504, 3693]\n acceleration real, -- example: [12.0, 11.5]\n model integer, -- example: [70, 71]\n car_name text, -- example: ['chevrolet chevelle malibu', 'buick skylark 320']\n PRIMARY KEY (ID),\n CONSTRAINT fk_data_id FOREIGN KEY (ID) REFERENCES price (ID)\n);\n\nCREATE TABLE production (\n ID integer, -- example: [1, 2]\n model_year integer, -- example: [1970, 1971]\n country integer, -- example: [1, 3]\n PRIMARY KEY (ID, model_year),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES price (ID),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES data (ID),\n CONSTRAINT fk_production_country FOREIGN KEY (country) REFERENCES country (origin)\n);\n\nCREATE TABLE price (\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:\nbelong to the USA refers to country = 'USA'; percentage = divide(count(ID where country = 'USA'), count(ID)) * 100%\nCalculate the percentage of cars that belong to the USA.\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 data (\n ID integer, -- example: [1, 2]\n mpg real, -- mileage per gallon, example: [18.0, 15.0]\n cylinders integer, -- number of cylinders, example: [8, 4]\n displacement real, -- example: [307.0, 350.0]\n horsepower integer, -- example: [130, 165]\n weight integer, -- example: [3504, 3693]\n acceleration real, -- example: [12.0, 11.5]\n model integer, -- example: [70, 71]\n car_name text, -- example: ['chevrolet chevelle malibu', 'buick skylark 320']\n PRIMARY KEY (ID),\n CONSTRAINT fk_data_id FOREIGN KEY (ID) REFERENCES price (ID)\n);\n\nCREATE TABLE price (\n ID integer, -- example: [1, 2]\n price real, -- example: [25561.59078, 24221.42273]\n PRIMARY KEY (ID)\n);\n\nCREATE TABLE country (\n origin integer, -- example: [1, 2]\n country text, -- example: ['USA', 'Europe']\n PRIMARY KEY (origin)\n);\n\nCREATE TABLE production (\n ID integer, -- example: [1, 2]\n model_year integer, -- example: [1970, 1971]\n country integer, -- example: [1, 3]\n PRIMARY KEY (ID, model_year),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES price (ID),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES data (ID),\n CONSTRAINT fk_production_country FOREIGN KEY (country) REFERENCES country (origin)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nmodel 70 refers to model = 70; average price = avg(price) where model = 70\nWhat is the average price of model 70 cars?\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 AVG(T2.price) FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T1.model = 70",
"style": "rule"
} | {
"db_id": "cars.sqlite",
"gt_sql": "SELECT AVG(T2.price) FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID WHERE T1.model = 70",
"index": 1544,
"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 data (\n ID integer, -- example: [1, 2]\n mpg real, -- mileage per gallon, example: [18.0, 15.0]\n cylinders integer, -- number of cylinders, example: [8, 4]\n displacement real, -- example: [307.0, 350.0]\n horsepower integer, -- example: [130, 165]\n weight integer, -- example: [3504, 3693]\n acceleration real, -- example: [12.0, 11.5]\n model integer, -- example: [70, 71]\n car_name text, -- example: ['chevrolet chevelle malibu', 'buick skylark 320']\n PRIMARY KEY (ID),\n CONSTRAINT fk_data_id FOREIGN KEY (ID) REFERENCES price (ID)\n);\n\nCREATE TABLE price (\n ID integer, -- example: [1, 2]\n price real, -- example: [25561.59078, 24221.42273]\n PRIMARY KEY (ID)\n);\n\nCREATE TABLE country (\n origin integer, -- example: [1, 2]\n country text, -- example: ['USA', 'Europe']\n PRIMARY KEY (origin)\n);\n\nCREATE TABLE production (\n ID integer, -- example: [1, 2]\n model_year integer, -- example: [1970, 1971]\n country integer, -- example: [1, 3]\n PRIMARY KEY (ID, model_year),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES price (ID),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES data (ID),\n CONSTRAINT fk_production_country FOREIGN KEY (country) REFERENCES country (origin)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nmodel 70 refers to model = 70; average price = avg(price) where model = 70\nWhat is the average price of model 70 cars?\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 production (\n ID integer, -- example: [1, 2]\n model_year integer, -- example: [1970, 1971]\n country integer, -- example: [1, 3]\n PRIMARY KEY (ID, model_year),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES price (ID),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES data (ID),\n CONSTRAINT fk_production_country FOREIGN KEY (country) REFERENCES country (origin)\n);\n\nCREATE TABLE price (\n ID integer, -- example: [1, 2]\n price real, -- example: [25561.59078, 24221.42273]\n PRIMARY KEY (ID)\n);\n\nCREATE TABLE data (\n ID integer, -- example: [1, 2]\n mpg real, -- mileage per gallon, example: [18.0, 15.0]\n displacement real, -- example: [307.0, 350.0]\n horsepower integer, -- example: [130, 165]\n weight integer, -- example: [3504, 3693]\n acceleration real, -- example: [12.0, 11.5]\n model integer, -- example: [70, 71]\n car_name text, -- example: ['chevrolet chevelle malibu', 'buick skylark 320']\n PRIMARY KEY (ID),\n CONSTRAINT fk_data_id FOREIGN KEY (ID) REFERENCES price (ID)\n);\n\nCREATE TABLE country (\n origin integer, -- example: [1, 2]\n country text, -- example: ['USA', 'Europe']\n PRIMARY KEY (origin)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\ncar's name refers to car_name; the most fuel efficient refers to max(mpg); in 1975 refers to model_year = 1975\nWhich is the most fuel efficient car in 1975?\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.car_name FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID WHERE T2.model_year = '1975' ORDER BY T1.mpg DESC LIMIT 1",
"style": "rule"
} | {
"db_id": "cars.sqlite",
"gt_sql": "SELECT T1.car_name FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID WHERE T2.model_year = '1975' ORDER BY T1.mpg DESC LIMIT 1",
"index": 1545,
"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 production (\n ID integer, -- example: [1, 2]\n model_year integer, -- example: [1970, 1971]\n country integer, -- example: [1, 3]\n PRIMARY KEY (ID, model_year),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES price (ID),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES data (ID),\n CONSTRAINT fk_production_country FOREIGN KEY (country) REFERENCES country (origin)\n);\n\nCREATE TABLE price (\n ID integer, -- example: [1, 2]\n price real, -- example: [25561.59078, 24221.42273]\n PRIMARY KEY (ID)\n);\n\nCREATE TABLE data (\n ID integer, -- example: [1, 2]\n mpg real, -- mileage per gallon, example: [18.0, 15.0]\n displacement real, -- example: [307.0, 350.0]\n horsepower integer, -- example: [130, 165]\n weight integer, -- example: [3504, 3693]\n acceleration real, -- example: [12.0, 11.5]\n model integer, -- example: [70, 71]\n car_name text, -- example: ['chevrolet chevelle malibu', 'buick skylark 320']\n PRIMARY KEY (ID),\n CONSTRAINT fk_data_id FOREIGN KEY (ID) REFERENCES price (ID)\n);\n\nCREATE TABLE country (\n origin integer, -- example: [1, 2]\n country text, -- example: ['USA', 'Europe']\n PRIMARY KEY (origin)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\ncar's name refers to car_name; the most fuel efficient refers to max(mpg); in 1975 refers to model_year = 1975\nWhich is the most fuel efficient car in 1975?\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 country (\n origin integer, -- example: [1, 2]\n PRIMARY KEY (origin)\n);\n\nCREATE TABLE data (\n ID integer, -- example: [1, 2]\n mpg real, -- mileage per gallon, example: [18.0, 15.0]\n cylinders integer, -- number of cylinders, example: [8, 4]\n displacement real, -- example: [307.0, 350.0]\n horsepower integer, -- example: [130, 165]\n car_name text, -- example: ['chevrolet chevelle malibu', 'buick skylark 320']\n PRIMARY KEY (ID),\n CONSTRAINT fk_data_id FOREIGN KEY (ID) REFERENCES price (ID)\n);\n\nCREATE TABLE price (\n ID integer, -- example: [1, 2]\n price real, -- example: [25561.59078, 24221.42273]\n PRIMARY KEY (ID)\n);\n\nCREATE TABLE production (\n ID integer, -- example: [1, 2]\n model_year integer, -- example: [1970, 1971]\n country integer, -- example: [1, 3]\n PRIMARY KEY (ID, model_year),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES price (ID),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES data (ID),\n CONSTRAINT fk_production_country FOREIGN KEY (country) REFERENCES country (origin)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nconsumes fuel the most refers to min(mpg); has the highest price refers to max(price)\nWhich car consumes fuel the most and has the highest price?\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.car_name FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID ORDER BY T1.mpg DESC, T2.price DESC LIMIT 1",
"style": "rule"
} | {
"db_id": "cars.sqlite",
"gt_sql": "SELECT T1.car_name FROM data AS T1 INNER JOIN price AS T2 ON T1.ID = T2.ID ORDER BY T1.mpg DESC, T2.price DESC LIMIT 1",
"index": 1546,
"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 country (\n origin integer, -- example: [1, 2]\n PRIMARY KEY (origin)\n);\n\nCREATE TABLE data (\n ID integer, -- example: [1, 2]\n mpg real, -- mileage per gallon, example: [18.0, 15.0]\n cylinders integer, -- number of cylinders, example: [8, 4]\n displacement real, -- example: [307.0, 350.0]\n horsepower integer, -- example: [130, 165]\n car_name text, -- example: ['chevrolet chevelle malibu', 'buick skylark 320']\n PRIMARY KEY (ID),\n CONSTRAINT fk_data_id FOREIGN KEY (ID) REFERENCES price (ID)\n);\n\nCREATE TABLE price (\n ID integer, -- example: [1, 2]\n price real, -- example: [25561.59078, 24221.42273]\n PRIMARY KEY (ID)\n);\n\nCREATE TABLE production (\n ID integer, -- example: [1, 2]\n model_year integer, -- example: [1970, 1971]\n country integer, -- example: [1, 3]\n PRIMARY KEY (ID, model_year),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES price (ID),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES data (ID),\n CONSTRAINT fk_production_country FOREIGN KEY (country) REFERENCES country (origin)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nconsumes fuel the most refers to min(mpg); has the highest price refers to max(price)\nWhich car consumes fuel the most and has the highest price?\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 country (\n origin integer, -- example: [1, 2]\n country text, -- example: ['USA', 'Europe']\n PRIMARY KEY (origin)\n);\n\nCREATE TABLE price (\n ID integer, -- example: [1, 2]\n price real, -- example: [25561.59078, 24221.42273]\n PRIMARY KEY (ID)\n);\n\nCREATE TABLE production (\n ID integer, -- example: [1, 2]\n model_year integer, -- example: [1970, 1971]\n country integer, -- example: [1, 3]\n PRIMARY KEY (ID, model_year),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES price (ID),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES data (ID),\n CONSTRAINT fk_production_country FOREIGN KEY (country) REFERENCES country (origin)\n);\n\nCREATE TABLE data (\n ID integer, -- example: [1, 2]\n weight integer, -- example: [3504, 3693]\n acceleration real, -- example: [12.0, 11.5]\n PRIMARY KEY (ID),\n CONSTRAINT fk_data_id FOREIGN KEY (ID) REFERENCES price (ID)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nAmerican car refers to country = 'USA'; an acceleration time of less than 12 seconds refers to acceleration < 12\nHow many American cars have an acceleration time of less than 12 seconds?\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 data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID INNER JOIN country AS T3 ON T3.origin = T2.country WHERE T3.country = 'USA' AND T1.acceleration < 12",
"style": "rule"
} | {
"db_id": "cars.sqlite",
"gt_sql": "SELECT COUNT(*) FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID INNER JOIN country AS T3 ON T3.origin = T2.country WHERE T3.country = 'USA' AND T1.acceleration < 12",
"index": 1547,
"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 country (\n origin integer, -- example: [1, 2]\n country text, -- example: ['USA', 'Europe']\n PRIMARY KEY (origin)\n);\n\nCREATE TABLE price (\n ID integer, -- example: [1, 2]\n price real, -- example: [25561.59078, 24221.42273]\n PRIMARY KEY (ID)\n);\n\nCREATE TABLE production (\n ID integer, -- example: [1, 2]\n model_year integer, -- example: [1970, 1971]\n country integer, -- example: [1, 3]\n PRIMARY KEY (ID, model_year),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES price (ID),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES data (ID),\n CONSTRAINT fk_production_country FOREIGN KEY (country) REFERENCES country (origin)\n);\n\nCREATE TABLE data (\n ID integer, -- example: [1, 2]\n weight integer, -- example: [3504, 3693]\n acceleration real, -- example: [12.0, 11.5]\n PRIMARY KEY (ID),\n CONSTRAINT fk_data_id FOREIGN KEY (ID) REFERENCES price (ID)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nAmerican car refers to country = 'USA'; an acceleration time of less than 12 seconds refers to acceleration < 12\nHow many American cars have an acceleration time of less than 12 seconds?\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 country (\n origin integer, -- example: [1, 2]\n country text, -- example: ['USA', 'Europe']\n PRIMARY KEY (origin)\n);\n\nCREATE TABLE price (\n ID integer, -- example: [1, 2]\n price real, -- example: [25561.59078, 24221.42273]\n PRIMARY KEY (ID)\n);\n\nCREATE TABLE production (\n ID integer, -- example: [1, 2]\n model_year integer, -- example: [1970, 1971]\n country integer, -- example: [1, 3]\n PRIMARY KEY (ID, model_year),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES price (ID),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES data (ID),\n CONSTRAINT fk_production_country FOREIGN KEY (country) REFERENCES country (origin)\n);\n\nCREATE TABLE data (\n ID integer, -- example: [1, 2]\n mpg real, -- mileage per gallon, example: [18.0, 15.0]\n cylinders integer, -- number of cylinders, example: [8, 4]\n displacement real, -- example: [307.0, 350.0]\n horsepower integer, -- example: [130, 165]\n weight integer, -- example: [3504, 3693]\n acceleration real, -- example: [12.0, 11.5]\n model integer, -- example: [70, 71]\n PRIMARY KEY (ID),\n CONSTRAINT fk_data_id FOREIGN KEY (ID) REFERENCES price (ID)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nAmerican car refers to country = 'USA'; percentage = divide(count(ID where country = 'USA'), count(ID)) * 100%\nCalculate the percentage of American cars among all cars.\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 T3.country = 'USA' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID INNER JOIN country AS T3 ON T3.origin = T2.country",
"style": "rule"
} | {
"db_id": "cars.sqlite",
"gt_sql": "SELECT CAST(SUM(CASE WHEN T3.country = 'USA' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID INNER JOIN country AS T3 ON T3.origin = T2.country",
"index": 1548,
"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 country (\n origin integer, -- example: [1, 2]\n country text, -- example: ['USA', 'Europe']\n PRIMARY KEY (origin)\n);\n\nCREATE TABLE price (\n ID integer, -- example: [1, 2]\n price real, -- example: [25561.59078, 24221.42273]\n PRIMARY KEY (ID)\n);\n\nCREATE TABLE production (\n ID integer, -- example: [1, 2]\n model_year integer, -- example: [1970, 1971]\n country integer, -- example: [1, 3]\n PRIMARY KEY (ID, model_year),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES price (ID),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES data (ID),\n CONSTRAINT fk_production_country FOREIGN KEY (country) REFERENCES country (origin)\n);\n\nCREATE TABLE data (\n ID integer, -- example: [1, 2]\n mpg real, -- mileage per gallon, example: [18.0, 15.0]\n cylinders integer, -- number of cylinders, example: [8, 4]\n displacement real, -- example: [307.0, 350.0]\n horsepower integer, -- example: [130, 165]\n weight integer, -- example: [3504, 3693]\n acceleration real, -- example: [12.0, 11.5]\n model integer, -- example: [70, 71]\n PRIMARY KEY (ID),\n CONSTRAINT fk_data_id FOREIGN KEY (ID) REFERENCES price (ID)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nAmerican car refers to country = 'USA'; percentage = divide(count(ID where country = 'USA'), count(ID)) * 100%\nCalculate the percentage of American cars among all cars.\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 production (\n ID integer, -- example: [1, 2]\n model_year integer, -- example: [1970, 1971]\n country integer, -- example: [1, 3]\n PRIMARY KEY (ID, model_year),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES price (ID),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES data (ID),\n CONSTRAINT fk_production_country FOREIGN KEY (country) REFERENCES country (origin)\n);\n\nCREATE TABLE price (\n ID integer, -- example: [1, 2]\n PRIMARY KEY (ID)\n);\n\nCREATE TABLE data (\n ID integer, -- example: [1, 2]\n mpg real, -- mileage per gallon, example: [18.0, 15.0]\n cylinders integer, -- number of cylinders, example: [8, 4]\n displacement real, -- example: [307.0, 350.0]\n horsepower integer, -- example: [130, 165]\n weight integer, -- example: [3504, 3693]\n model integer, -- example: [70, 71]\n PRIMARY KEY (ID),\n CONSTRAINT fk_data_id FOREIGN KEY (ID) REFERENCES price (ID)\n);\n\nCREATE TABLE country (\n origin integer, -- example: [1, 2]\n country text, -- example: ['Japan', 'USA', 'Europe']\n PRIMARY KEY (origin)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nJapanese car refers to country = 'Japan'; with 4 cylinders refers to cylinders = 4; produced from 1975 to 1980 refers to model_year BETWEEN 1975 AND 1980; average weight = avg(weight)\nWhat is the average weight of Japanese cars with 4 cylinders that were produced from 1975 to 1980?\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 AVG(T1.weight) FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID INNER JOIN country AS T3 ON T3.origin = T2.country WHERE T2.model_year BETWEEN 1975 AND 1980 AND T1.cylinders = 4 AND T3.country = 'Japan'",
"style": "rule"
} | {
"db_id": "cars.sqlite",
"gt_sql": "SELECT AVG(T1.weight) FROM data AS T1 INNER JOIN production AS T2 ON T1.ID = T2.ID INNER JOIN country AS T3 ON T3.origin = T2.country WHERE T2.model_year BETWEEN 1975 AND 1980 AND T1.cylinders = 4 AND T3.country = 'Japan'",
"index": 1549,
"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 production (\n ID integer, -- example: [1, 2]\n model_year integer, -- example: [1970, 1971]\n country integer, -- example: [1, 3]\n PRIMARY KEY (ID, model_year),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES price (ID),\n CONSTRAINT fk_production_id FOREIGN KEY (ID) REFERENCES data (ID),\n CONSTRAINT fk_production_country FOREIGN KEY (country) REFERENCES country (origin)\n);\n\nCREATE TABLE price (\n ID integer, -- example: [1, 2]\n PRIMARY KEY (ID)\n);\n\nCREATE TABLE data (\n ID integer, -- example: [1, 2]\n mpg real, -- mileage per gallon, example: [18.0, 15.0]\n cylinders integer, -- number of cylinders, example: [8, 4]\n displacement real, -- example: [307.0, 350.0]\n horsepower integer, -- example: [130, 165]\n weight integer, -- example: [3504, 3693]\n model integer, -- example: [70, 71]\n PRIMARY KEY (ID),\n CONSTRAINT fk_data_id FOREIGN KEY (ID) REFERENCES price (ID)\n);\n\nCREATE TABLE country (\n origin integer, -- example: [1, 2]\n country text, -- example: ['Japan', 'USA', 'Europe']\n PRIMARY KEY (origin)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nJapanese car refers to country = 'Japan'; with 4 cylinders refers to cylinders = 4; produced from 1975 to 1980 refers to model_year BETWEEN 1975 AND 1980; average weight = avg(weight)\nWhat is the average weight of Japanese cars with 4 cylinders that were produced from 1975 to 1980?\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_longitude real, -- example: [-119.608713, -96.72364]\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_nlns text, -- school Nonleafy Normal Stature, example: ['f', 't']\n primary_focus_area text, -- example: ['Literacy & Language', 'History & Civics']\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 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_total real, -- example: [50.0, 31.56]\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: ['donation', 'Donation', 'Payment', '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 PRIMARY KEY (resourceid),\n CONSTRAINT fk_resources_projectid FOREIGN KEY (projectid) REFERENCES projects (projectid)\n);\n\nCREATE TABLE essays (\n teacher_acctid text, -- example: ['c24011b20fc161ed02248e85beb59a90', '947066d0af47e0566f334566553dd6a6']\n title text, -- example: ['Calculate That', '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:\ntotal amount refers to sum(donation_total); 2011 refers to donation_timestamp LIKE'2011%'; honoree refers to for_honoree = 't'; via campaign page refers to via_giving_page = 't'\nCalculate the total amount of donations made in 2011 for an honoree with payment via campaign page.\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(donation_total) FROM donations WHERE donation_timestamp LIKE '2011%' AND via_giving_page = 't' AND for_honoree = 't'",
"style": "rule"
} | {
"db_id": "donor.sqlite",
"gt_sql": "SELECT SUM(donation_total) FROM donations WHERE donation_timestamp LIKE '2011%' AND via_giving_page = 't' AND for_honoree = 't'",
"index": 1550,
"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_longitude real, -- example: [-119.608713, -96.72364]\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_nlns text, -- school Nonleafy Normal Stature, example: ['f', 't']\n primary_focus_area text, -- example: ['Literacy & Language', 'History & Civics']\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 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_total real, -- example: [50.0, 31.56]\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: ['donation', 'Donation', 'Payment', '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 PRIMARY KEY (resourceid),\n CONSTRAINT fk_resources_projectid FOREIGN KEY (projectid) REFERENCES projects (projectid)\n);\n\nCREATE TABLE essays (\n teacher_acctid text, -- example: ['c24011b20fc161ed02248e85beb59a90', '947066d0af47e0566f334566553dd6a6']\n title text, -- example: ['Calculate That', '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:\ntotal amount refers to sum(donation_total); 2011 refers to donation_timestamp LIKE'2011%'; honoree refers to for_honoree = 't'; via campaign page refers to via_giving_page = 't'\nCalculate the total amount of donations made in 2011 for an honoree with payment via campaign page.\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: ['Other', 'Technology', 'Supplies']\n item_name text, -- example: ['Focus', 'Other', 'Flute', '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);\n\nCREATE TABLE projects (\n projectid text, -- example: ['00001ccc0e81598c4bd86bacb94d7acb', '00002bff514104264a6b798356fdd893']\n teacher_acctid text, -- example: ['42d43fa6f37314365d08692e08680973', '864eb466462bf704bf7a16a585ef296a']\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_district text, -- example: ['Other', 'Selma Unified Sch District', 'Richardson Ind School District']\n school_county text, -- example: ['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: ['Other', 'Literature & Writing', 'Literacy']\n primary_focus_area text, -- example: ['Literacy & Language', 'History & Civics']\n secondary_focus_subject text, -- example: ['Other', 'College & Career Prep', 'ESL']\n secondary_focus_area text, -- example: ['Applied Learning', 'Literacy & Language']\n resource_type text, -- example: ['Other', '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_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 essays (\n projectid text, -- example: ['ffffc4f85b60efc5b52347df489d0238', 'ffffac55ee02a49d1abc87ba6fc61135']\n teacher_acctid text, -- example: ['c24011b20fc161ed02248e85beb59a90', '947066d0af47e0566f334566553dd6a6']\n title text, -- example: ['Toot Your Flute!', 'Materials ', 'Materials', 'Flute', 'iMath', \"Recording Rockin' Readers\"]\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 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: ['MAIN', 'Peachtree City', 'Rockville']\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_included_optional_support text, -- example: ['t', 'f']\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);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nmain subject refers to primary_focus_subject\nFor project titled 'Toot Your Flute!', what is the main subject of the project materials intended for? Name the other projects with the similar focus.\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.primary_focus_subject FROM essays AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T1.title = 'Toot Your Flute!'",
"style": "rule"
} | {
"db_id": "donor.sqlite",
"gt_sql": "SELECT T2.primary_focus_subject FROM essays AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T1.title = 'Toot Your Flute!'",
"index": 1551,
"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: ['Other', 'Technology', 'Supplies']\n item_name text, -- example: ['Focus', 'Other', 'Flute', '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);\n\nCREATE TABLE projects (\n projectid text, -- example: ['00001ccc0e81598c4bd86bacb94d7acb', '00002bff514104264a6b798356fdd893']\n teacher_acctid text, -- example: ['42d43fa6f37314365d08692e08680973', '864eb466462bf704bf7a16a585ef296a']\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_district text, -- example: ['Other', 'Selma Unified Sch District', 'Richardson Ind School District']\n school_county text, -- example: ['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: ['Other', 'Literature & Writing', 'Literacy']\n primary_focus_area text, -- example: ['Literacy & Language', 'History & Civics']\n secondary_focus_subject text, -- example: ['Other', 'College & Career Prep', 'ESL']\n secondary_focus_area text, -- example: ['Applied Learning', 'Literacy & Language']\n resource_type text, -- example: ['Other', '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_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 essays (\n projectid text, -- example: ['ffffc4f85b60efc5b52347df489d0238', 'ffffac55ee02a49d1abc87ba6fc61135']\n teacher_acctid text, -- example: ['c24011b20fc161ed02248e85beb59a90', '947066d0af47e0566f334566553dd6a6']\n title text, -- example: ['Toot Your Flute!', 'Materials ', 'Materials', 'Flute', 'iMath', \"Recording Rockin' Readers\"]\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 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: ['MAIN', 'Peachtree City', 'Rockville']\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_included_optional_support text, -- example: ['t', 'f']\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);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nmain subject refers to primary_focus_subject\nFor project titled 'Toot Your Flute!', what is the main subject of the project materials intended for? Name the other projects with the similar focus.\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: ['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_acctid text, -- donor accid, example: ['22cbc920c9b5fa08dfb331422f5926b5', '521f1830a77c9dbbf8119d99c6206a16']\n donor_zip text, -- example: ['30269', '20853']\n is_teacher_acct text, -- example: ['f', 't']\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 payment_method text, -- example: ['no_cash_received', 'creditcard']\n payment_included_campaign_gift_card text, -- example: ['t', 'f']\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 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: ['ACQUIRE', 'Doctor', 'Doctors', 'iPod nano 4th Gen 8GB (Black)', 'Sony bloggie MHS-FS1 - camcorder - inter']\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 schoolid text, -- example: ['c0e6ce89b244764085691a1b8e28cb81', 'd711e47810900c96f26a5d0be30c446d']\n school_ncesid text, -- school national center for education statistics id, example: ['063627006187', '483702008193']\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_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: ['Dr.', '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 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 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);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nteacher who acquired a doctor degree refers to teacher_prefix = 'Dr.'\nName the project titles created by teacher who acquired a doctor degree.\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.title FROM essays AS T1 INNER JOIN donations AS T2 ON T1.projectid = T2.projectid WHERE T2.donation_message LIKE 'Donation on behalf of Matt Carpenter because I''m a strong believer in education.'",
"style": "rule"
} | {
"db_id": "donor.sqlite",
"gt_sql": "SELECT T1.title FROM essays AS T1 INNER JOIN donations AS T2 ON T1.projectid = T2.projectid WHERE T2.donation_message LIKE 'Donation on behalf of Matt Carpenter because I''m a strong believer in education.'",
"index": 1552,
"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: ['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_acctid text, -- donor accid, example: ['22cbc920c9b5fa08dfb331422f5926b5', '521f1830a77c9dbbf8119d99c6206a16']\n donor_zip text, -- example: ['30269', '20853']\n is_teacher_acct text, -- example: ['f', 't']\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 payment_method text, -- example: ['no_cash_received', 'creditcard']\n payment_included_campaign_gift_card text, -- example: ['t', 'f']\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 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: ['ACQUIRE', 'Doctor', 'Doctors', 'iPod nano 4th Gen 8GB (Black)', 'Sony bloggie MHS-FS1 - camcorder - inter']\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 schoolid text, -- example: ['c0e6ce89b244764085691a1b8e28cb81', 'd711e47810900c96f26a5d0be30c446d']\n school_ncesid text, -- school national center for education statistics id, example: ['063627006187', '483702008193']\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_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: ['Dr.', '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 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 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);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nteacher who acquired a doctor degree refers to teacher_prefix = 'Dr.'\nName the project titles created by teacher who acquired a doctor degree.\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_city text, -- example: ['Texas City', 'texas city', 'Donation', 'Texas', 'city', 'City']\n donor_zip text, -- example: ['30269', '20853']\n payment_included_web_purchased_gift_card text, -- example: ['f', 't']\n donation_message text, -- example: ['donation', 'Donation', 'Donate!', '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 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 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_kipp text, -- school Knowledge Is Power Program, example: ['f', 't']\n secondary_focus_area text, -- example: ['Applied Learning', 'Literacy & Language']\n fulfillment_labor_materials real, -- example: [30.0, 35.0]\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:\nfrom Texas City refers to donor_city = 'Texas City'; name of the project refers title\nFor all donors from Texas City, list their donation message and name of the project they donated to.\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.donation_message, T1.title FROM essays AS T1 INNER JOIN donations AS T2 ON T1.projectid = T2.projectid WHERE T2.donor_city = 'Texas City'",
"style": "rule"
} | {
"db_id": "donor.sqlite",
"gt_sql": "SELECT T2.donation_message, T1.title FROM essays AS T1 INNER JOIN donations AS T2 ON T1.projectid = T2.projectid WHERE T2.donor_city = 'Texas City'",
"index": 1553,
"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_city text, -- example: ['Texas City', 'texas city', 'Donation', 'Texas', 'city', 'City']\n donor_zip text, -- example: ['30269', '20853']\n payment_included_web_purchased_gift_card text, -- example: ['f', 't']\n donation_message text, -- example: ['donation', 'Donation', 'Donate!', '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 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 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_kipp text, -- school Knowledge Is Power Program, example: ['f', 't']\n secondary_focus_area text, -- example: ['Applied Learning', 'Literacy & Language']\n fulfillment_labor_materials real, -- example: [30.0, 35.0]\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:\nfrom Texas City refers to donor_city = 'Texas City'; name of the project refers title\nFor all donors from Texas City, list their donation message and name of the project they donated to.\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 donation_total real, -- example: [50.0, 31.56]\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 essays (\n projectid text, -- example: ['ffffc4f85b60efc5b52347df489d0238', 'ffffac55ee02a49d1abc87ba6fc61135']\n title text, -- example: ['Lights, Camera, Action!', 'Lights, Camera, Action', 'Camera, Action!', 'Camera', 'Lights, Camera, Action!!', 'iMath']\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 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: ['Resources', 'Action!', 'Action', 'Camera', 'item', 'Actions']\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 school_ncesid text, -- school national center for education statistics id, example: ['063627006187', '483702008193']\n school_county text, -- example: ['Price', 'Fresno', 'Dallas']\n school_charter 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: ['Literature & Writing', 'Literacy']\n secondary_focus_subject text, -- example: ['College & Career Prep', 'ESL']\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 'Lights, Camera, Action!' refers to title = 'Lights, Camera, Action!'\nName the vendors who provide resources for project 'Lights, Camera, Action!'. List all the item names and unit price for each.\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.vendor_name, T1.item_name, T1.item_unit_price FROM resources AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid INNER JOIN essays AS T3 ON T2.projectid = T3.projectid WHERE T3.title = 'Lights, Camera, Action!'",
"style": "rule"
} | {
"db_id": "donor.sqlite",
"gt_sql": "SELECT T1.vendor_name, T1.item_name, T1.item_unit_price FROM resources AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid INNER JOIN essays AS T3 ON T2.projectid = T3.projectid WHERE T3.title = 'Lights, Camera, Action!'",
"index": 1554,
"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 donation_total real, -- example: [50.0, 31.56]\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 essays (\n projectid text, -- example: ['ffffc4f85b60efc5b52347df489d0238', 'ffffac55ee02a49d1abc87ba6fc61135']\n title text, -- example: ['Lights, Camera, Action!', 'Lights, Camera, Action', 'Camera, Action!', 'Camera', 'Lights, Camera, Action!!', 'iMath']\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 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: ['Resources', 'Action!', 'Action', 'Camera', 'item', 'Actions']\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 school_ncesid text, -- school national center for education statistics id, example: ['063627006187', '483702008193']\n school_county text, -- example: ['Price', 'Fresno', 'Dallas']\n school_charter 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: ['Literature & Writing', 'Literacy']\n secondary_focus_subject text, -- example: ['College & Career Prep', 'ESL']\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 'Lights, Camera, Action!' refers to title = 'Lights, Camera, Action!'\nName the vendors who provide resources for project 'Lights, Camera, Action!'. List all the item names and unit price for each.\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: ['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 projects (\n projectid text, -- example: ['00001ccc0e81598c4bd86bacb94d7acb', '00002bff514104264a6b798356fdd893']\n school_zip integer, -- example: [93662, 75243]\n school_metro text, -- example: ['urban', 'rural']\n school_county text, -- example: ['Fresno', 'Dallas']\n school_magnet text, -- example: ['f', 't']\n school_charter_ready_promise 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 poverty_level text, -- example: ['highest poverty', 'high poverty']\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);\n\nCREATE TABLE resources (\n resourceid text, -- example: ['0000037fecc4461faf0e49328ae66661', '0000046b69c683354ca46b30db5c558e']\n projectid text, -- example: ['ffffc4f85b60efc5b52347df489d0238', 'ffffac55ee02a49d1abc87ba6fc61135']\n project_resource_type text, -- example: ['Technology', 'Supplies']\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);\n\nCREATE TABLE donations (\n donationid text, -- example: ['000000a91a14ed37bef82e125c102e77', '000013be53ed7382ed5d5975eb86eb85']\n projectid text, -- example: ['ffffac55ee02a49d1abc87ba6fc61135', 'ffff97ed93720407d70a2787475932b0']\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 payment_method text, -- example: ['no_cash_received', 'creditcard']\n payment_was_promo_matched 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:\nproject name refers to title; describe refers to short_description; New York teachers refers to teacher_ny_teaching_fellow = 't'\nName and describe all projects created by New York teachers.\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.title, T1.short_description FROM essays AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T2.teacher_ny_teaching_fellow = 't'",
"style": "rule"
} | {
"db_id": "donor.sqlite",
"gt_sql": "SELECT T1.title, T1.short_description FROM essays AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T2.teacher_ny_teaching_fellow = 't'",
"index": 1555,
"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: ['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 projects (\n projectid text, -- example: ['00001ccc0e81598c4bd86bacb94d7acb', '00002bff514104264a6b798356fdd893']\n school_zip integer, -- example: [93662, 75243]\n school_metro text, -- example: ['urban', 'rural']\n school_county text, -- example: ['Fresno', 'Dallas']\n school_magnet text, -- example: ['f', 't']\n school_charter_ready_promise 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 poverty_level text, -- example: ['highest poverty', 'high poverty']\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);\n\nCREATE TABLE resources (\n resourceid text, -- example: ['0000037fecc4461faf0e49328ae66661', '0000046b69c683354ca46b30db5c558e']\n projectid text, -- example: ['ffffc4f85b60efc5b52347df489d0238', 'ffffac55ee02a49d1abc87ba6fc61135']\n project_resource_type text, -- example: ['Technology', 'Supplies']\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);\n\nCREATE TABLE donations (\n donationid text, -- example: ['000000a91a14ed37bef82e125c102e77', '000013be53ed7382ed5d5975eb86eb85']\n projectid text, -- example: ['ffffac55ee02a49d1abc87ba6fc61135', 'ffff97ed93720407d70a2787475932b0']\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 payment_method text, -- example: ['no_cash_received', 'creditcard']\n payment_was_promo_matched 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:\nproject name refers to title; describe refers to short_description; New York teachers refers to teacher_ny_teaching_fellow = 't'\nName and describe all projects created by New York teachers.\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_longitude real, -- example: [-119.608713, -96.72364]\n school_city text, -- example: ['Divide', 'Selma', 'Dallas']\n school_state text, -- example: ['CA', 'TX']\n school_metro text, -- example: ['rural', 'urban']\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_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 secondary_focus_area text, -- example: ['Applied Learning', 'Literacy & Language']\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_almost_home_match text, -- example: ['f', 't']\n PRIMARY KEY (projectid)\n);\n\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 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 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', '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 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 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 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: ['Percentage', 'Area', '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);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nlocated in the rural area refers to school_metro = 'rural'; percentage = divide(sum(donation_to_project), sum(donation_to_project where school_metro = 'rural'))*100%\nFrom the total amount of donation to projects, what is the percentage of the amount is for school projects located in the rural area?\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 T2.school_metro = 'rural' THEN T1.donation_to_project ELSE 0 END) AS REAL) * 100 / SUM(donation_to_project) FROM donations AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid",
"style": "rule"
} | {
"db_id": "donor.sqlite",
"gt_sql": "SELECT CAST(SUM(CASE WHEN T2.school_metro = 'rural' THEN T1.donation_to_project ELSE 0 END) AS REAL) * 100 / SUM(donation_to_project) FROM donations AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid",
"index": 1556,
"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_longitude real, -- example: [-119.608713, -96.72364]\n school_city text, -- example: ['Divide', 'Selma', 'Dallas']\n school_state text, -- example: ['CA', 'TX']\n school_metro text, -- example: ['rural', 'urban']\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_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 secondary_focus_area text, -- example: ['Applied Learning', 'Literacy & Language']\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_almost_home_match text, -- example: ['f', 't']\n PRIMARY KEY (projectid)\n);\n\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 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 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', '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 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 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 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: ['Percentage', 'Area', '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);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nlocated in the rural area refers to school_metro = 'rural'; percentage = divide(sum(donation_to_project), sum(donation_to_project where school_metro = 'rural'))*100%\nFrom the total amount of donation to projects, what is the percentage of the amount is for school projects located in the rural area?\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 item_name text, -- example: ['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 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_latitude real, -- example: [36.57634, 32.911179]\n school_longitude real, -- example: [-119.608713, -96.72364]\n school_city text, -- example: ['Price', 'Selma', 'Dallas']\n school_state text, -- example: ['ID', '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: ['Price', '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 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 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_including_optional_support real, -- example: [653.89, 348.79]\n students_reached integer, -- example: [32, 22]\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: ['iMath', \"Recording Rockin' Readers\"]\n short_description text, -- example: ['It is imperative that teachers bring tec', '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: ['price', 'Peachtree City', 'Rockville']\n donor_state text, -- example: ['ID', 'GA', 'MD']\n donor_zip text, -- example: ['30269', '20853']\n is_teacher_acct text, -- example: ['f', 't']\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 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_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);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nhighest total price including optional support refers to max(total_price_including_optional_support)\nWhich project have the highest total price including optional support? Indicate the project id.\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 projectid FROM projects ORDER BY total_price_including_optional_support DESC LIMIT 1",
"style": "rule"
} | {
"db_id": "donor.sqlite",
"gt_sql": "SELECT projectid FROM projects ORDER BY total_price_including_optional_support DESC LIMIT 1",
"index": 1557,
"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 item_name text, -- example: ['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 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_latitude real, -- example: [36.57634, 32.911179]\n school_longitude real, -- example: [-119.608713, -96.72364]\n school_city text, -- example: ['Price', 'Selma', 'Dallas']\n school_state text, -- example: ['ID', '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: ['Price', '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 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 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_including_optional_support real, -- example: [653.89, 348.79]\n students_reached integer, -- example: [32, 22]\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: ['iMath', \"Recording Rockin' Readers\"]\n short_description text, -- example: ['It is imperative that teachers bring tec', '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: ['price', 'Peachtree City', 'Rockville']\n donor_state text, -- example: ['ID', 'GA', 'MD']\n donor_zip text, -- example: ['30269', '20853']\n is_teacher_acct text, -- example: ['f', 't']\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 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_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);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nhighest total price including optional support refers to max(total_price_including_optional_support)\nWhich project have the highest total price including optional support? Indicate the project id.\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_number text, -- example: ['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 essays (\n projectid text, -- example: ['ffffc4f85b60efc5b52347df489d0238', 'ffffac55ee02a49d1abc87ba6fc61135']\n title text, -- example: ['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 donor_acctid text, -- donor accid, example: ['22cbc920c9b5fa08dfb331422f5926b5', '521f1830a77c9dbbf8119d99c6206a16']\n donor_city text, -- example: ['Peachtree City', 'Rockville']\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 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 projects (\n projectid text, -- example: ['00001ccc0e81598c4bd86bacb94d7acb', '00002bff514104264a6b798356fdd893']\n teacher_acctid text, -- example: ['42d43fa6f37314365d08692e08680973', '864eb466462bf704bf7a16a585ef296a']\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: ['CA', 'TX']\n school_district text, -- example: ['Selma Unified Sch District', 'Richardson Ind School District']\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_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 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 students_reached integer, -- example: [32, 22]\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:\nfavorite project type refers to project_resource_type; top donors refers to max(donation_total)\nWhat are the favorite project types of each of the top 10 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 project_resource_type FROM ( SELECT T1.donor_acctid, T3.project_resource_type FROM donations AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid INNER JOIN resources AS T3 ON T2.projectid = T3.projectid ORDER BY T1.donation_total DESC LIMIT 10 ) GROUP BY project_resource_type ORDER BY COUNT(project_resource_type) DESC LIMIT 1",
"style": "rule"
} | {
"db_id": "donor.sqlite",
"gt_sql": "SELECT project_resource_type FROM ( SELECT T1.donor_acctid, T3.project_resource_type FROM donations AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid INNER JOIN resources AS T3 ON T2.projectid = T3.projectid ORDER BY T1.donation_total DESC LIMIT 10 ) GROUP BY project_resource_type ORDER BY COUNT(project_resource_type) DESC LIMIT 1",
"index": 1558,
"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_number text, -- example: ['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 essays (\n projectid text, -- example: ['ffffc4f85b60efc5b52347df489d0238', 'ffffac55ee02a49d1abc87ba6fc61135']\n title text, -- example: ['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 donor_acctid text, -- donor accid, example: ['22cbc920c9b5fa08dfb331422f5926b5', '521f1830a77c9dbbf8119d99c6206a16']\n donor_city text, -- example: ['Peachtree City', 'Rockville']\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 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 projects (\n projectid text, -- example: ['00001ccc0e81598c4bd86bacb94d7acb', '00002bff514104264a6b798356fdd893']\n teacher_acctid text, -- example: ['42d43fa6f37314365d08692e08680973', '864eb466462bf704bf7a16a585ef296a']\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: ['CA', 'TX']\n school_district text, -- example: ['Selma Unified Sch District', 'Richardson Ind School District']\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_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 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 students_reached integer, -- example: [32, 22]\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:\nfavorite project type refers to project_resource_type; top donors refers to max(donation_total)\nWhat are the favorite project types of each of the top 10 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 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_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 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 title text, -- example: ['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 projects (\n projectid text, -- example: ['00001ccc0e81598c4bd86bacb94d7acb', '00002bff514104264a6b798356fdd893']\n teacher_acctid text, -- example: ['42d43fa6f37314365d08692e08680973', '864eb466462bf704bf7a16a585ef296a']\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_zip integer, -- example: [93662, 75243]\n school_district text, -- example: ['Selma Unified Sch District', 'Richardson Ind School District']\n school_magnet text, -- 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_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 grade_level text, -- example: ['Grades 6-8', 'Grades PreK-2']\n total_price_excluding_optional_support real, -- example: [555.81, 296.47]\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);\n\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 item_name text, -- example: ['Resources', '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:\nproject \"iMath\" refers to title = 'iMath'\nWhat is the name of the vendor that supplies resources to the project \"iMath\"?\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 essays AS T3 ON T1.projectid = T3.projectid WHERE T3.title = 'iMath'",
"style": "rule"
} | {
"db_id": "donor.sqlite",
"gt_sql": "SELECT DISTINCT T1.vendor_name FROM resources AS T1 INNER JOIN essays AS T3 ON T1.projectid = T3.projectid WHERE T3.title = 'iMath'",
"index": 1559,
"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_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 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 title text, -- example: ['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 projects (\n projectid text, -- example: ['00001ccc0e81598c4bd86bacb94d7acb', '00002bff514104264a6b798356fdd893']\n teacher_acctid text, -- example: ['42d43fa6f37314365d08692e08680973', '864eb466462bf704bf7a16a585ef296a']\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_zip integer, -- example: [93662, 75243]\n school_district text, -- example: ['Selma Unified Sch District', 'Richardson Ind School District']\n school_magnet text, -- 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_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 grade_level text, -- example: ['Grades 6-8', 'Grades PreK-2']\n total_price_excluding_optional_support real, -- example: [555.81, 296.47]\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);\n\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 item_name text, -- example: ['Resources', '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:\nproject \"iMath\" refers to title = 'iMath'\nWhat is the name of the vendor that supplies resources to the project \"iMath\"?\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_longitude real, -- example: [-119.608713, -96.72364]\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_county text, -- example: ['Fresno', 'Dallas']\n school_charter text, -- example: ['f', 't']\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 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 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);\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 donor_state text, -- example: ['GA', 'MD']\n is_teacher_acct text, -- example: ['f', 't']\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 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 essays (\n projectid text, -- example: ['ffffc4f85b60efc5b52347df489d0238', 'ffffac55ee02a49d1abc87ba6fc61135']\n teacher_acctid text, -- example: ['c24011b20fc161ed02248e85beb59a90', '947066d0af47e0566f334566553dd6a6']\n title text, -- example: ['Materials ', 'Materials', 'iMath', \"Recording Rockin' Readers\"]\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 vendor_name text, -- example: ['Woodwind and Brasswind', 'Best Buy for Business']\n item_name text, -- example: ['Max', 'MAX', 'iPod nano 4th Gen 8GB (Black)', 'Sony bloggie MHS-FS1 - camcorder - inter']\n item_number text, -- example: ['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);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nproject with the highest quantity refers to max(item_quantity)\nWhen was the project with the highest quantity went live on the site? Indicate the grade level for which the project materials are intended.\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.date_posted, T2.grade_level FROM resources AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid ORDER BY T1.item_quantity DESC LIMIT 1",
"style": "rule"
} | {
"db_id": "donor.sqlite",
"gt_sql": "SELECT T2.date_posted, T2.grade_level FROM resources AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid ORDER BY T1.item_quantity DESC LIMIT 1",
"index": 1560,
"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_longitude real, -- example: [-119.608713, -96.72364]\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_county text, -- example: ['Fresno', 'Dallas']\n school_charter text, -- example: ['f', 't']\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 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 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);\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 donor_state text, -- example: ['GA', 'MD']\n is_teacher_acct text, -- example: ['f', 't']\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 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 essays (\n projectid text, -- example: ['ffffc4f85b60efc5b52347df489d0238', 'ffffac55ee02a49d1abc87ba6fc61135']\n teacher_acctid text, -- example: ['c24011b20fc161ed02248e85beb59a90', '947066d0af47e0566f334566553dd6a6']\n title text, -- example: ['Materials ', 'Materials', 'iMath', \"Recording Rockin' Readers\"]\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 vendor_name text, -- example: ['Woodwind and Brasswind', 'Best Buy for Business']\n item_name text, -- example: ['Max', 'MAX', 'iPod nano 4th Gen 8GB (Black)', 'Sony bloggie MHS-FS1 - camcorder - inter']\n item_number text, -- example: ['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);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nproject with the highest quantity refers to max(item_quantity)\nWhen was the project with the highest quantity went live on the site? Indicate the grade level for which the project materials are intended.\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: ['Donation', 'Divide', 'price', 'Many', 'Peachtree City', 'Rockville']\n donor_zip text, -- example: ['30269', '20853']\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_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', ' support!', 'Support.', 'Support!', 'Donate!']\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 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 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: ['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', 'Price', 'Fresno', 'Dallas']\n school_charter text, -- example: ['f', 't']\n school_magnet text, -- 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_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 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: ['She', 'Max', 'MAX', '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 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 total price excluding optional support refers to max(total_price_excluding_optional_support); who refers to donor_acctid; percent = divide(donation_to_project, total_price_excluding_optional_support)*100%\nWhat is the essay title of the project that have the highest total price excluding optional support and who is the biggest donor? Identify the donor and calculate how many percent did he/she donated in the project.\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.title, T3.donor_acctid, CAST(T3.donation_to_project AS REAL) / T2.total_price_excluding_optional_support FROM essays AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid INNER JOIN donations AS T3 ON T2.projectid = T3.projectid ORDER BY T3.donation_to_project DESC LIMIT 1",
"style": "rule"
} | {
"db_id": "donor.sqlite",
"gt_sql": "SELECT T1.title, T3.donor_acctid, CAST(T3.donation_to_project AS REAL) / T2.total_price_excluding_optional_support FROM essays AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid INNER JOIN donations AS T3 ON T2.projectid = T3.projectid ORDER BY T3.donation_to_project DESC LIMIT 1",
"index": 1561,
"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: ['Donation', 'Divide', 'price', 'Many', 'Peachtree City', 'Rockville']\n donor_zip text, -- example: ['30269', '20853']\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_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', ' support!', 'Support.', 'Support!', 'Donate!']\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 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 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: ['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', 'Price', 'Fresno', 'Dallas']\n school_charter text, -- example: ['f', 't']\n school_magnet text, -- 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_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 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: ['She', 'Max', 'MAX', '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 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 total price excluding optional support refers to max(total_price_excluding_optional_support); who refers to donor_acctid; percent = divide(donation_to_project, total_price_excluding_optional_support)*100%\nWhat is the essay title of the project that have the highest total price excluding optional support and who is the biggest donor? Identify the donor and calculate how many percent did he/she donated in the project.\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: ['brooklyn', 'BROOKLYN', 'bROOKLYN', 'Brooklyn', 'Brooklyn ,', 'Brooklyn,']\n donor_state text, -- example: ['ID', 'GA', 'MD']\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 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 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 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 title text, -- example: ['iMath', \"Recording Rockin' Readers\"]\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 vendor_name text, -- example: ['Woodwind and Brasswind', 'Best Buy for Business']\n project_resource_type text, -- example: ['Technology', 'Supplies']\n item_name text, -- example: ['Resources', 'Brooklyn', 'Request', 'Count', 'item', 'Max']\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: ['BROOKLYN', 'Brooklyn', 'Selma', 'Dallas']\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_charter text, -- example: ['f', 't']\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 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_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 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 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:\nin Brooklyn refers to school_city = 'Brooklyn'; highest request of resources refers to max(count(T1.item_name))\nWhich project in Brooklyn that have the highest request of resources? State the the project ID including all of the name of item requested.\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.projectid, T1.item_name FROM resources AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T2.school_city LIKE 'Brooklyn' GROUP BY T1.item_name ORDER BY COUNT(T1.item_name) DESC LIMIT 1",
"style": "rule"
} | {
"db_id": "donor.sqlite",
"gt_sql": "SELECT T1.projectid, T1.item_name FROM resources AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T2.school_city LIKE 'Brooklyn' GROUP BY T1.item_name ORDER BY COUNT(T1.item_name) DESC LIMIT 1",
"index": 1562,
"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: ['brooklyn', 'BROOKLYN', 'bROOKLYN', 'Brooklyn', 'Brooklyn ,', 'Brooklyn,']\n donor_state text, -- example: ['ID', 'GA', 'MD']\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 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 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 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 title text, -- example: ['iMath', \"Recording Rockin' Readers\"]\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 vendor_name text, -- example: ['Woodwind and Brasswind', 'Best Buy for Business']\n project_resource_type text, -- example: ['Technology', 'Supplies']\n item_name text, -- example: ['Resources', 'Brooklyn', 'Request', 'Count', 'item', 'Max']\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: ['BROOKLYN', 'Brooklyn', 'Selma', 'Dallas']\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_charter text, -- example: ['f', 't']\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 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_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 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 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:\nin Brooklyn refers to school_city = 'Brooklyn'; highest request of resources refers to max(count(T1.item_name))\nWhich project in Brooklyn that have the highest request of resources? State the the project ID including all of the name of item requested.\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 project_resource_type text, -- example: ['Technology', 'Supplies']\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 essays (\n projectid text, -- example: ['ffffc4f85b60efc5b52347df489d0238', 'ffffac55ee02a49d1abc87ba6fc61135']\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_metro text, -- example: ['urban', 'rural']\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 total_price_excluding_optional_support real, -- example: [555.81, 296.47]\n PRIMARY KEY (projectid)\n);\n\nCREATE TABLE donations (\n donationid text, -- example: ['000000a91a14ed37bef82e125c102e77', '000013be53ed7382ed5d5975eb86eb85']\n projectid text, -- example: ['ffffac55ee02a49d1abc87ba6fc61135', 'ffff97ed93720407d70a2787475932b0']\n donor_state text, -- example: ['GA', 'MD']\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 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:\nurban area refers to school_metro = 'urban'; books resources refers to project_resource_type = 'Books'\nHow many schools in urban area requested for books resources?\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 WHERE T2.resource_type = 'Books' AND T2.school_metro = 'urban'",
"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 WHERE T2.resource_type = 'Books' AND T2.school_metro = 'urban'",
"index": 1563,
"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 project_resource_type text, -- example: ['Technology', 'Supplies']\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 essays (\n projectid text, -- example: ['ffffc4f85b60efc5b52347df489d0238', 'ffffac55ee02a49d1abc87ba6fc61135']\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_metro text, -- example: ['urban', 'rural']\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 total_price_excluding_optional_support real, -- example: [555.81, 296.47]\n PRIMARY KEY (projectid)\n);\n\nCREATE TABLE donations (\n donationid text, -- example: ['000000a91a14ed37bef82e125c102e77', '000013be53ed7382ed5d5975eb86eb85']\n projectid text, -- example: ['ffffac55ee02a49d1abc87ba6fc61135', 'ffff97ed93720407d70a2787475932b0']\n donor_state text, -- example: ['GA', 'MD']\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 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:\nurban area refers to school_metro = 'urban'; books resources refers to project_resource_type = 'Books'\nHow many schools in urban area requested for books resources?\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: ['Reading About Other Cultures', '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 project_resource_type text, -- example: ['Other', 'Technology', 'Supplies']\n item_name text, -- example: ['Handle', 'Other', 'Handles', 'iPod nano 4th Gen 8GB (Black)', 'Sony bloggie MHS-FS1 - camcorder - inter']\n item_number text, -- example: ['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 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_city text, -- example: ['Selma', 'Dallas']\n school_zip integer, -- example: [93662, 75243]\n school_district text, -- example: ['Other', '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_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 secondary_focus_subject text, -- example: ['Other', 'College & Career Prep', 'ESL']\n secondary_focus_area text, -- example: ['Applied Learning', 'Literacy & Language']\n resource_type text, -- example: ['Other', '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 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: ['Peachtree City', 'Rockville']\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_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_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);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nReading About Other Cultures' project refers to title = 'Reading About Other Cultures'; prefix for the teacher refers to teacher_prefix\nWhat is the prefix for the teacher who handled the 'Reading About Other Cultures' project?\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_prefix FROM essays AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T1.title LIKE 'Reading About Other Cultures'",
"style": "rule"
} | {
"db_id": "donor.sqlite",
"gt_sql": "SELECT T2.teacher_prefix FROM essays AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T1.title LIKE 'Reading About Other Cultures'",
"index": 1564,
"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: ['Reading About Other Cultures', '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 project_resource_type text, -- example: ['Other', 'Technology', 'Supplies']\n item_name text, -- example: ['Handle', 'Other', 'Handles', 'iPod nano 4th Gen 8GB (Black)', 'Sony bloggie MHS-FS1 - camcorder - inter']\n item_number text, -- example: ['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 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_city text, -- example: ['Selma', 'Dallas']\n school_zip integer, -- example: [93662, 75243]\n school_district text, -- example: ['Other', '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_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 secondary_focus_subject text, -- example: ['Other', 'College & Career Prep', 'ESL']\n secondary_focus_area text, -- example: ['Applied Learning', 'Literacy & Language']\n resource_type text, -- example: ['Other', '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 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: ['Peachtree City', 'Rockville']\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_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_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);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nReading About Other Cultures' project refers to title = 'Reading About Other Cultures'; prefix for the teacher refers to teacher_prefix\nWhat is the prefix for the teacher who handled the 'Reading About Other Cultures' project?\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_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_county text, -- example: ['Fresno', 'Dallas']\n school_charter text, -- example: ['f', 't']\n school_magnet text, -- example: ['f', 't']\n school_kipp text, -- school Knowledge Is Power Program, example: ['f', 't']\n teacher_prefix text, -- example: ['Dr.', '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 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 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_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: ['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 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: ['Doctor', 'Doctors', '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:\neachers with Doctor Degree refers to teacher_prefix = 'Dr.'; more than 300 students involved refers to students_reached > 300\nWhich projects created by teachers with Doctor Degree where the project have more than 300 students involved. List down the title of the project.\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.title FROM essays AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T2.teacher_prefix LIKE 'Dr.' AND T2.students_reached > 300",
"style": "rule"
} | {
"db_id": "donor.sqlite",
"gt_sql": "SELECT T1.title FROM essays AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T2.teacher_prefix LIKE 'Dr.' AND T2.students_reached > 300",
"index": 1565,
"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_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_county text, -- example: ['Fresno', 'Dallas']\n school_charter text, -- example: ['f', 't']\n school_magnet text, -- example: ['f', 't']\n school_kipp text, -- school Knowledge Is Power Program, example: ['f', 't']\n teacher_prefix text, -- example: ['Dr.', '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 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 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_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: ['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 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: ['Doctor', 'Doctors', '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:\neachers with Doctor Degree refers to teacher_prefix = 'Dr.'; more than 300 students involved refers to students_reached > 300\nWhich projects created by teachers with Doctor Degree where the project have more than 300 students involved. List down the title of the project.\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 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 donor_city text, -- example: ['Peachtree City', 'Rockville']\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 donation_optional_support real, -- example: [7.5, 4.73]\n donation_total real, -- example: [50.0, 31.56]\n payment_method text, -- example: ['no_cash_received', 'creditcard']\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 essays (\n projectid text, -- example: ['ffffc4f85b60efc5b52347df489d0238', 'ffffac55ee02a49d1abc87ba6fc61135']\n title text, -- example: ['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 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_longitude real, -- example: [-119.608713, -96.72364]\n school_city text, -- example: ['Selma', 'Dallas']\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_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 primary_focus_subject text, -- example: ['Literature & Writing', 'Literacy']\n secondary_focus_area text, -- example: ['Applied Learning', 'Literacy & Language']\n poverty_level text, -- example: ['highest poverty', 'high poverty']\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:\nthe most expensive funds refers to max(multiply(item_unit_price, item_quantity))\nWhat is the title of project that have the most expensive funds?\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.title FROM essays AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T2.projectid = ( SELECT projectid FROM resources ORDER BY item_unit_price * item_quantity DESC LIMIT 1 )",
"style": "rule"
} | {
"db_id": "donor.sqlite",
"gt_sql": "SELECT T1.title FROM essays AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T2.projectid = ( SELECT projectid FROM resources ORDER BY item_unit_price * item_quantity DESC LIMIT 1 )",
"index": 1566,
"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 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 donor_city text, -- example: ['Peachtree City', 'Rockville']\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 donation_optional_support real, -- example: [7.5, 4.73]\n donation_total real, -- example: [50.0, 31.56]\n payment_method text, -- example: ['no_cash_received', 'creditcard']\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 essays (\n projectid text, -- example: ['ffffc4f85b60efc5b52347df489d0238', 'ffffac55ee02a49d1abc87ba6fc61135']\n title text, -- example: ['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 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_longitude real, -- example: [-119.608713, -96.72364]\n school_city text, -- example: ['Selma', 'Dallas']\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_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 primary_focus_subject text, -- example: ['Literature & Writing', 'Literacy']\n secondary_focus_area text, -- example: ['Applied Learning', 'Literacy & Language']\n poverty_level text, -- example: ['highest poverty', 'high poverty']\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:\nthe most expensive funds refers to max(multiply(item_unit_price, item_quantity))\nWhat is the title of project that have the most expensive funds?\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: ['New York', 'NEW York', 'New york', 'Many', 'YORK', 'York']\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 payment_included_web_purchased_gift_card text, -- example: ['f', 't']\n payment_was_promo_matched 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: ['Many', 'York', 'Selma', 'Dallas']\n school_county text, -- example: ['Fresno', 'Dallas']\n school_kipp text, -- school Knowledge Is Power Program, example: ['f', 't']\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 eligible_almost_home_match text, -- example: ['f', 't']\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: ['Woodwind and Brasswind', 'Best Buy for Business']\n item_number text, -- example: ['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);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nfrom New York refers to donor_city = 'New York'; donor is a teacher refers to is_teacher_acct = 't';\nAmong all the donors from New York, how many of them are teachers?\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(donationid) FROM donations WHERE is_teacher_acct = 't' AND donor_city = 'New York'",
"style": "rule"
} | {
"db_id": "donor.sqlite",
"gt_sql": "SELECT COUNT(donationid) FROM donations WHERE is_teacher_acct = 't' AND donor_city = 'New York'",
"index": 1567,
"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: ['New York', 'NEW York', 'New york', 'Many', 'YORK', 'York']\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 payment_included_web_purchased_gift_card text, -- example: ['f', 't']\n payment_was_promo_matched 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: ['Many', 'York', 'Selma', 'Dallas']\n school_county text, -- example: ['Fresno', 'Dallas']\n school_kipp text, -- school Knowledge Is Power Program, example: ['f', 't']\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 eligible_almost_home_match text, -- example: ['f', 't']\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: ['Woodwind and Brasswind', 'Best Buy for Business']\n item_number text, -- example: ['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);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nfrom New York refers to donor_city = 'New York'; donor is a teacher refers to is_teacher_acct = 't';\nAmong all the donors from New York, how many of them are teachers?\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 title text, -- example: ['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: ['New Jersey', 'How Many?', '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);\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: ['NJ', 'GA', 'MD']\n donation_timestamp datetime, -- example: ['2011-08-25 14:27:34.807', '2011-11-04 07:54:21.552']\n donation_total real, -- example: [50.0, 31.56]\n payment_method text, -- example: ['no_cash_received', 'creditcard']\n for_honoree text, -- example: ['t', 'f']\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 school_latitude real, -- example: [36.57634, 32.911179]\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 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 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 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:\nfrom New Jersey refers to donor_state = 'NJ'; for an honoree refers to for_honoree = 't';\nHow many donors from New Jersey have made a donation for an honoree?\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(donationid) FROM donations WHERE for_honoree = 't' AND donor_state = 'NJ'",
"style": "rule"
} | {
"db_id": "donor.sqlite",
"gt_sql": "SELECT COUNT(donationid) FROM donations WHERE for_honoree = 't' AND donor_state = 'NJ'",
"index": 1568,
"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 title text, -- example: ['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: ['New Jersey', 'How Many?', '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);\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: ['NJ', 'GA', 'MD']\n donation_timestamp datetime, -- example: ['2011-08-25 14:27:34.807', '2011-11-04 07:54:21.552']\n donation_total real, -- example: [50.0, 31.56]\n payment_method text, -- example: ['no_cash_received', 'creditcard']\n for_honoree text, -- example: ['t', 'f']\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 school_latitude real, -- example: [36.57634, 32.911179]\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 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 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 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:\nfrom New Jersey refers to donor_state = 'NJ'; for an honoree refers to for_honoree = 't';\nHow many donors from New Jersey have made a donation for an honoree?\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 school_latitude real, -- example: [36.57634, 32.911179]\n school_district text, -- example: ['Selma Unified Sch District', 'Richardson Ind School District']\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 resource_type text, -- example: ['Books', 'Technology']\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_to_project real, -- example: [42.5, 26.83]\n payment_included_acct_credit 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: ['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 vendor_name text, -- example: ['Lakeshore Learning Materials', '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 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:\nLakeshore Learning Materials is vendor_name; type of resources refers to project_resource_type;\nPlease list the types of resources that the vendor Lakeshore Learning Materials has provided for the 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 DISTINCT project_resource_type FROM resources WHERE vendor_name = 'Lakeshore Learning Materials'",
"style": "rule"
} | {
"db_id": "donor.sqlite",
"gt_sql": "SELECT DISTINCT project_resource_type FROM resources WHERE vendor_name = 'Lakeshore Learning Materials'",
"index": 1569,
"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 school_latitude real, -- example: [36.57634, 32.911179]\n school_district text, -- example: ['Selma Unified Sch District', 'Richardson Ind School District']\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 resource_type text, -- example: ['Books', 'Technology']\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_to_project real, -- example: [42.5, 26.83]\n payment_included_acct_credit 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: ['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 vendor_name text, -- example: ['Lakeshore Learning Materials', '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 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:\nLakeshore Learning Materials is vendor_name; type of resources refers to project_resource_type;\nPlease list the types of resources that the vendor Lakeshore Learning Materials has provided for the 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 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: ['New York', 'NEW York', 'New york', 'Many', 'city', 'City']\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_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_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 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_latitude real, -- example: [36.57634, 32.911179]\n school_city text, -- example: ['Many', 'York', 'Selma', 'Dallas']\n school_state text, -- example: ['CA', 'TX']\n school_metro text, -- example: ['urban', 'rural']\n school_county text, -- example: ['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 teacher_prefix text, -- example: ['Mrs.', 'Mr.']\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_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 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: ['Woodwind and Brasswind', 'Best Buy for Business']\n project_resource_type text, -- example: ['Technology', 'Supplies']\n item_name text, -- example: ['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 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 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:\nNew York is the donor city; donor from the same city refers to donor from New York in which teacher_ny_teaching_fellow = 't';\nAmong the projects created by a teacher from New York, how many of them have a donor from the same city?\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.projectid) FROM projects AS T1 INNER JOIN donations AS T2 ON T1.projectid = T2.projectid WHERE T1.teacher_ny_teaching_fellow = 't' AND T2.donor_city = 'New York'",
"style": "rule"
} | {
"db_id": "donor.sqlite",
"gt_sql": "SELECT COUNT(T1.projectid) FROM projects AS T1 INNER JOIN donations AS T2 ON T1.projectid = T2.projectid WHERE T1.teacher_ny_teaching_fellow = 't' AND T2.donor_city = 'New York'",
"index": 1570,
"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: ['New York', 'NEW York', 'New york', 'Many', 'city', 'City']\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_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_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 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_latitude real, -- example: [36.57634, 32.911179]\n school_city text, -- example: ['Many', 'York', 'Selma', 'Dallas']\n school_state text, -- example: ['CA', 'TX']\n school_metro text, -- example: ['urban', 'rural']\n school_county text, -- example: ['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 teacher_prefix text, -- example: ['Mrs.', 'Mr.']\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_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 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: ['Woodwind and Brasswind', 'Best Buy for Business']\n project_resource_type text, -- example: ['Technology', 'Supplies']\n item_name text, -- example: ['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 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 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:\nNew York is the donor city; donor from the same city refers to donor from New York in which teacher_ny_teaching_fellow = 't';\nAmong the projects created by a teacher from New York, how many of them have a donor from the same city?\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_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_optional_support real, -- example: [7.5, 4.73]\n dollar_amount text, -- example: ['10_to_100', 'under_10']\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 vendor_name text, -- example: ['Lakeshore Learning Materials', 'Woodwind and Brasswind', 'Best Buy for Business']\n project_resource_type text, -- example: ['Technology', 'Supplies']\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);\n\nCREATE TABLE projects (\n projectid text, -- example: ['00001ccc0e81598c4bd86bacb94d7acb', '00002bff514104264a6b798356fdd893']\n school_latitude real, -- example: [36.57634, 32.911179]\n school_county text, -- example: ['Fresno', 'Dallas']\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: ['Dr.', 'Mrs.', 'Mr.']\n secondary_focus_subject text, -- example: ['College & Career Prep', 'ESL']\n grade_level text, -- example: ['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 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:\nLakeshore Learning Materials is vendor_name; teacher with a doctor degree refers to teacher_prefix = 'Dr.';\nHow many projects have their resources provided by the vendor Lakeshore Learning Materials and are created by a teacher with a doctor degree?\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.projectid) FROM resources AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T1.vendor_name = 'Lakeshore Learning Materials' AND T2.teacher_prefix = 'Dr.'",
"style": "rule"
} | {
"db_id": "donor.sqlite",
"gt_sql": "SELECT COUNT(T1.projectid) FROM resources AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T1.vendor_name = 'Lakeshore Learning Materials' AND T2.teacher_prefix = 'Dr.'",
"index": 1571,
"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_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_optional_support real, -- example: [7.5, 4.73]\n dollar_amount text, -- example: ['10_to_100', 'under_10']\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 vendor_name text, -- example: ['Lakeshore Learning Materials', 'Woodwind and Brasswind', 'Best Buy for Business']\n project_resource_type text, -- example: ['Technology', 'Supplies']\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);\n\nCREATE TABLE projects (\n projectid text, -- example: ['00001ccc0e81598c4bd86bacb94d7acb', '00002bff514104264a6b798356fdd893']\n school_latitude real, -- example: [36.57634, 32.911179]\n school_county text, -- example: ['Fresno', 'Dallas']\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: ['Dr.', 'Mrs.', 'Mr.']\n secondary_focus_subject text, -- example: ['College & Career Prep', 'ESL']\n grade_level text, -- example: ['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 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:\nLakeshore Learning Materials is vendor_name; teacher with a doctor degree refers to teacher_prefix = 'Dr.';\nHow many projects have their resources provided by the vendor Lakeshore Learning Materials and are created by a teacher with a doctor degree?\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 item_name text, -- example: ['item', 'Area', '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 essays (\n projectid text, -- example: ['ffffc4f85b60efc5b52347df489d0238', 'ffffac55ee02a49d1abc87ba6fc61135']\n teacher_acctid text, -- example: ['c24011b20fc161ed02248e85beb59a90', '947066d0af47e0566f334566553dd6a6']\n title text, -- example: ['Literacy', '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_acctid text, -- donor accid, example: ['22cbc920c9b5fa08dfb331422f5926b5', '521f1830a77c9dbbf8119d99c6206a16']\n donor_city text, -- example: ['price', 'MAIN', '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_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: ['Literacy', 'ha', 'Literacy!', '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_latitude real, -- example: [36.57634, 32.911179]\n school_longitude real, -- example: [-119.608713, -96.72364]\n school_city text, -- example: ['Price', '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: ['Price', '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_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_area text, -- example: ['Literacy & Language', 'History & Civics']\n secondary_focus_subject text, -- example: ['Literacy', 'College & Career Prep', 'ESL']\n secondary_focus_area text, -- example: ['Literacy & Language', 'Applied Learning']\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 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);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nmain subject area refers to primary_focus_area = 'Literacy & Language'; highest unit price refers to Max(item_unit_price);\nWhich item provided to a project whose main subject area is Literacy & Language has the highest unit price?\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_area = 'Literacy & Language' 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_area = 'Literacy & Language' ORDER BY T1.item_unit_price DESC LIMIT 1",
"index": 1572,
"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 item_name text, -- example: ['item', 'Area', '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 essays (\n projectid text, -- example: ['ffffc4f85b60efc5b52347df489d0238', 'ffffac55ee02a49d1abc87ba6fc61135']\n teacher_acctid text, -- example: ['c24011b20fc161ed02248e85beb59a90', '947066d0af47e0566f334566553dd6a6']\n title text, -- example: ['Literacy', '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_acctid text, -- donor accid, example: ['22cbc920c9b5fa08dfb331422f5926b5', '521f1830a77c9dbbf8119d99c6206a16']\n donor_city text, -- example: ['price', 'MAIN', '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_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: ['Literacy', 'ha', 'Literacy!', '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_latitude real, -- example: [36.57634, 32.911179]\n school_longitude real, -- example: [-119.608713, -96.72364]\n school_city text, -- example: ['Price', '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: ['Price', '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_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_area text, -- example: ['Literacy & Language', 'History & Civics']\n secondary_focus_subject text, -- example: ['Literacy', 'College & Career Prep', 'ESL']\n secondary_focus_area text, -- example: ['Literacy & Language', 'Applied Learning']\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 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);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nmain subject area refers to primary_focus_area = 'Literacy & Language'; highest unit price refers to Max(item_unit_price);\nWhich item provided to a project whose main subject area is Literacy & Language has the highest unit price?\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: ['Brooklyn', 'School!', 'Schools', '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);\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 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: ['BROOKLYN', 'Brooklyn', '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_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_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 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: ['Donation', 'brooklyn', 'BROOKLYN', 'bROOKLYN', 'Brooklyn', 'Brooklyn ,']\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_total real, -- example: [50.0, 31.56]\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 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);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nschool in Brooklyn refers to school_city = 'Brooklyn'; Average = AVG(donation_total);\nWhat is the average donation amount to a project created by a teacher working in a school in Brooklyn?\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_total) / COUNT(donationid) FROM projects AS T1 INNER JOIN donations AS T2 ON T1.projectid = T2.projectid WHERE T1.school_city = 'Brooklyn'",
"style": "rule"
} | {
"db_id": "donor.sqlite",
"gt_sql": "SELECT SUM(T2.donation_total) / COUNT(donationid) FROM projects AS T1 INNER JOIN donations AS T2 ON T1.projectid = T2.projectid WHERE T1.school_city = 'Brooklyn'",
"index": 1573,
"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: ['Brooklyn', 'School!', 'Schools', '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);\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 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: ['BROOKLYN', 'Brooklyn', '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_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_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 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: ['Donation', 'brooklyn', 'BROOKLYN', 'bROOKLYN', 'Brooklyn', 'Brooklyn ,']\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_total real, -- example: [50.0, 31.56]\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 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);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nschool in Brooklyn refers to school_city = 'Brooklyn'; Average = AVG(donation_total);\nWhat is the average donation amount to a project created by a teacher working in a school in Brooklyn?\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: ['Selma', 'Dallas']\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_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 teacher_prefix text, -- example: ['Mrs.', 'Mr.']\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 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 students_reached integer, -- example: [32, 22]\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);\n\nCREATE TABLE donations (\n donationid text, -- example: ['42d43fa6f37314365d08692e08680973', '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_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 payment_method text, -- example: ['no_cash_received', 'creditcard']\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 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: ['ACQUIRE', 'Doctor', 'Doctors', 'iPod nano 4th Gen 8GB (Black)', 'Sony bloggie MHS-FS1 - camcorder - inter']\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:\nteacher \"42d43fa6f37314365d08692e08680973\" refers to teacher_acctid = '42d43fa6f37314365d08692e08680973';\nHave the teacher \"42d43fa6f37314365d08692e08680973\" acquired P.h.D or doctor degree?\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 CASE WHEN teacher_prefix = 'Dr.' THEN 'Yes' ELSE 'NO' END FROM projects WHERE teacher_acctid = '42d43fa6f37314365d08692e08680973'",
"style": "rule"
} | {
"db_id": "donor.sqlite",
"gt_sql": "SELECT CASE WHEN teacher_prefix = 'Dr.' THEN 'Yes' ELSE 'NO' END FROM projects WHERE teacher_acctid = '42d43fa6f37314365d08692e08680973'",
"index": 1574,
"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: ['Selma', 'Dallas']\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_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 teacher_prefix text, -- example: ['Mrs.', 'Mr.']\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 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 students_reached integer, -- example: [32, 22]\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);\n\nCREATE TABLE donations (\n donationid text, -- example: ['42d43fa6f37314365d08692e08680973', '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_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 payment_method text, -- example: ['no_cash_received', 'creditcard']\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 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: ['ACQUIRE', 'Doctor', 'Doctors', 'iPod nano 4th Gen 8GB (Black)', 'Sony bloggie MHS-FS1 - camcorder - inter']\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:\nteacher \"42d43fa6f37314365d08692e08680973\" refers to teacher_acctid = '42d43fa6f37314365d08692e08680973';\nHave the teacher \"42d43fa6f37314365d08692e08680973\" acquired P.h.D or doctor degree?\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 item_number text, -- example: ['249995.001', 'BB11216668']\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 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 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: ['Abington', 'abington', 'ABINGTON', 'Peachtree City', 'Rockville']\n donor_state text, -- example: ['GA', 'MD']\n is_teacher_acct text, -- example: ['f', 't']\n dollar_amount text, -- example: ['10_to_100', 'under_10']\n payment_method text, -- example: ['no_cash_received', 'creditcard']\n payment_included_campaign_gift_card text, -- example: ['t', 'f']\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_ncesid text, -- school national center for education statistics id, example: ['063627006187', '483702008193']\n school_city text, -- example: ['Abington', 'Selma', 'Dallas']\n school_metro text, -- example: ['urban', 'rural']\n school_county text, -- example: ['Fresno', 'Dallas']\n school_year_round text, -- example: ['f', 't']\n school_nlns text, -- school Nonleafy Normal Stature, 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 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);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nAbington is school_city;\nPlease list the titles of projects by which schools in Abington was donated.\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.title FROM projects AS T1 INNER JOIN essays AS T2 ON T1.projectid = T2.projectid WHERE T1.school_city LIKE 'Abington'",
"style": "rule"
} | {
"db_id": "donor.sqlite",
"gt_sql": "SELECT T2.title FROM projects AS T1 INNER JOIN essays AS T2 ON T1.projectid = T2.projectid WHERE T1.school_city LIKE 'Abington'",
"index": 1575,
"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_number text, -- example: ['249995.001', 'BB11216668']\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 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 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: ['Abington', 'abington', 'ABINGTON', 'Peachtree City', 'Rockville']\n donor_state text, -- example: ['GA', 'MD']\n is_teacher_acct text, -- example: ['f', 't']\n dollar_amount text, -- example: ['10_to_100', 'under_10']\n payment_method text, -- example: ['no_cash_received', 'creditcard']\n payment_included_campaign_gift_card text, -- example: ['t', 'f']\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_ncesid text, -- school national center for education statistics id, example: ['063627006187', '483702008193']\n school_city text, -- example: ['Abington', 'Selma', 'Dallas']\n school_metro text, -- example: ['urban', 'rural']\n school_county text, -- example: ['Fresno', 'Dallas']\n school_year_round text, -- example: ['f', 't']\n school_nlns text, -- school Nonleafy Normal Stature, 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 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);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nAbington is school_city;\nPlease list the titles of projects by which schools in Abington was donated.\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: ['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 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: ['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: ['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: ['Donation', 'Many', 't', 'T', 'f', 'F']\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: ['f', 't']\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: ['account credit', '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 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: ['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);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\ndonation didn't use account credits redemption refers to payment_included_acct_credit = 'f'; magnet school refers to school_magnet = 't';\nAmong the schools' projects whose donation didn't use account credits redemption,how many schools are public magnet schools?\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 T1.school_magnet = 't' AND T2.payment_included_acct_credit = 'f'",
"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 T1.school_magnet = 't' AND T2.payment_included_acct_credit = 'f'",
"index": 1576,
"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: ['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 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: ['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: ['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: ['Donation', 'Many', 't', 'T', 'f', 'F']\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: ['f', 't']\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: ['account credit', '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 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: ['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);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\ndonation didn't use account credits redemption refers to payment_included_acct_credit = 'f'; magnet school refers to school_magnet = 't';\nAmong the schools' projects whose donation didn't use account credits redemption,how many schools are public magnet schools?\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_state text, -- example: ['CA', 'TX']\n school_magnet 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 grade_level text, -- example: ['Grades 6-8', 'Grades PreK-2']\n PRIMARY KEY (projectid)\n);\n\nCREATE TABLE essays (\n projectid text, -- example: ['ffffc4f85b60efc5b52347df489d0238', 'ffffac55ee02a49d1abc87ba6fc61135']\n);\n\nCREATE TABLE donations (\n donationid text, -- example: ['000000a91a14ed37bef82e125c102e77', '000013be53ed7382ed5d5975eb86eb85']\n projectid text, -- example: ['ffffac55ee02a49d1abc87ba6fc61135', 'ffff97ed93720407d70a2787475932b0']\n is_teacher_acct text, -- example: ['t', 'f']\n donation_total real, -- example: [50.0, 31.56]\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 vendor_name text, -- example: ['ABC School Supply', 'Woodwind and Brasswind', 'Best Buy for Business']\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:\nABC School Supply is vendor_name; public magnet school refers to school_magnet = 't';\nIn the schools donated by the project of the resources provided by ABC School Supply, how many schools are public magnet schools?\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 WHERE T2.school_magnet = 't' AND T1.vendor_name = 'ABC School Supply'",
"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 WHERE T2.school_magnet = 't' AND T1.vendor_name = 'ABC School Supply'",
"index": 1577,
"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_state text, -- example: ['CA', 'TX']\n school_magnet 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 grade_level text, -- example: ['Grades 6-8', 'Grades PreK-2']\n PRIMARY KEY (projectid)\n);\n\nCREATE TABLE essays (\n projectid text, -- example: ['ffffc4f85b60efc5b52347df489d0238', 'ffffac55ee02a49d1abc87ba6fc61135']\n);\n\nCREATE TABLE donations (\n donationid text, -- example: ['000000a91a14ed37bef82e125c102e77', '000013be53ed7382ed5d5975eb86eb85']\n projectid text, -- example: ['ffffac55ee02a49d1abc87ba6fc61135', 'ffff97ed93720407d70a2787475932b0']\n is_teacher_acct text, -- example: ['t', 'f']\n donation_total real, -- example: [50.0, 31.56]\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 vendor_name text, -- example: ['ABC School Supply', 'Woodwind and Brasswind', 'Best Buy for Business']\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:\nABC School Supply is vendor_name; public magnet school refers to school_magnet = 't';\nIn the schools donated by the project of the resources provided by ABC School Supply, how many schools are public magnet schools?\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: ['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 projects (\n projectid text, -- example: ['00001ccc0e81598c4bd86bacb94d7acb', '00002bff514104264a6b798356fdd893']\n teacher_acctid text, -- example: ['42d43fa6f37314365d08692e08680973', '864eb466462bf704bf7a16a585ef296a']\n schoolid text, -- example: ['301c9bf0a45d159d162b65a93fddd74e', '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_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_charter text, -- example: ['f', 't']\n school_year_round text, -- example: ['f', 't']\n school_kipp text, -- school Knowledge Is Power Program, example: ['f', 't']\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 PRIMARY KEY (projectid)\n);\n\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 project_resource_type text, -- example: ['Technology', 'Supplies']\n item_name text, -- example: ['Short', 'School!', 'Schools', 'iPod nano 4th Gen 8GB (Black)', 'Sony bloggie MHS-FS1 - camcorder - inter']\n item_number text, -- example: ['GIVE', '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: ['301c9bf0a45d159d162b65a93fddd74e', '000000a91a14ed37bef82e125c102e77', '000013be53ed7382ed5d5975eb86eb85']\n projectid text, -- example: ['ffffac55ee02a49d1abc87ba6fc61135', 'ffff97ed93720407d70a2787475932b0']\n donor_acctid text, -- donor accid, example: ['22cbc920c9b5fa08dfb331422f5926b5', '521f1830a77c9dbbf8119d99c6206a16']\n donor_city text, -- example: ['Donation', '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 dollar_amount text, -- example: ['10_to_100', 'under_10']\n donation_included_optional_support text, -- example: ['t', 'f']\n payment_included_acct_credit text, -- example: ['f', 't']\n payment_included_campaign_gift_card text, -- example: ['t', 'f']\n payment_was_promo_matched 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);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nschool “301c9bf0a45d159d162b65a93fddd74e\" refers to schoolid = '301c9bf0a45d159d162b65a93fddd74e';\nWhat is the short description of the project that gives donation to school “301c9bf0a45d159d162b65a93fddd74e”?\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.short_description FROM projects AS T1 INNER JOIN essays AS T2 ON T1.projectid = T2.projectid WHERE T1.schoolid = '301c9bf0a45d159d162b65a93fddd74e'",
"style": "rule"
} | {
"db_id": "donor.sqlite",
"gt_sql": "SELECT T2.short_description FROM projects AS T1 INNER JOIN essays AS T2 ON T1.projectid = T2.projectid WHERE T1.schoolid = '301c9bf0a45d159d162b65a93fddd74e'",
"index": 1578,
"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: ['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 projects (\n projectid text, -- example: ['00001ccc0e81598c4bd86bacb94d7acb', '00002bff514104264a6b798356fdd893']\n teacher_acctid text, -- example: ['42d43fa6f37314365d08692e08680973', '864eb466462bf704bf7a16a585ef296a']\n schoolid text, -- example: ['301c9bf0a45d159d162b65a93fddd74e', '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_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_charter text, -- example: ['f', 't']\n school_year_round text, -- example: ['f', 't']\n school_kipp text, -- school Knowledge Is Power Program, example: ['f', 't']\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 PRIMARY KEY (projectid)\n);\n\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 project_resource_type text, -- example: ['Technology', 'Supplies']\n item_name text, -- example: ['Short', 'School!', 'Schools', 'iPod nano 4th Gen 8GB (Black)', 'Sony bloggie MHS-FS1 - camcorder - inter']\n item_number text, -- example: ['GIVE', '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: ['301c9bf0a45d159d162b65a93fddd74e', '000000a91a14ed37bef82e125c102e77', '000013be53ed7382ed5d5975eb86eb85']\n projectid text, -- example: ['ffffac55ee02a49d1abc87ba6fc61135', 'ffff97ed93720407d70a2787475932b0']\n donor_acctid text, -- donor accid, example: ['22cbc920c9b5fa08dfb331422f5926b5', '521f1830a77c9dbbf8119d99c6206a16']\n donor_city text, -- example: ['Donation', '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 dollar_amount text, -- example: ['10_to_100', 'under_10']\n donation_included_optional_support text, -- example: ['t', 'f']\n payment_included_acct_credit text, -- example: ['f', 't']\n payment_included_campaign_gift_card text, -- example: ['t', 'f']\n payment_was_promo_matched 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);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nschool “301c9bf0a45d159d162b65a93fddd74e\" refers to schoolid = '301c9bf0a45d159d162b65a93fddd74e';\nWhat is the short description of the project that gives donation to school “301c9bf0a45d159d162b65a93fddd74e”?\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: ['822b7b8768c17456fdce78b65abcc18e', 'c24011b20fc161ed02248e85beb59a90', '947066d0af47e0566f334566553dd6a6']\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 donations (\n donationid text, -- example: ['822b7b8768c17456fdce78b65abcc18e', '000000a91a14ed37bef82e125c102e77', '000013be53ed7382ed5d5975eb86eb85']\n projectid text, -- example: ['822b7b8768c17456fdce78b65abcc18e', 'ffffac55ee02a49d1abc87ba6fc61135', 'ffff97ed93720407d70a2787475932b0']\n donation_timestamp datetime, -- example: ['2011-08-25 14:27:34.807', '2011-11-04 07:54:21.552']\n donation_total real, -- example: [50.0, 31.56]\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 PRIMARY KEY (donationid),\n CONSTRAINT fk_donations_projectid FOREIGN KEY (projectid) REFERENCES projects (projectid)\n);\n\nCREATE TABLE projects (\n projectid text, -- example: ['822b7b8768c17456fdce78b65abcc18e', '00001ccc0e81598c4bd86bacb94d7acb', '00002bff514104264a6b798356fdd893']\n teacher_acctid text, -- example: ['822b7b8768c17456fdce78b65abcc18e', '42d43fa6f37314365d08692e08680973', '864eb466462bf704bf7a16a585ef296a']\n school_ncesid text, -- school national center for education statistics id, example: ['063627006187', '483702008193']\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_magnet text, -- 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 secondary_focus_subject text, -- example: ['College & Career Prep', 'ESL']\n resource_type text, -- example: ['Books', 'Technology']\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);\n\nCREATE TABLE resources (\n resourceid text, -- example: ['0000037fecc4461faf0e49328ae66661', '0000046b69c683354ca46b30db5c558e']\n projectid text, -- example: ['822b7b8768c17456fdce78b65abcc18e', 'ffffc4f85b60efc5b52347df489d0238', 'ffffac55ee02a49d1abc87ba6fc61135']\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:\nteacher \"822b7b8768c17456fdce78b65abcc18e\" refers to teacher_acctid = '822b7b8768c17456fdce78b65abcc18e'; donated refers to donation_total;\nHow much did the project that teacher \"822b7b8768c17456fdce78b65abcc18e\" created donate?\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.donation_total FROM projects AS T1 INNER JOIN donations AS T2 ON T1.projectid = T2.projectid WHERE T1.teacher_acctid = '822b7b8768c17456fdce78b65abcc18e'",
"style": "rule"
} | {
"db_id": "donor.sqlite",
"gt_sql": "SELECT T2.donation_total FROM projects AS T1 INNER JOIN donations AS T2 ON T1.projectid = T2.projectid WHERE T1.teacher_acctid = '822b7b8768c17456fdce78b65abcc18e'",
"index": 1579,
"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: ['822b7b8768c17456fdce78b65abcc18e', 'c24011b20fc161ed02248e85beb59a90', '947066d0af47e0566f334566553dd6a6']\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 donations (\n donationid text, -- example: ['822b7b8768c17456fdce78b65abcc18e', '000000a91a14ed37bef82e125c102e77', '000013be53ed7382ed5d5975eb86eb85']\n projectid text, -- example: ['822b7b8768c17456fdce78b65abcc18e', 'ffffac55ee02a49d1abc87ba6fc61135', 'ffff97ed93720407d70a2787475932b0']\n donation_timestamp datetime, -- example: ['2011-08-25 14:27:34.807', '2011-11-04 07:54:21.552']\n donation_total real, -- example: [50.0, 31.56]\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 PRIMARY KEY (donationid),\n CONSTRAINT fk_donations_projectid FOREIGN KEY (projectid) REFERENCES projects (projectid)\n);\n\nCREATE TABLE projects (\n projectid text, -- example: ['822b7b8768c17456fdce78b65abcc18e', '00001ccc0e81598c4bd86bacb94d7acb', '00002bff514104264a6b798356fdd893']\n teacher_acctid text, -- example: ['822b7b8768c17456fdce78b65abcc18e', '42d43fa6f37314365d08692e08680973', '864eb466462bf704bf7a16a585ef296a']\n school_ncesid text, -- school national center for education statistics id, example: ['063627006187', '483702008193']\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_magnet text, -- 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 secondary_focus_subject text, -- example: ['College & Career Prep', 'ESL']\n resource_type text, -- example: ['Books', 'Technology']\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);\n\nCREATE TABLE resources (\n resourceid text, -- example: ['0000037fecc4461faf0e49328ae66661', '0000046b69c683354ca46b30db5c558e']\n projectid text, -- example: ['822b7b8768c17456fdce78b65abcc18e', 'ffffc4f85b60efc5b52347df489d0238', 'ffffac55ee02a49d1abc87ba6fc61135']\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:\nteacher \"822b7b8768c17456fdce78b65abcc18e\" refers to teacher_acctid = '822b7b8768c17456fdce78b65abcc18e'; donated refers to donation_total;\nHow much did the project that teacher \"822b7b8768c17456fdce78b65abcc18e\" created donate?\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: ['Percentage', 'Brooklyn', 'Schools', 'Count', 'iPod nano 4th Gen 8GB (Black)', 'Sony bloggie MHS-FS1 - camcorder - inter']\n item_number text, -- example: ['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: ['brooklyn', 'BROOKLYN', 'bROOKLYN', 'Brooklyn', 'Divide', 't']\n donor_state text, -- example: ['GA', 'MD']\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_total real, -- example: [50.0, 31.56]\n dollar_amount text, -- example: ['10_to_100', 'under_10']\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_was_promo_matched 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);\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: ['BROOKLYN', 'Brooklyn', '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_nlns text, -- school Nonleafy Normal Stature, example: ['f', 't']\n teacher_prefix text, -- example: ['Mrs.', 'Mr.']\n primary_focus_subject text, -- example: ['Literature & Writing', 'Literacy']\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 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:\ndonors are teachers refers to is_teacher_acct = 't'; Brooklyn is school_city; percentage = Divide(Count(school_city-'Brooklyn'),Count(school_city))*100\nAmong the schools whose donators are teachers, what is the percentage of schools that are in Brooklyn?\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.school_city LIKE 'Brooklyn' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.teacher_acctid) FROM projects AS T1 INNER JOIN donations AS T2 ON T1.projectid = T2.projectid WHERE T2.is_teacher_acct = 't'",
"style": "rule"
} | {
"db_id": "donor.sqlite",
"gt_sql": "SELECT CAST(SUM(CASE WHEN T1.school_city LIKE 'Brooklyn' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.teacher_acctid) FROM projects AS T1 INNER JOIN donations AS T2 ON T1.projectid = T2.projectid WHERE T2.is_teacher_acct = 't'",
"index": 1580,
"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: ['Percentage', 'Brooklyn', 'Schools', 'Count', 'iPod nano 4th Gen 8GB (Black)', 'Sony bloggie MHS-FS1 - camcorder - inter']\n item_number text, -- example: ['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: ['brooklyn', 'BROOKLYN', 'bROOKLYN', 'Brooklyn', 'Divide', 't']\n donor_state text, -- example: ['GA', 'MD']\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_total real, -- example: [50.0, 31.56]\n dollar_amount text, -- example: ['10_to_100', 'under_10']\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_was_promo_matched 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);\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: ['BROOKLYN', 'Brooklyn', '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_nlns text, -- school Nonleafy Normal Stature, example: ['f', 't']\n teacher_prefix text, -- example: ['Mrs.', 'Mr.']\n primary_focus_subject text, -- example: ['Literature & Writing', 'Literacy']\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 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:\ndonors are teachers refers to is_teacher_acct = 't'; Brooklyn is school_city; percentage = Divide(Count(school_city-'Brooklyn'),Count(school_city))*100\nAmong the schools whose donators are teachers, what is the percentage of schools that are in Brooklyn?\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 school_latitude real, -- example: [36.57634, 32.911179]\n school_city text, -- example: ['Selma', 'Dallas']\n school_state text, -- example: ['CA', 'TX']\n school_charter text, -- example: ['f', 't']\n school_year_round text, -- example: ['f', 't']\n school_kipp text, -- school Knowledge Is Power Program, example: ['f', 't']\n total_price_excluding_optional_support real, -- example: [555.81, 296.47]\n PRIMARY KEY (projectid)\n);\n\nCREATE TABLE donations (\n donationid text, -- example: ['000000a91a14ed37bef82e125c102e77', '000013be53ed7382ed5d5975eb86eb85']\n projectid text, -- example: ['ffffac55ee02a49d1abc87ba6fc61135', 'ffff97ed93720407d70a2787475932b0']\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 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:\nLos Angeles is school_city; year-round school refers to school_year_round = 't';\nWhat is the number of the year round school in Los Angeles?\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(school_year_round) FROM projects WHERE school_city = 'Los Angeles' AND school_year_round = 't'",
"style": "rule"
} | {
"db_id": "donor.sqlite",
"gt_sql": "SELECT COUNT(school_year_round) FROM projects WHERE school_city = 'Los Angeles' AND school_year_round = 't'",
"index": 1581,
"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 school_latitude real, -- example: [36.57634, 32.911179]\n school_city text, -- example: ['Selma', 'Dallas']\n school_state text, -- example: ['CA', 'TX']\n school_charter text, -- example: ['f', 't']\n school_year_round text, -- example: ['f', 't']\n school_kipp text, -- school Knowledge Is Power Program, example: ['f', 't']\n total_price_excluding_optional_support real, -- example: [555.81, 296.47]\n PRIMARY KEY (projectid)\n);\n\nCREATE TABLE donations (\n donationid text, -- example: ['000000a91a14ed37bef82e125c102e77', '000013be53ed7382ed5d5975eb86eb85']\n projectid text, -- example: ['ffffac55ee02a49d1abc87ba6fc61135', 'ffff97ed93720407d70a2787475932b0']\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 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:\nLos Angeles is school_city; year-round school refers to school_year_round = 't';\nWhat is the number of the year round school in Los Angeles?\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 project_resource_type text, -- example: ['Technology', 'Supplies']\n item_number text, -- example: ['249995.001', 'BB11216668']\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_zip integer, -- example: [93662, 75243]\n school_county text, -- example: ['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_charter_ready_promise text, -- example: ['f', 't']\n teacher_prefix text, -- example: ['Mrs.', 'Mr.']\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 total_price_excluding_optional_support real, -- example: [555.81, 296.47]\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);\n\nCREATE TABLE essays (\n teacher_acctid text, -- example: ['c24011b20fc161ed02248e85beb59a90', '947066d0af47e0566f334566553dd6a6']\n need_statement text, -- example: ['My students need four iPods.', 'My students need a camcorder. ']\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: ['manhattan', 'Manhattan', 'MANHATTAN', 'New York', 'NEW York', 'New york']\n donation_optional_support real, -- example: [7.5, 4.73]\n dollar_amount text, -- example: ['10_to_100', 'under_10']\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 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);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\npublic magnet school refers to school_magnet = 't'; in New York Manhattan refers to school_country = 'New York(Manhattan)';\nState the number of public magnet schools in New York Manhattan.\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(schoolid) FROM projects WHERE school_county = 'New York (Manhattan)' AND school_magnet = 't'",
"style": "rule"
} | {
"db_id": "donor.sqlite",
"gt_sql": "SELECT COUNT(schoolid) FROM projects WHERE school_county = 'New York (Manhattan)' AND school_magnet = 't'",
"index": 1582,
"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 project_resource_type text, -- example: ['Technology', 'Supplies']\n item_number text, -- example: ['249995.001', 'BB11216668']\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_zip integer, -- example: [93662, 75243]\n school_county text, -- example: ['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_charter_ready_promise text, -- example: ['f', 't']\n teacher_prefix text, -- example: ['Mrs.', 'Mr.']\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 total_price_excluding_optional_support real, -- example: [555.81, 296.47]\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);\n\nCREATE TABLE essays (\n teacher_acctid text, -- example: ['c24011b20fc161ed02248e85beb59a90', '947066d0af47e0566f334566553dd6a6']\n need_statement text, -- example: ['My students need four iPods.', 'My students need a camcorder. ']\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: ['manhattan', 'Manhattan', 'MANHATTAN', 'New York', 'NEW York', 'New york']\n donation_optional_support real, -- example: [7.5, 4.73]\n dollar_amount text, -- example: ['10_to_100', 'under_10']\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 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);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\npublic magnet school refers to school_magnet = 't'; in New York Manhattan refers to school_country = 'New York(Manhattan)';\nState the number of public magnet schools in New York Manhattan.\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: ['twin falls', 'Twin Falls', 'Many', 'Peachtree City', 'Rockville']\n donor_state text, -- example: ['GA', 'MD']\n is_teacher_acct text, -- example: ['f', 't']\n donation_to_project real, -- example: [42.5, 26.83]\n dollar_amount text, -- example: ['10_to_100', 'under_10']\n payment_included_acct_credit text, -- example: ['f', 't']\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 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 school_latitude real, -- example: [36.57634, 32.911179]\n school_city text, -- example: ['Twin Falls', 'Many', 'Selma', 'Dallas']\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: ['Twin Falls', 'Falls', 'Fresno', 'Dallas']\n school_year_round text, -- 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 primary_focus_subject text, -- example: ['Literature & Writing', 'Literacy']\n primary_focus_area text, -- example: ['Math & Science', 'Literacy & Language', 'History & Civics']\n secondary_focus_area text, -- example: ['Math & Science', 'Applied Learning', 'Literacy & Language']\n resource_type text, -- example: ['Books', 'Technology']\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 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);\n\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 item_number text, -- example: ['FOCUS', '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);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nTwin Falls is school_country; 'Math & Science' is primary_focus_area;\nHow many teachers in Twin Falls have Math & Science as their primary focus area?\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(teacher_acctid) FROM projects WHERE school_county = 'Twin Falls' AND primary_focus_area = 'Math & Science'",
"style": "rule"
} | {
"db_id": "donor.sqlite",
"gt_sql": "SELECT COUNT(teacher_acctid) FROM projects WHERE school_county = 'Twin Falls' AND primary_focus_area = 'Math & Science'",
"index": 1583,
"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: ['twin falls', 'Twin Falls', 'Many', 'Peachtree City', 'Rockville']\n donor_state text, -- example: ['GA', 'MD']\n is_teacher_acct text, -- example: ['f', 't']\n donation_to_project real, -- example: [42.5, 26.83]\n dollar_amount text, -- example: ['10_to_100', 'under_10']\n payment_included_acct_credit text, -- example: ['f', 't']\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 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 school_latitude real, -- example: [36.57634, 32.911179]\n school_city text, -- example: ['Twin Falls', 'Many', 'Selma', 'Dallas']\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: ['Twin Falls', 'Falls', 'Fresno', 'Dallas']\n school_year_round text, -- 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 primary_focus_subject text, -- example: ['Literature & Writing', 'Literacy']\n primary_focus_area text, -- example: ['Math & Science', 'Literacy & Language', 'History & Civics']\n secondary_focus_area text, -- example: ['Math & Science', 'Applied Learning', 'Literacy & Language']\n resource_type text, -- example: ['Books', 'Technology']\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 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);\n\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 item_number text, -- example: ['FOCUS', '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);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nTwin Falls is school_country; 'Math & Science' is primary_focus_area;\nHow many teachers in Twin Falls have Math & Science as their primary focus area?\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 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: ['Many', 'Selma', 'Dallas']\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_charter text, -- example: ['f', 't']\n school_magnet text, -- example: ['f', 't']\n school_year_round text, -- 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: ['Literature & Writing', '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 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 donations (\n donationid text, -- example: ['000000a91a14ed37bef82e125c102e77', '000013be53ed7382ed5d5975eb86eb85']\n projectid text, -- example: ['ffffac55ee02a49d1abc87ba6fc61135', 'ffff97ed93720407d70a2787475932b0']\n donor_city text, -- example: ['Many', '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_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: ['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_name text, -- example: ['Focus', 'How Many?', 'iPod nano 4th Gen 8GB (Black)', 'Sony bloggie MHS-FS1 - camcorder - inter']\n item_number text, -- example: ['FOCUS', '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:\nLiterature & Writing' is primary_focus_subject; use 'Mr' as their teacher prefix refers to teacher_prefix = 'Mr';\nHow many teachers that have Literature & Writing as their primary focus subject use 'Mr' as their teacher prefix?\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(teacher_acctid) FROM projects WHERE teacher_prefix = 'Mr.' AND primary_focus_subject = 'Literature & Writing'",
"style": "rule"
} | {
"db_id": "donor.sqlite",
"gt_sql": "SELECT COUNT(teacher_acctid) FROM projects WHERE teacher_prefix = 'Mr.' AND primary_focus_subject = 'Literature & Writing'",
"index": 1584,
"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 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: ['Many', 'Selma', 'Dallas']\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_charter text, -- example: ['f', 't']\n school_magnet text, -- example: ['f', 't']\n school_year_round text, -- 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: ['Literature & Writing', '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 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 donations (\n donationid text, -- example: ['000000a91a14ed37bef82e125c102e77', '000013be53ed7382ed5d5975eb86eb85']\n projectid text, -- example: ['ffffac55ee02a49d1abc87ba6fc61135', 'ffff97ed93720407d70a2787475932b0']\n donor_city text, -- example: ['Many', '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_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: ['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_name text, -- example: ['Focus', 'How Many?', 'iPod nano 4th Gen 8GB (Black)', 'Sony bloggie MHS-FS1 - camcorder - inter']\n item_number text, -- example: ['FOCUS', '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:\nLiterature & Writing' is primary_focus_subject; use 'Mr' as their teacher prefix refers to teacher_prefix = 'Mr';\nHow many teachers that have Literature & Writing as their primary focus subject use 'Mr' as their teacher prefix?\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: ['ABC Read', 'iMath', \"Recording Rockin' Readers\"]\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_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_district text, -- example: ['Selma Unified Sch District', 'Richardson Ind School District']\n school_magnet text, -- example: ['f', 't']\n school_year_round text, -- example: ['f', 't']\n school_kipp text, -- school Knowledge Is Power Program, 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 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 students_reached integer, -- example: [32, 22]\n eligible_almost_home_match text, -- example: ['f', 't']\n PRIMARY KEY (projectid)\n);\n\nCREATE TABLE resources (\n resourceid text, -- example: ['0000037fecc4461faf0e49328ae66661', '0000046b69c683354ca46b30db5c558e']\n projectid text, -- example: ['ffffc4f85b60efc5b52347df489d0238', 'ffffac55ee02a49d1abc87ba6fc61135']\n project_resource_type text, -- example: ['Technology', 'Supplies']\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: ['city', 'City', 'abc', 'Abc', 'Peachtree City', 'Rockville']\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 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:\nABC Read' is the title; city refers to school_city\nFor the teacher who wrote the project 'ABC Read', which city was he/she in?\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.school_city FROM essays AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T1.title = 'ABC Read'",
"style": "rule"
} | {
"db_id": "donor.sqlite",
"gt_sql": "SELECT T2.school_city FROM essays AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T1.title = 'ABC Read'",
"index": 1585,
"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: ['ABC Read', 'iMath', \"Recording Rockin' Readers\"]\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_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_district text, -- example: ['Selma Unified Sch District', 'Richardson Ind School District']\n school_magnet text, -- example: ['f', 't']\n school_year_round text, -- example: ['f', 't']\n school_kipp text, -- school Knowledge Is Power Program, 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 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 students_reached integer, -- example: [32, 22]\n eligible_almost_home_match text, -- example: ['f', 't']\n PRIMARY KEY (projectid)\n);\n\nCREATE TABLE resources (\n resourceid text, -- example: ['0000037fecc4461faf0e49328ae66661', '0000046b69c683354ca46b30db5c558e']\n projectid text, -- example: ['ffffc4f85b60efc5b52347df489d0238', 'ffffac55ee02a49d1abc87ba6fc61135']\n project_resource_type text, -- example: ['Technology', 'Supplies']\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: ['city', 'City', 'abc', 'Abc', 'Peachtree City', 'Rockville']\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 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:\nABC Read' is the title; city refers to school_city\nFor the teacher who wrote the project 'ABC Read', which city was he/she in?\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: ['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 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: ['Strong', '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_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_city text, -- example: ['Carpenter', 'Donation', 'Strong', '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_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_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: ['Education', 'EDUCATION', 'donation', 'Donation', 'Believe', \"I'm a strong believer in education.\"]\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 item_name text, -- example: ['Carpenter', 'Believe', 'believe', '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 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:\nWhat is the title for the project that got the donation message as \"Donation on behalf of Matt Carpenter because I'm a strong believer in education\".\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.title FROM essays AS T1 INNER JOIN donations AS T2 ON T1.projectid = T2.projectid WHERE T2.donation_message LIKE 'Donation on behalf of Matt Carpenter because I''m a strong believer in education.'",
"style": "rule"
} | {
"db_id": "donor.sqlite",
"gt_sql": "SELECT T1.title FROM essays AS T1 INNER JOIN donations AS T2 ON T1.projectid = T2.projectid WHERE T2.donation_message LIKE 'Donation on behalf of Matt Carpenter because I''m a strong believer in education.'",
"index": 1586,
"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: ['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 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: ['Strong', '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_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_city text, -- example: ['Carpenter', 'Donation', 'Strong', '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_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_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: ['Education', 'EDUCATION', 'donation', 'Donation', 'Believe', \"I'm a strong believer in education.\"]\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 item_name text, -- example: ['Carpenter', 'Believe', 'believe', '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 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:\nWhat is the title for the project that got the donation message as \"Donation on behalf of Matt Carpenter because I'm a strong believer in education\".\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 donor_zip text, -- example: ['30269', '20853']\n donation_optional_support real, -- example: [7.5, 4.73]\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 project_resource_type text, -- example: ['Technology', 'Supplies']\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 title text, -- example: ['Armenian Genocide', '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 projects (\n projectid text, -- example: ['00001ccc0e81598c4bd86bacb94d7acb', '00002bff514104264a6b798356fdd893']\n school_zip integer, -- example: [93662, 75243]\n school_charter text, -- example: ['f', 't']\n school_magnet text, -- example: ['f', 't']\n school_nlns text, -- school Nonleafy Normal Stature, example: ['f', 't']\n primary_focus_subject text, -- example: ['Literature & Writing', 'Literacy']\n grade_level text, -- example: ['Grades 6-8', 'Grades PreK-2']\n total_price_excluding_optional_support real, -- example: [555.81, 296.47]\n eligible_almost_home_match text, -- example: ['f', 't']\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:\nArmenian Genocide' is the title;\nWhat was the donation optional support amount for the project 'Armenian Genocide'?\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.donation_optional_support FROM essays AS T1 INNER JOIN donations AS T2 ON T1.projectid = T2.projectid WHERE T1.title LIKE 'Armenian Genocide'",
"style": "rule"
} | {
"db_id": "donor.sqlite",
"gt_sql": "SELECT T2.donation_optional_support FROM essays AS T1 INNER JOIN donations AS T2 ON T1.projectid = T2.projectid WHERE T1.title LIKE 'Armenian Genocide'",
"index": 1587,
"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 donor_zip text, -- example: ['30269', '20853']\n donation_optional_support real, -- example: [7.5, 4.73]\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 project_resource_type text, -- example: ['Technology', 'Supplies']\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 title text, -- example: ['Armenian Genocide', '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 projects (\n projectid text, -- example: ['00001ccc0e81598c4bd86bacb94d7acb', '00002bff514104264a6b798356fdd893']\n school_zip integer, -- example: [93662, 75243]\n school_charter text, -- example: ['f', 't']\n school_magnet text, -- example: ['f', 't']\n school_nlns text, -- school Nonleafy Normal Stature, example: ['f', 't']\n primary_focus_subject text, -- example: ['Literature & Writing', 'Literacy']\n grade_level text, -- example: ['Grades 6-8', 'Grades PreK-2']\n total_price_excluding_optional_support real, -- example: [555.81, 296.47]\n eligible_almost_home_match text, -- example: ['f', 't']\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:\nArmenian Genocide' is the title;\nWhat was the donation optional support amount for the project 'Armenian Genocide'?\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 school_ncesid text, -- school national center for education statistics id, example: ['063627006187', '483702008193']\n school_city text, -- example: ['Selma', 'Dallas']\n school_zip integer, -- example: [93662, 75243]\n school_charter text, -- example: ['f', 't']\n school_nlns text, -- school Nonleafy Normal Stature, 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: ['Literature & Writing', 'Literacy']\n poverty_level text, -- example: ['highest poverty', 'high poverty']\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_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 project_resource_type text, -- example: ['Technology', 'Supplies']\n item_name text, -- example: ['Help Me', 'iPod nano 4th Gen 8GB (Black)', 'Sony bloggie MHS-FS1 - camcorder - inter']\n item_number text, -- example: ['249995.001', 'BB11216668']\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: ['Donation', 'Ca', 'ca', 'CA', 'Peachtree City', 'Rockville']\n donation_included_optional_support 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 essays (\n projectid text, -- example: ['ffffc4f85b60efc5b52347df489d0238', 'ffffac55ee02a49d1abc87ba6fc61135']\n title text, -- example: [\"I Can't See It...Can You Help Me???\", '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);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nI Can't See It...Can You Help Me???' is the title;\nDid the project 'I Can't See It...Can You Help Me???' get the tip for the donation?\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.donation_included_optional_support FROM essays AS T1 INNER JOIN donations AS T2 ON T1.projectid = T2.projectid WHERE T1.title LIKE 'I Can''t See It...Can You Help Me???'",
"style": "rule"
} | {
"db_id": "donor.sqlite",
"gt_sql": "SELECT T2.donation_included_optional_support FROM essays AS T1 INNER JOIN donations AS T2 ON T1.projectid = T2.projectid WHERE T1.title LIKE 'I Can''t See It...Can You Help Me???'",
"index": 1588,
"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 school_ncesid text, -- school national center for education statistics id, example: ['063627006187', '483702008193']\n school_city text, -- example: ['Selma', 'Dallas']\n school_zip integer, -- example: [93662, 75243]\n school_charter text, -- example: ['f', 't']\n school_nlns text, -- school Nonleafy Normal Stature, 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: ['Literature & Writing', 'Literacy']\n poverty_level text, -- example: ['highest poverty', 'high poverty']\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_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 project_resource_type text, -- example: ['Technology', 'Supplies']\n item_name text, -- example: ['Help Me', 'iPod nano 4th Gen 8GB (Black)', 'Sony bloggie MHS-FS1 - camcorder - inter']\n item_number text, -- example: ['249995.001', 'BB11216668']\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: ['Donation', 'Ca', 'ca', 'CA', 'Peachtree City', 'Rockville']\n donation_included_optional_support 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 essays (\n projectid text, -- example: ['ffffc4f85b60efc5b52347df489d0238', 'ffffac55ee02a49d1abc87ba6fc61135']\n title text, -- example: [\"I Can't See It...Can You Help Me???\", '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);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nI Can't See It...Can You Help Me???' is the title;\nDid the project 'I Can't See It...Can You Help Me???' get the tip for the donation?\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 donation_to_project real, -- example: [42.5, 26.83]\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 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 schoolid text, -- example: ['c0e6ce89b244764085691a1b8e28cb81', 'd711e47810900c96f26a5d0be30c446d']\n school_state text, -- example: ['ID', 'CA', 'TX']\n school_county text, -- example: ['Fresno', 'Dallas']\n teacher_ny_teaching_fellow text, -- teacher_new_york_teaching_fellow, example: ['f', 't']\n resource_type text, -- example: ['Books', 'Technology']\n total_price_including_optional_support real, -- example: [653.89, 348.79]\n PRIMARY KEY (projectid)\n);\n\nCREATE TABLE essays (\n projectid text, -- example: ['ffffc4f85b60efc5b52347df489d0238', 'ffffac55ee02a49d1abc87ba6fc61135']\n title text, -- example: ['Virtual Aquarium Needs Help!', '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);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nVirtual Aquarium Needs Help!' is the title;\nShow the school id for the project 'Virtual Aquarium Needs Help!'.\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.schoolid FROM essays AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T1.title LIKE 'Virtual Aquarium Needs Help!'",
"style": "rule"
} | {
"db_id": "donor.sqlite",
"gt_sql": "SELECT T2.schoolid FROM essays AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T1.title LIKE 'Virtual Aquarium Needs Help!'",
"index": 1589,
"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 donation_to_project real, -- example: [42.5, 26.83]\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 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 schoolid text, -- example: ['c0e6ce89b244764085691a1b8e28cb81', 'd711e47810900c96f26a5d0be30c446d']\n school_state text, -- example: ['ID', 'CA', 'TX']\n school_county text, -- example: ['Fresno', 'Dallas']\n teacher_ny_teaching_fellow text, -- teacher_new_york_teaching_fellow, example: ['f', 't']\n resource_type text, -- example: ['Books', 'Technology']\n total_price_including_optional_support real, -- example: [653.89, 348.79]\n PRIMARY KEY (projectid)\n);\n\nCREATE TABLE essays (\n projectid text, -- example: ['ffffc4f85b60efc5b52347df489d0238', 'ffffac55ee02a49d1abc87ba6fc61135']\n title text, -- example: ['Virtual Aquarium Needs Help!', '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);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nVirtual Aquarium Needs Help!' is the title;\nShow the school id for the project 'Virtual Aquarium Needs Help!'.\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 is_teacher_acct text, -- example: ['f', 't']\n donation_total real, -- example: [50.0, 31.56]\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 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 teacher_acctid text, -- example: ['42d43fa6f37314365d08692e08680973', '864eb466462bf704bf7a16a585ef296a']\n school_ncesid text, -- school national center for education statistics id, example: ['063627006187', '483702008193']\n school_city text, -- example: ['Selma', 'Dallas']\n school_metro text, -- example: ['urban', 'rural']\n school_kipp text, -- school Knowledge Is Power Program, example: ['f', 't']\n school_charter_ready_promise text, -- example: ['f', 't']\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 PRIMARY KEY (projectid)\n);\n\nCREATE TABLE resources (\n resourceid text, -- example: ['0000037fecc4461faf0e49328ae66661', '0000046b69c683354ca46b30db5c558e']\n projectid text, -- example: ['ffffc4f85b60efc5b52347df489d0238', 'ffffac55ee02a49d1abc87ba6fc61135']\n project_resource_type text, -- example: ['Technology', 'Supplies']\n item_number text, -- example: ['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 essays (\n projectid text, -- example: ['ffffc4f85b60efc5b52347df489d0238', 'ffffac55ee02a49d1abc87ba6fc61135']\n title text, -- example: ['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);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nbiggest donation refers to donation_total = 'max';\nWhat was the title for the project which got the biggest donation?\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.title FROM essays AS T1 INNER JOIN donations AS T2 ON T1.projectid = T2.projectid WHERE T2.donation_total = ( SELECT MAX(donation_total) FROM donations )",
"style": "rule"
} | {
"db_id": "donor.sqlite",
"gt_sql": "SELECT T1.title FROM essays AS T1 INNER JOIN donations AS T2 ON T1.projectid = T2.projectid WHERE T2.donation_total = ( SELECT MAX(donation_total) FROM donations )",
"index": 1590,
"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 is_teacher_acct text, -- example: ['f', 't']\n donation_total real, -- example: [50.0, 31.56]\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 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 teacher_acctid text, -- example: ['42d43fa6f37314365d08692e08680973', '864eb466462bf704bf7a16a585ef296a']\n school_ncesid text, -- school national center for education statistics id, example: ['063627006187', '483702008193']\n school_city text, -- example: ['Selma', 'Dallas']\n school_metro text, -- example: ['urban', 'rural']\n school_kipp text, -- school Knowledge Is Power Program, example: ['f', 't']\n school_charter_ready_promise text, -- example: ['f', 't']\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 PRIMARY KEY (projectid)\n);\n\nCREATE TABLE resources (\n resourceid text, -- example: ['0000037fecc4461faf0e49328ae66661', '0000046b69c683354ca46b30db5c558e']\n projectid text, -- example: ['ffffc4f85b60efc5b52347df489d0238', 'ffffac55ee02a49d1abc87ba6fc61135']\n project_resource_type text, -- example: ['Technology', 'Supplies']\n item_number text, -- example: ['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 essays (\n projectid text, -- example: ['ffffc4f85b60efc5b52347df489d0238', 'ffffac55ee02a49d1abc87ba6fc61135']\n title text, -- example: ['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);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nbiggest donation refers to donation_total = 'max';\nWhat was the title for the project which got the biggest donation?\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_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_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 essays (\n projectid text, -- example: ['ffffc4f85b60efc5b52347df489d0238', 'ffffac55ee02a49d1abc87ba6fc61135']\n teacher_acctid text, -- example: ['c24011b20fc161ed02248e85beb59a90', '947066d0af47e0566f334566553dd6a6']\n title text, -- example: ['Bringing Drama to Life', '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: ['Percentage', 'Count', 'Drama', '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 donor_acctid text, -- donor accid, example: ['22cbc920c9b5fa08dfb331422f5926b5', '521f1830a77c9dbbf8119d99c6206a16']\n donor_city text, -- example: ['Donation', '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: ['creditcard', 'no_cash_received']\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);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nBringing Drama to Life' is the title; Percentage = Divide(Count(payment_method = 'creditcard'), Count(projectid))*100;\nFor the all donations to the project 'Bringing Drama to Life', what is the percentage of the donation is paid by credit 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 CAST(SUM(CASE WHEN T2.payment_method LIKE 'creditcard' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(donationid) FROM essays AS T1 INNER JOIN donations AS T2 ON T1.projectid = T2.projectid WHERE T1.title LIKE 'Bringing Drama to Life'",
"style": "rule"
} | {
"db_id": "donor.sqlite",
"gt_sql": "SELECT CAST(SUM(CASE WHEN T2.payment_method LIKE 'creditcard' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(donationid) FROM essays AS T1 INNER JOIN donations AS T2 ON T1.projectid = T2.projectid WHERE T1.title LIKE 'Bringing Drama to Life'",
"index": 1591,
"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_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_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 essays (\n projectid text, -- example: ['ffffc4f85b60efc5b52347df489d0238', 'ffffac55ee02a49d1abc87ba6fc61135']\n teacher_acctid text, -- example: ['c24011b20fc161ed02248e85beb59a90', '947066d0af47e0566f334566553dd6a6']\n title text, -- example: ['Bringing Drama to Life', '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: ['Percentage', 'Count', 'Drama', '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 donor_acctid text, -- donor accid, example: ['22cbc920c9b5fa08dfb331422f5926b5', '521f1830a77c9dbbf8119d99c6206a16']\n donor_city text, -- example: ['Donation', '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: ['creditcard', 'no_cash_received']\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);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nBringing Drama to Life' is the title; Percentage = Divide(Count(payment_method = 'creditcard'), Count(projectid))*100;\nFor the all donations to the project 'Bringing Drama to Life', what is the percentage of the donation is paid by credit 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_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_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_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 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 PRIMARY KEY (projectid)\n);\n\nCREATE TABLE essays (\n projectid text, -- example: ['ffffc4f85b60efc5b52347df489d0238', 'ffffac55ee02a49d1abc87ba6fc61135']\n title text, -- example: ['Family History Project ', '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: ['History', '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 donor_acctid text, -- donor accid, example: ['22cbc920c9b5fa08dfb331422f5926b5', '521f1830a77c9dbbf8119d99c6206a16']\n donor_city text, -- example: ['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 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 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);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nFamily History Project refer to title, need statement refer to need_statement\nWrite down the need statement of Family History Project.\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 need_statement FROM essays WHERE title = 'Family History Project'",
"style": "rule"
} | {
"db_id": "donor.sqlite",
"gt_sql": "SELECT need_statement FROM essays WHERE title = 'Family History Project'",
"index": 1592,
"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_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_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_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 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 PRIMARY KEY (projectid)\n);\n\nCREATE TABLE essays (\n projectid text, -- example: ['ffffc4f85b60efc5b52347df489d0238', 'ffffac55ee02a49d1abc87ba6fc61135']\n title text, -- example: ['Family History Project ', '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: ['History', '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 donor_acctid text, -- donor accid, example: ['22cbc920c9b5fa08dfb331422f5926b5', '521f1830a77c9dbbf8119d99c6206a16']\n donor_city text, -- example: ['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 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 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);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nFamily History Project refer to title, need statement refer to need_statement\nWrite down the need statement of Family History Project.\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);\n\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 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_state text, -- example: ['GA', 'MD']\n is_teacher_acct text, -- example: ['f', 't']\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_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: ['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 school_ncesid text, -- school national center for education statistics id, example: ['063627006187', '483702008193']\n school_longitude real, -- example: [-119.608713, -96.72364]\n school_city text, -- example: ['Livingston', 'Many', 'Selma', 'Dallas']\n school_state text, -- example: ['CA', 'TX']\n school_metro text, -- example: ['suburban', 'urban', 'rural']\n school_district text, -- example: ['Livingston Parish School Dist', 'Union Parish School District', 'Allen Parish School District', 'Selma Unified Sch District', 'Richardson Ind School District']\n school_county text, -- example: ['Livingston', 'Fresno', 'Dallas']\n school_charter text, -- example: ['f', 't']\n school_magnet text, -- 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 secondary_focus_subject text, -- example: ['College & Career Prep', 'ESL']\n resource_type text, -- example: ['Books', 'Technology']\n fulfillment_labor_materials real, -- example: [30.0, 35.0]\n students_reached integer, -- example: [32, 22]\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:\nsuburban metros refer to metro = 'suburban'; Livingston Parish School District refer to school_district\nHow many suburban metros are there in Livingston Parish School District?\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(projectid) FROM projects WHERE school_district = 'Livingston Parish School Dist' AND school_metro = 'suburban'",
"style": "rule"
} | {
"db_id": "donor.sqlite",
"gt_sql": "SELECT COUNT(projectid) FROM projects WHERE school_district = 'Livingston Parish School Dist' AND school_metro = 'suburban'",
"index": 1593,
"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);\n\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 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_state text, -- example: ['GA', 'MD']\n is_teacher_acct text, -- example: ['f', 't']\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_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: ['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 school_ncesid text, -- school national center for education statistics id, example: ['063627006187', '483702008193']\n school_longitude real, -- example: [-119.608713, -96.72364]\n school_city text, -- example: ['Livingston', 'Many', 'Selma', 'Dallas']\n school_state text, -- example: ['CA', 'TX']\n school_metro text, -- example: ['suburban', 'urban', 'rural']\n school_district text, -- example: ['Livingston Parish School Dist', 'Union Parish School District', 'Allen Parish School District', 'Selma Unified Sch District', 'Richardson Ind School District']\n school_county text, -- example: ['Livingston', 'Fresno', 'Dallas']\n school_charter text, -- example: ['f', 't']\n school_magnet text, -- 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 secondary_focus_subject text, -- example: ['College & Career Prep', 'ESL']\n resource_type text, -- example: ['Books', 'Technology']\n fulfillment_labor_materials real, -- example: [30.0, 35.0]\n students_reached integer, -- example: [32, 22]\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:\nsuburban metros refer to metro = 'suburban'; Livingston Parish School District refer to school_district\nHow many suburban metros are there in Livingston Parish School District?\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_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: ['Payment', 'For my students.', 'For my students!', 'For my Students!', 'For my students :)', 'I gave to this project because I support']\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: ['Materials ', 'Materials', 'Materials for Us', '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: ['Resources', '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: ['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_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);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nNeeded Resource Materials For My Students refer to title\nWhat payment method was used for Needed Resource Materials For My Students?\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.payment_method FROM essays AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid INNER JOIN donations AS T3 ON T2.projectid = T3.projectid WHERE T1.title = 'Needed Resource Materials For My Students'",
"style": "rule"
} | {
"db_id": "donor.sqlite",
"gt_sql": "SELECT T3.payment_method FROM essays AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid INNER JOIN donations AS T3 ON T2.projectid = T3.projectid WHERE T1.title = 'Needed Resource Materials For My Students'",
"index": 1594,
"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_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: ['Payment', 'For my students.', 'For my students!', 'For my Students!', 'For my students :)', 'I gave to this project because I support']\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: ['Materials ', 'Materials', 'Materials for Us', '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: ['Resources', '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: ['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_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);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nNeeded Resource Materials For My Students refer to title\nWhat payment method was used for Needed Resource Materials For My Students?\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_city text, -- example: ['Peachtree City', 'Rockville']\n donor_zip text, -- example: ['30269', '20853']\n donation_to_project real, -- example: [42.5, 26.83]\n donation_optional_support real, -- example: [7.5, 4.73]\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 for_honoree text, -- example: ['f', 't']\n donation_message text, -- example: ['Education', 'EDUCATION', 'Education. ', '#education', '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 vendor_name text, -- example: ['Benchmark Education', 'Woodwind and Brasswind', 'Best Buy for Business']\n item_name text, -- example: ['R & A Plant Genetics', 'Genetics', 'PM Benchmark 1', 'iPod nano 4th Gen 8GB (Black)', 'Sony bloggie MHS-FS1 - camcorder - inter']\n item_number text, -- example: ['GIVE', '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 projects (\n projectid text, -- example: ['00001ccc0e81598c4bd86bacb94d7acb', '00002bff514104264a6b798356fdd893']\n teacher_acctid text, -- example: ['42d43fa6f37314365d08692e08680973', '864eb466462bf704bf7a16a585ef296a']\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_charter text, -- example: ['f', 't']\n school_magnet text, -- example: ['f', 't']\n school_nlns text, -- school Nonleafy Normal Stature, 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 secondary_focus_area text, -- example: ['Applied Learning', 'Literacy & Language']\n resource_type text, -- example: ['Books', 'Technology']\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 PRIMARY KEY (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);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\ncoordinates refer to (school_latitude, school_longitude); R & A Plant Genetics refer to item_name; Benchmark Education refer to vendor_name\nGive the coordinates of the buyer of R & A Plant Genetics from Benchmark Education.\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.school_latitude, T2.school_longitude FROM resources AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T1.item_name = 'R & A Plant Genetics' AND T1.vendor_name = 'Benchmark Education'",
"style": "rule"
} | {
"db_id": "donor.sqlite",
"gt_sql": "SELECT T2.school_latitude, T2.school_longitude FROM resources AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T1.item_name = 'R & A Plant Genetics' AND T1.vendor_name = 'Benchmark Education'",
"index": 1595,
"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_city text, -- example: ['Peachtree City', 'Rockville']\n donor_zip text, -- example: ['30269', '20853']\n donation_to_project real, -- example: [42.5, 26.83]\n donation_optional_support real, -- example: [7.5, 4.73]\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 for_honoree text, -- example: ['f', 't']\n donation_message text, -- example: ['Education', 'EDUCATION', 'Education. ', '#education', '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 vendor_name text, -- example: ['Benchmark Education', 'Woodwind and Brasswind', 'Best Buy for Business']\n item_name text, -- example: ['R & A Plant Genetics', 'Genetics', 'PM Benchmark 1', 'iPod nano 4th Gen 8GB (Black)', 'Sony bloggie MHS-FS1 - camcorder - inter']\n item_number text, -- example: ['GIVE', '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 projects (\n projectid text, -- example: ['00001ccc0e81598c4bd86bacb94d7acb', '00002bff514104264a6b798356fdd893']\n teacher_acctid text, -- example: ['42d43fa6f37314365d08692e08680973', '864eb466462bf704bf7a16a585ef296a']\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_charter text, -- example: ['f', 't']\n school_magnet text, -- example: ['f', 't']\n school_nlns text, -- school Nonleafy Normal Stature, 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 secondary_focus_area text, -- example: ['Applied Learning', 'Literacy & Language']\n resource_type text, -- example: ['Books', 'Technology']\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 PRIMARY KEY (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);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\ncoordinates refer to (school_latitude, school_longitude); R & A Plant Genetics refer to item_name; Benchmark Education refer to vendor_name\nGive the coordinates of the buyer of R & A Plant Genetics from Benchmark Education.\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_longitude real, -- example: [-119.608713, -96.72364]\n school_city text, -- example: ['Newark', '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_charter text, -- example: ['f', 't']\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 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_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: ['Donation', 'Newark', 'newark', 'NEWARK', 'Peachtree City', 'Rockville']\n donor_state text, -- example: ['GA', 'MD']\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 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', 'Donate!', '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 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 item_name text, -- example: ['The Message', '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);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nmessage refer to donation_message; Newark School District refer to school_district; 40.735332, -74.196014 refer to (school latitude, school_longitude)\nWrite the messages of those who donated to the Newark School District in the coordinates of 40.735332, -74.196014.\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.donation_message FROM donations AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T2.school_latitude = 40.735332 AND T2.school_longitude = -74.196014 AND T2.school_district = 'Newark School District'",
"style": "rule"
} | {
"db_id": "donor.sqlite",
"gt_sql": "SELECT T1.donation_message FROM donations AS T1 INNER JOIN projects AS T2 ON T1.projectid = T2.projectid WHERE T2.school_latitude = 40.735332 AND T2.school_longitude = -74.196014 AND T2.school_district = 'Newark School District'",
"index": 1596,
"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_longitude real, -- example: [-119.608713, -96.72364]\n school_city text, -- example: ['Newark', '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_charter text, -- example: ['f', 't']\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 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_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: ['Donation', 'Newark', 'newark', 'NEWARK', 'Peachtree City', 'Rockville']\n donor_state text, -- example: ['GA', 'MD']\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 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', 'Donate!', '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 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 item_name text, -- example: ['The Message', '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);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nmessage refer to donation_message; Newark School District refer to school_district; 40.735332, -74.196014 refer to (school latitude, school_longitude)\nWrite the messages of those who donated to the Newark School District in the coordinates of 40.735332, -74.196014.\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_zip integer, -- example: [93662, 75243]\n school_county text, -- example: ['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 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_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_total real, -- example: [50.0, 31.56]\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_was_promo_matched text, -- example: ['f', 't']\n via_giving_page 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_number text, -- example: ['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 essays (\n projectid text, -- example: ['ffffc4f85b60efc5b52347df489d0238', 'ffffac55ee02a49d1abc87ba6fc61135']\n teacher_acctid text, -- example: ['c24011b20fc161ed02248e85beb59a90', '947066d0af47e0566f334566553dd6a6']\n title text, -- example: ['Lets Share Ideas', 'iMath', \"Recording Rockin' Readers\"]\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:\ndate refer to date_posted; Lets Share Ideas refer to title\nWhat date did the project with he 'Lets Share Ideas essay' went 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 'Lets Share Ideas'",
"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 'Lets Share Ideas'",
"index": 1597,
"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_zip integer, -- example: [93662, 75243]\n school_county text, -- example: ['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 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_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_total real, -- example: [50.0, 31.56]\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_was_promo_matched text, -- example: ['f', 't']\n via_giving_page 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_number text, -- example: ['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 essays (\n projectid text, -- example: ['ffffc4f85b60efc5b52347df489d0238', 'ffffac55ee02a49d1abc87ba6fc61135']\n teacher_acctid text, -- example: ['c24011b20fc161ed02248e85beb59a90', '947066d0af47e0566f334566553dd6a6']\n title text, -- example: ['Lets Share Ideas', 'iMath', \"Recording Rockin' Readers\"]\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:\ndate refer to date_posted; Lets Share Ideas refer to title\nWhat date did the project with he 'Lets Share Ideas essay' went 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 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 donation_optional_support real, -- example: [7.5, 4.73]\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 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_latitude real, -- example: [36.57634, 32.911179]\n school_charter_ready_promise text, -- example: ['f', 't']\n primary_focus_area text, -- example: ['Literacy & Language', 'History & Civics']\n secondary_focus_area text, -- example: ['Applied Learning', 'Literacy & Language']\n grade_level text, -- example: ['Grades 6-8', 'Grades PreK-2']\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: ['Woodwind and Brasswind', 'Best Buy for Business']\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:\nhave not received a cash donation refers to payment_method = 'no_cash_received'; received a portion of a donation included corporate sponsored giftcard payment_included_campaign_gift_card = 't'; percentage refers to DIVIDE(payment_included_campaign_gift_card = 't',payment_included_campaign_gift_card)*100\nWhat percentage of projects that have not received a cash donation have received a portion of a donation included 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 CAST(SUM(CASE WHEN payment_included_campaign_gift_card = 't' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(donationid) FROM donations WHERE payment_method = 'no_cash_received'",
"style": "rule"
} | {
"db_id": "donor.sqlite",
"gt_sql": "SELECT CAST(SUM(CASE WHEN payment_included_campaign_gift_card = 't' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(donationid) FROM donations WHERE payment_method = 'no_cash_received'",
"index": 1598,
"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 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 donation_optional_support real, -- example: [7.5, 4.73]\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 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_latitude real, -- example: [36.57634, 32.911179]\n school_charter_ready_promise text, -- example: ['f', 't']\n primary_focus_area text, -- example: ['Literacy & Language', 'History & Civics']\n secondary_focus_area text, -- example: ['Applied Learning', 'Literacy & Language']\n grade_level text, -- example: ['Grades 6-8', 'Grades PreK-2']\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: ['Woodwind and Brasswind', 'Best Buy for Business']\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:\nhave not received a cash donation refers to payment_method = 'no_cash_received'; received a portion of a donation included corporate sponsored giftcard payment_included_campaign_gift_card = 't'; percentage refers to DIVIDE(payment_included_campaign_gift_card = 't',payment_included_campaign_gift_card)*100\nWhat percentage of projects that have not received a cash donation have received a portion of a donation included 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 resources (\n resourceid text, -- example: ['0000037fecc4461faf0e49328ae66661', '0000046b69c683354ca46b30db5c558e']\n projectid text, -- example: ['ffffc4f85b60efc5b52347df489d0238', 'ffffac55ee02a49d1abc87ba6fc61135']\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_city text, -- example: ['Divide', 'Selma', 'Dallas']\n school_charter_ready_promise text, -- example: ['f', 't']\n fulfillment_labor_materials real, -- example: [30.0, 35.0]\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 dollar_amount text, -- example: ['10_to_100', 'under_10']\n payment_method text, -- example: ['no_cash_received', 'creditcard']\n payment_included_web_purchased_gift_card 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);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nmade in March 2013 refers to substr(donation_timestamp,1,7) = '2013-03'; percentage refers to DIVIDE(SUM(payment_method made in March 2013), SUM(payment_method))*100\nWhat is the percentage of payment methods of donations made in March 2013?\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 payment_method , CAST(COUNT(donationid) AS REAL) * 100 / 51090 FROM donations WHERE donation_timestamp LIKE '2013-03%' GROUP BY payment_method",
"style": "rule"
} | {
"db_id": "donor.sqlite",
"gt_sql": "SELECT payment_method , CAST(COUNT(donationid) AS REAL) * 100 / 51090 FROM donations WHERE donation_timestamp LIKE '2013-03%' GROUP BY payment_method",
"index": 1599,
"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 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_city text, -- example: ['Divide', 'Selma', 'Dallas']\n school_charter_ready_promise text, -- example: ['f', 't']\n fulfillment_labor_materials real, -- example: [30.0, 35.0]\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 dollar_amount text, -- example: ['10_to_100', 'under_10']\n payment_method text, -- example: ['no_cash_received', 'creditcard']\n payment_included_web_purchased_gift_card 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);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nmade in March 2013 refers to substr(donation_timestamp,1,7) = '2013-03'; percentage refers to DIVIDE(SUM(payment_method made in March 2013), SUM(payment_method))*100\nWhat is the percentage of payment methods of donations made in March 2013?\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.