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 Solution (\n Id integer, -- example: [1, 2]\n Path text, -- example: ['wallerdev_htmlsharp\\\\HtmlSharp.sln', 'maravillas_linq-to-delicious\\\\tasty.sln']\n WasCompiled integer, -- example: [1, 0]\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE MethodParameter (\n Id integer, -- example: [1, 2]\n Type text, -- example: ['System.String', 'System.Int32']\n Name text, -- example: ['Tell', 'data', 'i']\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Method (\n Id integer, -- example: [1, 2]\n Name text, -- example: ['ExportToRTF.RTFStyleSheet.H6Write', 'HtmlSharp.HtmlParser.Feed', 'HtmlSharp.HtmlParser.ParseDoctypeElement']\n FullComment text, -- example: ['Feeds data into the parser', ' interneral -- scan past <!ELEMENT decla']\n Summary text, -- example: ['Converts the query expression into text ', 'Execute the query expression ']\n CommentIsXml integer, -- example: [0, 1]\n SampledAt integer, -- example: [636430963695654788, 636430963695709898]\n SolutionId integer, -- example: [1, 2]\n Lang text, -- Language, example: ['en', 'fr']\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Repo (\n Id integer, -- example: [1, 2]\n Forks integer, -- example: [2, 3]\n ProcessedTime integer, -- example: [636430963247108053, 636472436323838240]\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:\npath of the solution refers to Path; method refers to Name; Name = 'ExportToRTF.RTFStyleSheet.H6Write';\nTell the path of the solution for the method \"ExportToRTF.RTFStyleSheet.H6Write\".\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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.Path FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T2.Name = 'ExportToRTF.RTFStyleSheet.H6Write'",
"style": "rule"
} | {
"db_id": "codebase_comments.sqlite",
"gt_sql": "SELECT T1.Path FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T2.Name = 'ExportToRTF.RTFStyleSheet.H6Write'",
"index": 300,
"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 Solution (\n Id integer, -- example: [1, 2]\n Path text, -- example: ['wallerdev_htmlsharp\\\\HtmlSharp.sln', 'maravillas_linq-to-delicious\\\\tasty.sln']\n WasCompiled integer, -- example: [1, 0]\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE MethodParameter (\n Id integer, -- example: [1, 2]\n Type text, -- example: ['System.String', 'System.Int32']\n Name text, -- example: ['Tell', 'data', 'i']\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Method (\n Id integer, -- example: [1, 2]\n Name text, -- example: ['ExportToRTF.RTFStyleSheet.H6Write', 'HtmlSharp.HtmlParser.Feed', 'HtmlSharp.HtmlParser.ParseDoctypeElement']\n FullComment text, -- example: ['Feeds data into the parser', ' interneral -- scan past <!ELEMENT decla']\n Summary text, -- example: ['Converts the query expression into text ', 'Execute the query expression ']\n CommentIsXml integer, -- example: [0, 1]\n SampledAt integer, -- example: [636430963695654788, 636430963695709898]\n SolutionId integer, -- example: [1, 2]\n Lang text, -- Language, example: ['en', 'fr']\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Repo (\n Id integer, -- example: [1, 2]\n Forks integer, -- example: [2, 3]\n ProcessedTime integer, -- example: [636430963247108053, 636472436323838240]\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:\npath of the solution refers to Path; method refers to Name; Name = 'ExportToRTF.RTFStyleSheet.H6Write';\nTell the path of the solution for the method \"ExportToRTF.RTFStyleSheet.H6Write\".\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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 MethodParameter (\n Id integer, -- example: [1, 2]\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Method (\n Id integer, -- example: [1, 2]\n FullComment text, -- example: ['Feeds data into the parser', ' interneral -- scan past <!ELEMENT decla']\n CommentIsXml integer, -- example: [0, 1]\n SampledAt integer, -- example: [636430963695654788, 636430963695709898]\n Lang text, -- Language, example: ['en', 'fr']\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Solution (\n Id integer, -- example: [1, 2]\n RepoId integer, -- Repository Id, example: [1, 3]\n Path text, -- example: ['wallerdev_htmlsharp\\\\HtmlSharp.sln', 'maravillas_linq-to-delicious\\\\tasty.sln']\n ProcessedTime integer, -- example: [636430963695642191, 636430963721734366]\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Repo (\n Id integer, -- example: [1, 2]\n Url text, -- example: ['https://github.com/wallerdev/htmlsharp.g', 'https://github.com/unclebob/nslim.git']\n Stars integer, -- example: [14, 6]\n Forks integer, -- example: [2, 3]\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:\nrepository URL refers to Url; repository Url with most solutions refers to MAX(COUNT(Solution.Id));\nGive the repository Url of the one with most solutions.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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.Url FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId GROUP BY T2.RepoId ORDER BY COUNT(T2.RepoId) DESC LIMIT 1",
"style": "rule"
} | {
"db_id": "codebase_comments.sqlite",
"gt_sql": "SELECT T1.Url FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId GROUP BY T2.RepoId ORDER BY COUNT(T2.RepoId) DESC LIMIT 1",
"index": 301,
"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 MethodParameter (\n Id integer, -- example: [1, 2]\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Method (\n Id integer, -- example: [1, 2]\n FullComment text, -- example: ['Feeds data into the parser', ' interneral -- scan past <!ELEMENT decla']\n CommentIsXml integer, -- example: [0, 1]\n SampledAt integer, -- example: [636430963695654788, 636430963695709898]\n Lang text, -- Language, example: ['en', 'fr']\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Solution (\n Id integer, -- example: [1, 2]\n RepoId integer, -- Repository Id, example: [1, 3]\n Path text, -- example: ['wallerdev_htmlsharp\\\\HtmlSharp.sln', 'maravillas_linq-to-delicious\\\\tasty.sln']\n ProcessedTime integer, -- example: [636430963695642191, 636430963721734366]\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Repo (\n Id integer, -- example: [1, 2]\n Url text, -- example: ['https://github.com/wallerdev/htmlsharp.g', 'https://github.com/unclebob/nslim.git']\n Stars integer, -- example: [14, 6]\n Forks integer, -- example: [2, 3]\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:\nrepository URL refers to Url; repository Url with most solutions refers to MAX(COUNT(Solution.Id));\nGive the repository Url of the one with most solutions.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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 Method (\n Id integer, -- example: [1, 2]\n FullComment text, -- example: ['Feeds data into the parser', ' interneral -- scan past <!ELEMENT decla']\n Lang text, -- Language, example: ['en', 'fr']\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Solution (\n Id integer, -- example: [1, 2]\n RepoId integer, -- Repository Id, example: [1, 3]\n ProcessedTime integer, -- example: [636430963695642191, 636430963721734366]\n WasCompiled integer, -- example: [1, 0]\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE MethodParameter (\n Id integer, -- example: [1, 2]\n Name text, -- example: ['forks', 'which', 'Which', 'fork', 'has', 'how']\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Repo (\n Id integer, -- example: [1, 2]\n Stars integer, -- example: [14, 6]\n Forks integer, -- example: [2, 3]\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:\nsolutions refers to Solution.Id; repository refers to Repository.Id;\nHow many solutions does the repository which has 1445 Forks contain?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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.RepoId) FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T1.Forks = 1445",
"style": "rule"
} | {
"db_id": "codebase_comments.sqlite",
"gt_sql": "SELECT COUNT(T2.RepoId) FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T1.Forks = 1445",
"index": 302,
"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 Method (\n Id integer, -- example: [1, 2]\n FullComment text, -- example: ['Feeds data into the parser', ' interneral -- scan past <!ELEMENT decla']\n Lang text, -- Language, example: ['en', 'fr']\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Solution (\n Id integer, -- example: [1, 2]\n RepoId integer, -- Repository Id, example: [1, 3]\n ProcessedTime integer, -- example: [636430963695642191, 636430963721734366]\n WasCompiled integer, -- example: [1, 0]\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE MethodParameter (\n Id integer, -- example: [1, 2]\n Name text, -- example: ['forks', 'which', 'Which', 'fork', 'has', 'how']\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Repo (\n Id integer, -- example: [1, 2]\n Stars integer, -- example: [14, 6]\n Forks integer, -- example: [2, 3]\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:\nsolutions refers to Solution.Id; repository refers to Repository.Id;\nHow many solutions does the repository which has 1445 Forks contain?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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 MethodParameter (\n Id integer, -- example: [1, 2]\n MethodId text, -- example: ['1', '2']\n Type text, -- example: ['System.String', 'System.Int32']\n Name text, -- example: ['solutionID', 'solutionId', 'SolutionId', 'which', 'Which', 'most']\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Repo (\n Id integer, -- example: [1, 2]\n Forks integer, -- example: [2, 3]\n ProcessedTime integer, -- example: [636430963247108053, 636472436323838240]\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Method (\n Id integer, -- example: [1, 2]\n Name text, -- example: ['HtmlSharp.HtmlParser.Feed', 'HtmlSharp.HtmlParser.ParseDoctypeElement']\n Summary text, -- example: ['Converts the query expression into text ', 'Execute the query expression ']\n ApiCalls text, -- example: ['System.String.IsNullOrEmpty HtmlSharp.Ht', 'HtmlSharp.HtmlParser.ScanName System.Col']\n SampledAt integer, -- example: [636430963695654788, 636430963695709898]\n SolutionId integer, -- example: [1, 2]\n Lang text, -- Language, example: ['zh-cn', 'en', 'fr']\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Solution (\n Id integer, -- example: [1, 2]\n Path text, -- example: ['wallerdev_htmlsharp\\\\HtmlSharp.sln', 'maravillas_linq-to-delicious\\\\tasty.sln']\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:\nsolution refers to SolutionId; zh-cn refers to Lang = 'zh-cn'; path that is most often used refers to MAX(COUNT(Path));\nAmong all the solution of the 'zh-cn' methods, which path is most often used?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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.Path FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T2.Lang = 'zh-cn' GROUP BY T1.Path ORDER BY COUNT(T1.Path) DESC LIMIT 1",
"style": "rule"
} | {
"db_id": "codebase_comments.sqlite",
"gt_sql": "SELECT T1.Path FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T2.Lang = 'zh-cn' GROUP BY T1.Path ORDER BY COUNT(T1.Path) DESC LIMIT 1",
"index": 303,
"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 MethodParameter (\n Id integer, -- example: [1, 2]\n MethodId text, -- example: ['1', '2']\n Type text, -- example: ['System.String', 'System.Int32']\n Name text, -- example: ['solutionID', 'solutionId', 'SolutionId', 'which', 'Which', 'most']\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Repo (\n Id integer, -- example: [1, 2]\n Forks integer, -- example: [2, 3]\n ProcessedTime integer, -- example: [636430963247108053, 636472436323838240]\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Method (\n Id integer, -- example: [1, 2]\n Name text, -- example: ['HtmlSharp.HtmlParser.Feed', 'HtmlSharp.HtmlParser.ParseDoctypeElement']\n Summary text, -- example: ['Converts the query expression into text ', 'Execute the query expression ']\n ApiCalls text, -- example: ['System.String.IsNullOrEmpty HtmlSharp.Ht', 'HtmlSharp.HtmlParser.ScanName System.Col']\n SampledAt integer, -- example: [636430963695654788, 636430963695709898]\n SolutionId integer, -- example: [1, 2]\n Lang text, -- Language, example: ['zh-cn', 'en', 'fr']\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Solution (\n Id integer, -- example: [1, 2]\n Path text, -- example: ['wallerdev_htmlsharp\\\\HtmlSharp.sln', 'maravillas_linq-to-delicious\\\\tasty.sln']\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:\nsolution refers to SolutionId; zh-cn refers to Lang = 'zh-cn'; path that is most often used refers to MAX(COUNT(Path));\nAmong all the solution of the 'zh-cn' methods, which path is most often used?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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 Method (\n Id integer, -- example: [1, 2]\n Summary text, -- example: ['Converts the query expression into text ', 'Execute the query expression ']\n CommentIsXml integer, -- example: [0, 1]\n Lang text, -- Language, example: ['en', 'fr']\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Solution (\n Id integer, -- example: [1, 2]\n RepoId integer, -- Repository Id, example: [1, 3]\n Path text, -- example: ['wallerdev_htmlsharp\\\\HtmlSharp.sln', 'maravillas_linq-to-delicious\\\\tasty.sln']\n WasCompiled integer, -- example: [1, 0]\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Repo (\n Id integer, -- example: [1, 2]\n Stars integer, -- example: [14, 6]\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE MethodParameter (\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:\nrepository refers to Repository.Id; solution needs to be compiled refers to WasCompiled = 0;\nFor the repository which got '189' Stars, how many solutions which needs to be compiled does it contain?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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.RepoId) FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T1.Stars = 189 AND T2.WasCompiled = 0",
"style": "rule"
} | {
"db_id": "codebase_comments.sqlite",
"gt_sql": "SELECT COUNT(T2.RepoId) FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T1.Stars = 189 AND T2.WasCompiled = 0",
"index": 304,
"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 Method (\n Id integer, -- example: [1, 2]\n Summary text, -- example: ['Converts the query expression into text ', 'Execute the query expression ']\n CommentIsXml integer, -- example: [0, 1]\n Lang text, -- Language, example: ['en', 'fr']\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Solution (\n Id integer, -- example: [1, 2]\n RepoId integer, -- Repository Id, example: [1, 3]\n Path text, -- example: ['wallerdev_htmlsharp\\\\HtmlSharp.sln', 'maravillas_linq-to-delicious\\\\tasty.sln']\n WasCompiled integer, -- example: [1, 0]\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Repo (\n Id integer, -- example: [1, 2]\n Stars integer, -- example: [14, 6]\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE MethodParameter (\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:\nrepository refers to Repository.Id; solution needs to be compiled refers to WasCompiled = 0;\nFor the repository which got '189' Stars, how many solutions which needs to be compiled does it contain?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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 Method (\n Id integer, -- example: [1, 2]\n Name text, -- example: ['HtmlSharp.HtmlParser.Feed', 'HtmlSharp.HtmlParser.ParseDoctypeElement']\n CommentIsXml integer, -- example: [0, 1]\n SampledAt integer, -- example: [636430963695654788, 636430963695709898]\n SolutionId integer, -- example: [1, 2]\n Lang text, -- Language, example: ['en', 'fr']\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Repo (\n Id integer, -- example: [1, 2]\n Stars integer, -- example: [14, 6]\n Forks integer, -- example: [2, 3]\n Watchers integer, -- example: [14, 6]\n ProcessedTime integer, -- example: [636430963247108053, 636472436323838240]\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE MethodParameter (\n Id integer, -- example: [1, 2]\n Type text, -- example: ['System.String', 'System.Int32']\n Name text, -- example: ['repoID', 'repoId', 'give', 'data', 'i']\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Solution (\n Id integer, -- example: [1, 2]\n RepoId integer, -- Repository Id, example: [1, 3]\n Path text, -- example: ['wallerdev_htmlsharp\\\\HtmlSharp.sln', 'maravillas_linq-to-delicious\\\\tasty.sln']\n ProcessedTime integer, -- example: [636430963695642191, 636430963721734366]\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:\nrepository ID refers to RepoID; method refers to Name; Name = 'Kalibrasi.Data.EntityClasses.THistoryJadwalEntity.GetSingleTjadwal';\nGive the repository ID for the solution of method \"Kalibrasi.Data.EntityClasses.THistoryJadwalEntity.GetSingleTjadwal\".\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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.RepoId FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T2.Name = 'Kalibrasi.Data.EntityClasses.THistoryJadwalEntity.GetSingleTjadwal'",
"style": "rule"
} | {
"db_id": "codebase_comments.sqlite",
"gt_sql": "SELECT DISTINCT T1.RepoId FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T2.Name = 'Kalibrasi.Data.EntityClasses.THistoryJadwalEntity.GetSingleTjadwal'",
"index": 305,
"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 Method (\n Id integer, -- example: [1, 2]\n Name text, -- example: ['HtmlSharp.HtmlParser.Feed', 'HtmlSharp.HtmlParser.ParseDoctypeElement']\n CommentIsXml integer, -- example: [0, 1]\n SampledAt integer, -- example: [636430963695654788, 636430963695709898]\n SolutionId integer, -- example: [1, 2]\n Lang text, -- Language, example: ['en', 'fr']\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Repo (\n Id integer, -- example: [1, 2]\n Stars integer, -- example: [14, 6]\n Forks integer, -- example: [2, 3]\n Watchers integer, -- example: [14, 6]\n ProcessedTime integer, -- example: [636430963247108053, 636472436323838240]\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE MethodParameter (\n Id integer, -- example: [1, 2]\n Type text, -- example: ['System.String', 'System.Int32']\n Name text, -- example: ['repoID', 'repoId', 'give', 'data', 'i']\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Solution (\n Id integer, -- example: [1, 2]\n RepoId integer, -- Repository Id, example: [1, 3]\n Path text, -- example: ['wallerdev_htmlsharp\\\\HtmlSharp.sln', 'maravillas_linq-to-delicious\\\\tasty.sln']\n ProcessedTime integer, -- example: [636430963695642191, 636430963721734366]\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:\nrepository ID refers to RepoID; method refers to Name; Name = 'Kalibrasi.Data.EntityClasses.THistoryJadwalEntity.GetSingleTjadwal';\nGive the repository ID for the solution of method \"Kalibrasi.Data.EntityClasses.THistoryJadwalEntity.GetSingleTjadwal\".\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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 Repo (\n Id integer, -- example: [1, 2]\n Url text, -- example: ['https://github.com/wallerdev/htmlsharp.g', 'https://github.com/unclebob/nslim.git']\n ProcessedTime integer, -- example: [636430963247108053, 636472436323838240]\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Solution (\n Id integer, -- example: [1, 2]\n Path text, -- example: ['wallerdev_htmlsharp\\\\HtmlSharp.sln', 'maravillas_linq-to-delicious\\\\tasty.sln']\n ProcessedTime integer, -- example: [636430963695642191, 636430963721734366]\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE MethodParameter (\n Id integer, -- example: [1, 2]\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Method (\n Id integer, -- example: [1, 2]\n Name text, -- example: ['HtmlSharp.HtmlParser.Feed', 'HtmlSharp.HtmlParser.ParseDoctypeElement']\n FullComment text, -- example: ['Feeds data into the parser', ' interneral -- scan past <!ELEMENT decla']\n Summary text, -- example: ['Converts the query expression into text ', 'Execute the query expression ']\n ApiCalls text, -- example: ['System.String.IsNullOrEmpty HtmlSharp.Ht', 'HtmlSharp.HtmlParser.ScanName System.Col']\n CommentIsXml integer, -- example: [0, 1]\n SolutionId 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:\nsolution path refers to Path;\nFor the method has the summary of \"Refetches the Entity from the persistent storage. Refetch is used to re-load an Entity which is marked \"Out-of-sync\", due to a save action. Refetching an empty Entity has no effect.\", what is its solution path?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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.Path FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T2.Summary = 'Refetches the Entity FROM the persistent storage. Refetch is used to re-load an Entity which is marked \"Out-of-sync\", due to a save action. Refetching an empty Entity has no effect.'",
"style": "rule"
} | {
"db_id": "codebase_comments.sqlite",
"gt_sql": "SELECT DISTINCT T1.Path FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T2.Summary = 'Refetches the Entity FROM the persistent storage. Refetch is used to re-load an Entity which is marked \"Out-of-sync\", due to a save action. Refetching an empty Entity has no effect.'",
"index": 306,
"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 Repo (\n Id integer, -- example: [1, 2]\n Url text, -- example: ['https://github.com/wallerdev/htmlsharp.g', 'https://github.com/unclebob/nslim.git']\n ProcessedTime integer, -- example: [636430963247108053, 636472436323838240]\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Solution (\n Id integer, -- example: [1, 2]\n Path text, -- example: ['wallerdev_htmlsharp\\\\HtmlSharp.sln', 'maravillas_linq-to-delicious\\\\tasty.sln']\n ProcessedTime integer, -- example: [636430963695642191, 636430963721734366]\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE MethodParameter (\n Id integer, -- example: [1, 2]\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Method (\n Id integer, -- example: [1, 2]\n Name text, -- example: ['HtmlSharp.HtmlParser.Feed', 'HtmlSharp.HtmlParser.ParseDoctypeElement']\n FullComment text, -- example: ['Feeds data into the parser', ' interneral -- scan past <!ELEMENT decla']\n Summary text, -- example: ['Converts the query expression into text ', 'Execute the query expression ']\n ApiCalls text, -- example: ['System.String.IsNullOrEmpty HtmlSharp.Ht', 'HtmlSharp.HtmlParser.ScanName System.Col']\n CommentIsXml integer, -- example: [0, 1]\n SolutionId 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:\nsolution path refers to Path;\nFor the method has the summary of \"Refetches the Entity from the persistent storage. Refetch is used to re-load an Entity which is marked \"Out-of-sync\", due to a save action. Refetching an empty Entity has no effect.\", what is its solution path?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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 Method (\n Id integer, -- example: [1, 2]\n CommentIsXml integer, -- example: [0, 1]\n Lang text, -- Language, example: ['en', 'fr']\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE MethodParameter (\n Id integer, -- example: [1, 2]\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Solution (\n Id integer, -- example: [1, 2]\n RepoId integer, -- Repository Id, example: [1, 3]\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Repo (\n Id integer, -- example: [1, 2]\n Url text, -- example: ['https://github.com/wallerdev/htmlsharp.g', 'https://github.com/unclebob/nslim.git']\n Stars integer, -- example: [14, 6]\n Forks integer, -- example: [2, 3]\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:\nsolution No. refers to Solution.Id; percentage = DIVIDE(MULTIPLY(SUBTRACT(SUM(Solution.Id = 53546), SUM(Solution.Id = 1502)), 100)), SUM(Solution.Id = 1502);\nHow many percent more of the Forks for the repository of solution No.53546 than No.1502?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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.Id = 53546 THEN T1.Forks ELSE 0 END) - SUM(CASE WHEN T2.Id = 1502 THEN T1.Forks ELSE 0 END) AS REAL) * 100 / SUM(CASE WHEN T2.Id = 1502 THEN T1.Forks ELSE 0 END) FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId",
"style": "rule"
} | {
"db_id": "codebase_comments.sqlite",
"gt_sql": "SELECT CAST(SUM(CASE WHEN T2.Id = 53546 THEN T1.Forks ELSE 0 END) - SUM(CASE WHEN T2.Id = 1502 THEN T1.Forks ELSE 0 END) AS REAL) * 100 / SUM(CASE WHEN T2.Id = 1502 THEN T1.Forks ELSE 0 END) FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId",
"index": 307,
"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 Method (\n Id integer, -- example: [1, 2]\n CommentIsXml integer, -- example: [0, 1]\n Lang text, -- Language, example: ['en', 'fr']\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE MethodParameter (\n Id integer, -- example: [1, 2]\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Solution (\n Id integer, -- example: [1, 2]\n RepoId integer, -- Repository Id, example: [1, 3]\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Repo (\n Id integer, -- example: [1, 2]\n Url text, -- example: ['https://github.com/wallerdev/htmlsharp.g', 'https://github.com/unclebob/nslim.git']\n Stars integer, -- example: [14, 6]\n Forks integer, -- example: [2, 3]\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:\nsolution No. refers to Solution.Id; percentage = DIVIDE(MULTIPLY(SUBTRACT(SUM(Solution.Id = 53546), SUM(Solution.Id = 1502)), 100)), SUM(Solution.Id = 1502);\nHow many percent more of the Forks for the repository of solution No.53546 than No.1502?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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 Method (\n Id integer, -- example: [1, 2]\n Name text, -- example: ['HtmlSharp.HtmlParser.Feed', 'HtmlSharp.HtmlParser.ParseDoctypeElement']\n SolutionId integer, -- example: [1, 2]\n Lang text, -- Language, example: ['en', 'fr']\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Repo (\n Id integer, -- example: [1, 2]\n ProcessedTime integer, -- example: [636430963247108053, 636472436323838240]\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Solution (\n Id integer, -- example: [1, 2]\n ProcessedTime integer, -- example: [636430963695642191, 636430963721734366]\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE MethodParameter (\n Id integer, -- example: [1, 2]\n Name text, -- example: ['solutionID', 'solutionId', 'SolutionId', 'data', 'i']\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:\nmethods refers to Name; solution refers to SolutionId;\nList all the methods with a solution with a \"636449700980488000\" processed time.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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.Name FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T1.ProcessedTime = 636449700980488000",
"style": "rule"
} | {
"db_id": "codebase_comments.sqlite",
"gt_sql": "SELECT DISTINCT T2.Name FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T1.ProcessedTime = 636449700980488000",
"index": 308,
"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 Method (\n Id integer, -- example: [1, 2]\n Name text, -- example: ['HtmlSharp.HtmlParser.Feed', 'HtmlSharp.HtmlParser.ParseDoctypeElement']\n SolutionId integer, -- example: [1, 2]\n Lang text, -- Language, example: ['en', 'fr']\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Repo (\n Id integer, -- example: [1, 2]\n ProcessedTime integer, -- example: [636430963247108053, 636472436323838240]\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Solution (\n Id integer, -- example: [1, 2]\n ProcessedTime integer, -- example: [636430963695642191, 636430963721734366]\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE MethodParameter (\n Id integer, -- example: [1, 2]\n Name text, -- example: ['solutionID', 'solutionId', 'SolutionId', 'data', 'i']\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:\nmethods refers to Name; solution refers to SolutionId;\nList all the methods with a solution with a \"636449700980488000\" processed time.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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 Method (\n Id integer, -- example: [1, 2]\n FullComment text, -- example: ['Feeds data into the parser', ' interneral -- scan past <!ELEMENT decla']\n SampledAt integer, -- example: [636430963695654788, 636430963695709898]\n Lang text, -- Language, example: ['en', 'fr']\n NameTokenized text, -- example: ['html parser feed', 'html parser parse doctype element']\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE MethodParameter (\n Id integer, -- example: [1, 2]\n Type text, -- example: ['System.String', 'System.Int32']\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Solution (\n Id integer, -- example: [1, 2]\n RepoId integer, -- Repository Id, example: [1, 3]\n ProcessedTime integer, -- example: [636430963695642191, 636430963721734366]\n WasCompiled integer, -- example: [1, 0]\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Repo (\n Id integer, -- example: [1, 2]\n Url text, -- example: ['https://github.com/wallerdev/htmlsharp.g', 'https://github.com/unclebob/nslim.git']\n Watchers integer, -- example: [14, 6]\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:\nsolutions refers to Solution.Id; https://github.com/derickbailey/presentations-and-training.git refers to Url; Url; = 'https://github.com/derickbailey/presentations-and-training.git';\nHow many solutions are in \"https://github.com/derickbailey/presentations-and-training.git\"?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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.RepoId) FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T1.Url = 'https://github.com/derickbailey/presentations-and-training.git'",
"style": "rule"
} | {
"db_id": "codebase_comments.sqlite",
"gt_sql": "SELECT COUNT(T2.RepoId) FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T1.Url = 'https://github.com/derickbailey/presentations-and-training.git'",
"index": 309,
"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 Method (\n Id integer, -- example: [1, 2]\n FullComment text, -- example: ['Feeds data into the parser', ' interneral -- scan past <!ELEMENT decla']\n SampledAt integer, -- example: [636430963695654788, 636430963695709898]\n Lang text, -- Language, example: ['en', 'fr']\n NameTokenized text, -- example: ['html parser feed', 'html parser parse doctype element']\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE MethodParameter (\n Id integer, -- example: [1, 2]\n Type text, -- example: ['System.String', 'System.Int32']\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Solution (\n Id integer, -- example: [1, 2]\n RepoId integer, -- Repository Id, example: [1, 3]\n ProcessedTime integer, -- example: [636430963695642191, 636430963721734366]\n WasCompiled integer, -- example: [1, 0]\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Repo (\n Id integer, -- example: [1, 2]\n Url text, -- example: ['https://github.com/wallerdev/htmlsharp.g', 'https://github.com/unclebob/nslim.git']\n Watchers integer, -- example: [14, 6]\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:\nsolutions refers to Solution.Id; https://github.com/derickbailey/presentations-and-training.git refers to Url; Url; = 'https://github.com/derickbailey/presentations-and-training.git';\nHow many solutions are in \"https://github.com/derickbailey/presentations-and-training.git\"?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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 MethodParameter (\n Id integer, -- example: [1, 2]\n MethodId text, -- example: ['1', '2']\n Type text, -- example: ['System.String', 'System.Int32']\n Name text, -- example: ['ProcessedTime', 'forks', 'tOTAL', 'What', 'what', 'most']\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Method (\n Id integer, -- example: [1, 2]\n ApiCalls text, -- example: ['System.String.IsNullOrEmpty HtmlSharp.Ht', 'HtmlSharp.HtmlParser.ScanName System.Col']\n CommentIsXml integer, -- example: [0, 1]\n SampledAt integer, -- example: [636430963695654788, 636430963695709898]\n SolutionId integer, -- example: [1, 2]\n Lang text, -- Language, example: ['en', 'fr']\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Solution (\n Id integer, -- example: [1, 2]\n RepoId integer, -- Repository Id, example: [1, 3]\n Path text, -- example: ['wallerdev_htmlsharp\\\\HtmlSharp.sln', 'maravillas_linq-to-delicious\\\\tasty.sln']\n ProcessedTime integer, -- example: [636430963695642191, 636430963721734366]\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Repo (\n Id integer, -- example: [1, 2]\n Forks integer, -- example: [2, 3]\n Watchers integer, -- example: [14, 6]\n ProcessedTime integer, -- example: [636430963247108053, 636472436323838240]\n PRIMARY KEY (Id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\ntotal processed time = AVG(ProcessedTime where MAX(COUNT(Forks))); repository with the most forks refers to MAX(COUNT(Forks));\nWhat is the total processed time of all solutions from the repository with the most forks?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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.ProcessedTime) FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T1.Forks = ( SELECT MAX(Forks) FROM Repo )",
"style": "rule"
} | {
"db_id": "codebase_comments.sqlite",
"gt_sql": "SELECT SUM(T2.ProcessedTime) FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T1.Forks = ( SELECT MAX(Forks) FROM Repo )",
"index": 310,
"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 MethodParameter (\n Id integer, -- example: [1, 2]\n MethodId text, -- example: ['1', '2']\n Type text, -- example: ['System.String', 'System.Int32']\n Name text, -- example: ['ProcessedTime', 'forks', 'tOTAL', 'What', 'what', 'most']\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Method (\n Id integer, -- example: [1, 2]\n ApiCalls text, -- example: ['System.String.IsNullOrEmpty HtmlSharp.Ht', 'HtmlSharp.HtmlParser.ScanName System.Col']\n CommentIsXml integer, -- example: [0, 1]\n SampledAt integer, -- example: [636430963695654788, 636430963695709898]\n SolutionId integer, -- example: [1, 2]\n Lang text, -- Language, example: ['en', 'fr']\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Solution (\n Id integer, -- example: [1, 2]\n RepoId integer, -- Repository Id, example: [1, 3]\n Path text, -- example: ['wallerdev_htmlsharp\\\\HtmlSharp.sln', 'maravillas_linq-to-delicious\\\\tasty.sln']\n ProcessedTime integer, -- example: [636430963695642191, 636430963721734366]\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Repo (\n Id integer, -- example: [1, 2]\n Forks integer, -- example: [2, 3]\n Watchers integer, -- example: [14, 6]\n ProcessedTime integer, -- example: [636430963247108053, 636472436323838240]\n PRIMARY KEY (Id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\ntotal processed time = AVG(ProcessedTime where MAX(COUNT(Forks))); repository with the most forks refers to MAX(COUNT(Forks));\nWhat is the total processed time of all solutions from the repository with the most forks?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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 Solution (\n Id integer, -- example: [1, 2]\n Path text, -- example: ['wallerdev_htmlsharp\\\\HtmlSharp.sln', 'maravillas_linq-to-delicious\\\\tasty.sln']\n ProcessedTime integer, -- example: [636430963695642191, 636430963721734366]\n WasCompiled integer, -- example: [1, 0]\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Repo (\n Id integer, -- example: [1, 2]\n Stars integer, -- example: [14, 6]\n Watchers integer, -- example: [14, 6]\n ProcessedTime integer, -- example: [636430963247108053, 636472436323838240]\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Method (\n Id integer, -- example: [1, 2]\n Summary text, -- example: ['Converts the query expression into text ', 'Execute the query expression ']\n ApiCalls text, -- example: ['System.String.IsNullOrEmpty HtmlSharp.Ht', 'HtmlSharp.HtmlParser.ScanName System.Col']\n CommentIsXml integer, -- example: [0, 1]\n SolutionId integer, -- example: [1, 2]\n Lang text, -- Language, example: ['en', 'fr']\n NameTokenized text, -- example: ['html parser feed', 'html parser parse doctype element']\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE MethodParameter (\n Id integer, -- example: [1, 2]\n MethodId text, -- example: ['1', '2']\n Type text, -- example: ['System.String', 'System.Int32']\n Name text, -- example: ['data', 'i']\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:\npath of the solution refers to Path; solution refers to Solution.Id;\nList all the path of solution from all the \"it\" lang code method.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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.Path FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T2.Lang = 'it'",
"style": "rule"
} | {
"db_id": "codebase_comments.sqlite",
"gt_sql": "SELECT DISTINCT T1.Path FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T2.Lang = 'it'",
"index": 311,
"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 Solution (\n Id integer, -- example: [1, 2]\n Path text, -- example: ['wallerdev_htmlsharp\\\\HtmlSharp.sln', 'maravillas_linq-to-delicious\\\\tasty.sln']\n ProcessedTime integer, -- example: [636430963695642191, 636430963721734366]\n WasCompiled integer, -- example: [1, 0]\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Repo (\n Id integer, -- example: [1, 2]\n Stars integer, -- example: [14, 6]\n Watchers integer, -- example: [14, 6]\n ProcessedTime integer, -- example: [636430963247108053, 636472436323838240]\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Method (\n Id integer, -- example: [1, 2]\n Summary text, -- example: ['Converts the query expression into text ', 'Execute the query expression ']\n ApiCalls text, -- example: ['System.String.IsNullOrEmpty HtmlSharp.Ht', 'HtmlSharp.HtmlParser.ScanName System.Col']\n CommentIsXml integer, -- example: [0, 1]\n SolutionId integer, -- example: [1, 2]\n Lang text, -- Language, example: ['en', 'fr']\n NameTokenized text, -- example: ['html parser feed', 'html parser parse doctype element']\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE MethodParameter (\n Id integer, -- example: [1, 2]\n MethodId text, -- example: ['1', '2']\n Type text, -- example: ['System.String', 'System.Int32']\n Name text, -- example: ['data', 'i']\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:\npath of the solution refers to Path; solution refers to Solution.Id;\nList all the path of solution from all the \"it\" lang code method.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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 MethodParameter (\n Id integer, -- example: [1, 2]\n Name text, -- example: ['What', 'what', 'data', 'i']\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Method (\n Id integer, -- example: [1, 2]\n Name text, -- example: ['spinachLexer.mT__55', 'HtmlSharp.HtmlParser.Feed', 'HtmlSharp.HtmlParser.ParseDoctypeElement']\n SolutionId integer, -- example: [1, 2]\n Lang text, -- Language, example: ['en', 'fr']\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Repo (\n Id integer, -- example: [1, 2]\n Forks integer, -- example: [2, 3]\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Solution (\n Id integer, -- example: [1, 2]\n Path text, -- example: ['wallerdev_htmlsharp\\\\HtmlSharp.sln', 'maravillas_linq-to-delicious\\\\tasty.sln']\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:\npath of the solution refers to Path; solution refers to Solution.Id; method refers to Name; Name = 'spinachLexer.mT__55';\nWhat is the path of solution of \"spinachLexer.mT__55\" method?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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.Path FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T2.Name = 'spinachLexer.mT__55'",
"style": "rule"
} | {
"db_id": "codebase_comments.sqlite",
"gt_sql": "SELECT T1.Path FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T2.Name = 'spinachLexer.mT__55'",
"index": 312,
"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 MethodParameter (\n Id integer, -- example: [1, 2]\n Name text, -- example: ['What', 'what', 'data', 'i']\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Method (\n Id integer, -- example: [1, 2]\n Name text, -- example: ['spinachLexer.mT__55', 'HtmlSharp.HtmlParser.Feed', 'HtmlSharp.HtmlParser.ParseDoctypeElement']\n SolutionId integer, -- example: [1, 2]\n Lang text, -- Language, example: ['en', 'fr']\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Repo (\n Id integer, -- example: [1, 2]\n Forks integer, -- example: [2, 3]\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Solution (\n Id integer, -- example: [1, 2]\n Path text, -- example: ['wallerdev_htmlsharp\\\\HtmlSharp.sln', 'maravillas_linq-to-delicious\\\\tasty.sln']\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:\npath of the solution refers to Path; solution refers to Solution.Id; method refers to Name; Name = 'spinachLexer.mT__55';\nWhat is the path of solution of \"spinachLexer.mT__55\" method?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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 Solution (\n Id integer, -- example: [1, 2]\n RepoId integer, -- Repository Id, example: [1, 3]\n Path text, -- example: ['wallerdev_htmlsharp\\\\HtmlSharp.sln', 'maravillas_linq-to-delicious\\\\tasty.sln']\n ProcessedTime integer, -- example: [636430963695642191, 636430963721734366]\n WasCompiled integer, -- example: [1, 0]\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Method (\n Id integer, -- example: [1, 2]\n Name text, -- example: ['HtmlSharp.HtmlParser.Feed', 'HtmlSharp.HtmlParser.ParseDoctypeElement']\n Summary text, -- example: ['Converts the query expression into text ', 'Execute the query expression ']\n ApiCalls text, -- example: ['System.String.IsNullOrEmpty HtmlSharp.Ht', 'HtmlSharp.HtmlParser.ScanName System.Col']\n Lang text, -- Language, example: ['en', 'fr']\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE MethodParameter (\n Id integer, -- example: [1, 2]\n MethodId text, -- example: ['1', '2']\n Type text, -- example: ['System.String', 'System.Int32']\n Name text, -- example: ['What', 'what', 'data', 'i']\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Repo (\n Id integer, -- example: [1, 2]\n Url text, -- example: ['https://github.com/ecoffey/Bebop.git', 'https://github.com/wallerdev/htmlsharp.g', 'https://github.com/unclebob/nslim.git']\n Forks integer, -- example: [2, 3]\n ProcessedTime integer, -- example: [636430963247108053, 636472436323838240]\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:\npath of solutions refers to Path; https://github.com/ecoffey/Bebop.git refers to Url; Url = 'https://github.com/ecoffey/Bebop.git';\nWhat are the paths of solutions in repository \"https://github.com/ecoffey/Bebop.git\"\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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.Path FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T1.Url = 'https://github.com/ecoffey/Bebop.git'",
"style": "rule"
} | {
"db_id": "codebase_comments.sqlite",
"gt_sql": "SELECT DISTINCT T2.Path FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T1.Url = 'https://github.com/ecoffey/Bebop.git'",
"index": 313,
"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 Solution (\n Id integer, -- example: [1, 2]\n RepoId integer, -- Repository Id, example: [1, 3]\n Path text, -- example: ['wallerdev_htmlsharp\\\\HtmlSharp.sln', 'maravillas_linq-to-delicious\\\\tasty.sln']\n ProcessedTime integer, -- example: [636430963695642191, 636430963721734366]\n WasCompiled integer, -- example: [1, 0]\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Method (\n Id integer, -- example: [1, 2]\n Name text, -- example: ['HtmlSharp.HtmlParser.Feed', 'HtmlSharp.HtmlParser.ParseDoctypeElement']\n Summary text, -- example: ['Converts the query expression into text ', 'Execute the query expression ']\n ApiCalls text, -- example: ['System.String.IsNullOrEmpty HtmlSharp.Ht', 'HtmlSharp.HtmlParser.ScanName System.Col']\n Lang text, -- Language, example: ['en', 'fr']\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE MethodParameter (\n Id integer, -- example: [1, 2]\n MethodId text, -- example: ['1', '2']\n Type text, -- example: ['System.String', 'System.Int32']\n Name text, -- example: ['What', 'what', 'data', 'i']\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Repo (\n Id integer, -- example: [1, 2]\n Url text, -- example: ['https://github.com/ecoffey/Bebop.git', 'https://github.com/wallerdev/htmlsharp.g', 'https://github.com/unclebob/nslim.git']\n Forks integer, -- example: [2, 3]\n ProcessedTime integer, -- example: [636430963247108053, 636472436323838240]\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:\npath of solutions refers to Path; https://github.com/ecoffey/Bebop.git refers to Url; Url = 'https://github.com/ecoffey/Bebop.git';\nWhat are the paths of solutions in repository \"https://github.com/ecoffey/Bebop.git\"\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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 Solution (\n Id integer, -- example: [1, 2]\n RepoId integer, -- Repository Id, example: [1, 3]\n Path text, -- example: ['wallerdev_htmlsharp\\\\HtmlSharp.sln', 'maravillas_linq-to-delicious\\\\tasty.sln']\n ProcessedTime integer, -- example: [636430963695642191, 636430963721734366]\n WasCompiled integer, -- example: [1, 0]\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE MethodParameter (\n Id integer, -- example: [1, 2]\n MethodId text, -- example: ['1', '2']\n Type text, -- example: ['System.String', 'System.Int32']\n Name text, -- example: ['nameToken', 'repoID', 'repoId', 'What', 'what', 'nameTokens']\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Repo (\n Id integer, -- example: [1, 2]\n Stars integer, -- example: [14, 6]\n Forks integer, -- example: [2, 3]\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Method (\n Id integer, -- example: [1, 2]\n Name text, -- example: ['HtmlSharp.HtmlParser.Feed', 'HtmlSharp.HtmlParser.ParseDoctypeElement']\n CommentIsXml integer, -- example: [0, 1]\n SampledAt integer, -- example: [636430963695654788, 636430963695709898]\n SolutionId integer, -- example: [1, 2]\n Lang text, -- Language, example: ['en', 'fr']\n NameTokenized text, -- example: ['crc parameters get hash code', 'parameters get hash code', 'job parameters get hash code', 'html parser feed', 'html parser parse doctype element']\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:\nrepository id refers to RepoId; tokenized name refers to NameTokenized; NameTokenized = 'crc parameters get hash code';\nWhat is the repository id of the method with tokenized name \"crc parameters get hash code\"?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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.RepoId FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T2.NameTokenized = 'crc parameters get hash code'",
"style": "rule"
} | {
"db_id": "codebase_comments.sqlite",
"gt_sql": "SELECT T1.RepoId FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T2.NameTokenized = 'crc parameters get hash code'",
"index": 314,
"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 Solution (\n Id integer, -- example: [1, 2]\n RepoId integer, -- Repository Id, example: [1, 3]\n Path text, -- example: ['wallerdev_htmlsharp\\\\HtmlSharp.sln', 'maravillas_linq-to-delicious\\\\tasty.sln']\n ProcessedTime integer, -- example: [636430963695642191, 636430963721734366]\n WasCompiled integer, -- example: [1, 0]\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE MethodParameter (\n Id integer, -- example: [1, 2]\n MethodId text, -- example: ['1', '2']\n Type text, -- example: ['System.String', 'System.Int32']\n Name text, -- example: ['nameToken', 'repoID', 'repoId', 'What', 'what', 'nameTokens']\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Repo (\n Id integer, -- example: [1, 2]\n Stars integer, -- example: [14, 6]\n Forks integer, -- example: [2, 3]\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Method (\n Id integer, -- example: [1, 2]\n Name text, -- example: ['HtmlSharp.HtmlParser.Feed', 'HtmlSharp.HtmlParser.ParseDoctypeElement']\n CommentIsXml integer, -- example: [0, 1]\n SampledAt integer, -- example: [636430963695654788, 636430963695709898]\n SolutionId integer, -- example: [1, 2]\n Lang text, -- Language, example: ['en', 'fr']\n NameTokenized text, -- example: ['crc parameters get hash code', 'parameters get hash code', 'job parameters get hash code', 'html parser feed', 'html parser parse doctype element']\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:\nrepository id refers to RepoId; tokenized name refers to NameTokenized; NameTokenized = 'crc parameters get hash code';\nWhat is the repository id of the method with tokenized name \"crc parameters get hash code\"?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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 Method (\n Id integer, -- example: [1, 2]\n Summary text, -- example: ['Converts the query expression into text ', 'Execute the query expression ']\n SolutionId integer, -- example: [1, 2]\n Lang text, -- Language, example: ['en', 'fr']\n NameTokenized text, -- example: ['html parser feed', 'html parser parse doctype element']\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE MethodParameter (\n Id integer, -- example: [1, 2]\n Type text, -- example: ['System.String', 'System.Int32']\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Solution (\n Id integer, -- example: [1, 2]\n Path text, -- example: ['maravillas_linq-to-delicious\\\\tasty.sln', 'wallerdev_htmlsharp\\\\HtmlSharp.sln']\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Repo (\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:\nsolution refers to SolutionId;\nHow many methods with solutions with path 'maravillas_linq-to-delicious\\tasty.sln'?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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.SolutionId) FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T1.Path = 'maravillas_linq-to-delicious\\tasty.sln'",
"style": "rule"
} | {
"db_id": "codebase_comments.sqlite",
"gt_sql": "SELECT COUNT(T2.SolutionId) FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T1.Path = 'maravillas_linq-to-delicious\\tasty.sln'",
"index": 315,
"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 Method (\n Id integer, -- example: [1, 2]\n Summary text, -- example: ['Converts the query expression into text ', 'Execute the query expression ']\n SolutionId integer, -- example: [1, 2]\n Lang text, -- Language, example: ['en', 'fr']\n NameTokenized text, -- example: ['html parser feed', 'html parser parse doctype element']\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE MethodParameter (\n Id integer, -- example: [1, 2]\n Type text, -- example: ['System.String', 'System.Int32']\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Solution (\n Id integer, -- example: [1, 2]\n Path text, -- example: ['maravillas_linq-to-delicious\\\\tasty.sln', 'wallerdev_htmlsharp\\\\HtmlSharp.sln']\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Repo (\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:\nsolution refers to SolutionId;\nHow many methods with solutions with path 'maravillas_linq-to-delicious\\tasty.sln'?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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 MethodParameter (\n Id integer, -- example: [1, 2]\n MethodId text, -- example: ['1', '2']\n Type text, -- example: ['System.String', 'System.Int32']\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Method (\n Id integer, -- example: [1, 2]\n Name text, -- example: ['HtmlSharp.HtmlParser.Feed', 'HtmlSharp.HtmlParser.ParseDoctypeElement']\n Summary text, -- example: ['Converts the query expression into text ', 'Execute the query expression ']\n ApiCalls text, -- example: ['System.String.IsNullOrEmpty HtmlSharp.Ht', 'HtmlSharp.HtmlParser.ScanName System.Col']\n SampledAt integer, -- example: [636430963695654788, 636430963695709898]\n SolutionId integer, -- example: [1, 2]\n NameTokenized text, -- example: ['html parser feed', 'html parser parse doctype element']\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Repo (\n Id integer, -- example: [1, 2]\n Stars integer, -- example: [14, 6]\n Forks integer, -- example: [2, 3]\n Watchers integer, -- example: [14, 6]\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Solution (\n Id integer, -- example: [1, 2]\n ProcessedTime integer, -- example: [636430963695642191, 636430963721734366]\n WasCompiled integer, -- example: [1, 0]\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:\nrepository that the most people like refers to MAX(Stars);\nPlease provide the id of the respository that the most people like.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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 Id FROM Repo WHERE Stars = ( SELECT MAX(Stars) FROM Repo )",
"style": "rule"
} | {
"db_id": "codebase_comments.sqlite",
"gt_sql": "SELECT Id FROM Repo WHERE Stars = ( SELECT MAX(Stars) FROM Repo )",
"index": 316,
"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 MethodParameter (\n Id integer, -- example: [1, 2]\n MethodId text, -- example: ['1', '2']\n Type text, -- example: ['System.String', 'System.Int32']\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Method (\n Id integer, -- example: [1, 2]\n Name text, -- example: ['HtmlSharp.HtmlParser.Feed', 'HtmlSharp.HtmlParser.ParseDoctypeElement']\n Summary text, -- example: ['Converts the query expression into text ', 'Execute the query expression ']\n ApiCalls text, -- example: ['System.String.IsNullOrEmpty HtmlSharp.Ht', 'HtmlSharp.HtmlParser.ScanName System.Col']\n SampledAt integer, -- example: [636430963695654788, 636430963695709898]\n SolutionId integer, -- example: [1, 2]\n NameTokenized text, -- example: ['html parser feed', 'html parser parse doctype element']\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Repo (\n Id integer, -- example: [1, 2]\n Stars integer, -- example: [14, 6]\n Forks integer, -- example: [2, 3]\n Watchers integer, -- example: [14, 6]\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Solution (\n Id integer, -- example: [1, 2]\n ProcessedTime integer, -- example: [636430963695642191, 636430963721734366]\n WasCompiled integer, -- example: [1, 0]\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:\nrepository that the most people like refers to MAX(Stars);\nPlease provide the id of the respository that the most people like.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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 MethodParameter (\n Id integer, -- example: [1, 2]\n MethodId text, -- example: ['1', '2']\n Type text, -- example: ['System.String', 'System.Int32']\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Solution (\n Id integer, -- example: [1, 2]\n RepoId integer, -- Repository Id, example: [1, 3]\n WasCompiled integer, -- example: [1, 0]\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Method (\n Id integer, -- example: [1, 2]\n Name text, -- example: ['HtmlSharp.HtmlParser.Feed', 'HtmlSharp.HtmlParser.ParseDoctypeElement']\n FullComment text, -- example: ['Feeds data into the parser', ' interneral -- scan past <!ELEMENT decla']\n Summary text, -- example: ['Converts the query expression into text ', 'Execute the query expression ']\n SampledAt integer, -- example: [636430963695654788, 636430963695709898]\n SolutionId integer, -- example: [1, 2]\n Lang text, -- Language, example: ['en', 'fr']\n NameTokenized text, -- example: ['html parser feed', 'html parser parse doctype element']\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Repo (\n Id integer, -- example: [1, 2]\n Url text, -- example: ['https://github.com/wallerdev/htmlsharp.g', 'https://github.com/unclebob/nslim.git']\n Forks integer, -- example: [2, 3]\n Watchers integer, -- example: [14, 6]\n ProcessedTime integer, -- example: [636430963247108053, 636472436323838240]\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:\nsolution refers to Solution.Id; Solution.Id = 35;\nPlease provide the number of forks that the repository of the solution 35 have.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"role": "user"
}
] | nl2sql | {
"ground_truth": "SELECT T1.Forks FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T2.Id = 35",
"style": "rule"
} | {
"db_id": "codebase_comments.sqlite",
"gt_sql": "SELECT T1.Forks FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T2.Id = 35",
"index": 317,
"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 MethodParameter (\n Id integer, -- example: [1, 2]\n MethodId text, -- example: ['1', '2']\n Type text, -- example: ['System.String', 'System.Int32']\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Solution (\n Id integer, -- example: [1, 2]\n RepoId integer, -- Repository Id, example: [1, 3]\n WasCompiled integer, -- example: [1, 0]\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Method (\n Id integer, -- example: [1, 2]\n Name text, -- example: ['HtmlSharp.HtmlParser.Feed', 'HtmlSharp.HtmlParser.ParseDoctypeElement']\n FullComment text, -- example: ['Feeds data into the parser', ' interneral -- scan past <!ELEMENT decla']\n Summary text, -- example: ['Converts the query expression into text ', 'Execute the query expression ']\n SampledAt integer, -- example: [636430963695654788, 636430963695709898]\n SolutionId integer, -- example: [1, 2]\n Lang text, -- Language, example: ['en', 'fr']\n NameTokenized text, -- example: ['html parser feed', 'html parser parse doctype element']\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Repo (\n Id integer, -- example: [1, 2]\n Url text, -- example: ['https://github.com/wallerdev/htmlsharp.g', 'https://github.com/unclebob/nslim.git']\n Forks integer, -- example: [2, 3]\n Watchers integer, -- example: [14, 6]\n ProcessedTime integer, -- example: [636430963247108053, 636472436323838240]\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:\nsolution refers to Solution.Id; Solution.Id = 35;\nPlease provide the number of forks that the repository of the solution 35 have.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"split": "train"
} |
nl2sql | [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE Repo (\n Id integer, -- example: [1, 2]\n Watchers integer, -- example: [14, 6]\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Method (\n Id integer, -- example: [1, 2]\n SampledAt integer, -- example: [636430963695654788, 636430963695709898]\n Lang text, -- Language, example: ['en', 'fr']\n NameTokenized text, -- example: ['html parser feed', 'html parser parse doctype element']\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Solution (\n Id integer, -- example: [1, 2]\n RepoId integer, -- Repository Id, example: [1, 3]\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE MethodParameter (\n Id integer, -- example: [1, 2]\n MethodId text, -- 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:\nid of the solution refers to Solution.Id; repository has the most watchers refers to MAX(Watchers);\nPlease provide the id of the solution whose repository has the most watchers.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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 Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T1.Watchers = ( SELECT MAX(Watchers) FROM Repo )",
"style": "rule"
} | {
"db_id": "codebase_comments.sqlite",
"gt_sql": "SELECT T2.Id FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T1.Watchers = ( SELECT MAX(Watchers) FROM Repo )",
"index": 318,
"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 Repo (\n Id integer, -- example: [1, 2]\n Watchers integer, -- example: [14, 6]\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Method (\n Id integer, -- example: [1, 2]\n SampledAt integer, -- example: [636430963695654788, 636430963695709898]\n Lang text, -- Language, example: ['en', 'fr']\n NameTokenized text, -- example: ['html parser feed', 'html parser parse doctype element']\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Solution (\n Id integer, -- example: [1, 2]\n RepoId integer, -- Repository Id, example: [1, 3]\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE MethodParameter (\n Id integer, -- example: [1, 2]\n MethodId text, -- 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:\nid of the solution refers to Solution.Id; repository has the most watchers refers to MAX(Watchers);\nPlease provide the id of the solution whose repository has the most watchers.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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 MethodParameter (\n Id integer, -- example: [1, 2]\n Name text, -- example: ['needs', 'Tell', 'have', 'Need', 'need', 'how']\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Method (\n Id integer, -- example: [1, 2]\n Name text, -- example: ['HtmlSharp.HtmlParser.Feed', 'HtmlSharp.HtmlParser.ParseDoctypeElement']\n CommentIsXml integer, -- example: [0, 1]\n SampledAt integer, -- example: [636430963695654788, 636430963695709898]\n SolutionId integer, -- example: [1, 2]\n Lang text, -- Language, example: ['en', 'fr']\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Repo (\n Id integer, -- example: [1, 2]\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Solution (\n Id integer, -- example: [1, 2]\n ProcessedTime integer, -- example: [636430963695642191, 636430963721734366]\n WasCompiled integer, -- example: [1, 0]\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:\nmethod refers to Name; solution refers to Solution.Id; Solution.Id = 1; solution needs to be compiled refers to WasCompiled = 0;\nHow many methods does solution 1 have? And please tell me if solution 1 needs to be compiled.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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.SolutionId) , CASE WHEN T1.WasCompiled = 0 THEN 'Needs' ELSE 'NoNeeds' END needToCompile FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T2.SolutionId = 1",
"style": "rule"
} | {
"db_id": "codebase_comments.sqlite",
"gt_sql": "SELECT COUNT(T2.SolutionId) , CASE WHEN T1.WasCompiled = 0 THEN 'Needs' ELSE 'NoNeeds' END needToCompile FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T2.SolutionId = 1",
"index": 319,
"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 MethodParameter (\n Id integer, -- example: [1, 2]\n Name text, -- example: ['needs', 'Tell', 'have', 'Need', 'need', 'how']\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Method (\n Id integer, -- example: [1, 2]\n Name text, -- example: ['HtmlSharp.HtmlParser.Feed', 'HtmlSharp.HtmlParser.ParseDoctypeElement']\n CommentIsXml integer, -- example: [0, 1]\n SampledAt integer, -- example: [636430963695654788, 636430963695709898]\n SolutionId integer, -- example: [1, 2]\n Lang text, -- Language, example: ['en', 'fr']\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Repo (\n Id integer, -- example: [1, 2]\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Solution (\n Id integer, -- example: [1, 2]\n ProcessedTime integer, -- example: [636430963695642191, 636430963721734366]\n WasCompiled integer, -- example: [1, 0]\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:\nmethod refers to Name; solution refers to Solution.Id; Solution.Id = 1; solution needs to be compiled refers to WasCompiled = 0;\nHow many methods does solution 1 have? And please tell me if solution 1 needs to be compiled.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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 Solution (\n Id integer, -- example: [1, 2]\n RepoId integer, -- Repository Id, example: [1, 3]\n Path text, -- example: ['wallerdev_htmlsharp\\\\HtmlSharp.sln', 'maravillas_linq-to-delicious\\\\tasty.sln']\n ProcessedTime integer, -- example: [636430963695642191, 636430963721734366]\n WasCompiled integer, -- example: [1, 0]\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Repo (\n Id integer, -- example: [1, 2]\n Url text, -- example: ['https://github.com/wallerdev/htmlsharp.g', 'https://github.com/unclebob/nslim.git']\n Stars integer, -- example: [14, 6]\n Forks integer, -- example: [2, 3]\n ProcessedTime integer, -- example: [636430963247108053, 636472436323838240]\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Method (\n Id integer, -- example: [1, 2]\n Summary text, -- example: ['percentage', 'Converts the query expression into text ', 'Execute the query expression ']\n ApiCalls text, -- example: ['System.String.IsNullOrEmpty HtmlSharp.Ht', 'HtmlSharp.HtmlParser.ScanName System.Col']\n SampledAt integer, -- example: [636430963695654788, 636430963695709898]\n Lang text, -- Language, example: ['en', 'fr']\n NameTokenized text, -- example: ['percentage of', 'html parser feed', 'html parser parse doctype element']\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE MethodParameter (\n Id integer, -- example: [1, 2]\n MethodId text, -- example: ['1', '2']\n Type text, -- example: ['System.String', 'System.Int32']\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:\nstars>2000; percentage = DIVIDE(MULTIPLY(COUNT(Stars>2000), 100), COUNT(Id));\nWhat is the percentage of respositories that receive more than 2,000 stars?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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 Stars > 2000 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(Stars) FROM Repo",
"style": "rule"
} | {
"db_id": "codebase_comments.sqlite",
"gt_sql": "SELECT CAST(SUM(CASE WHEN Stars > 2000 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(Stars) FROM Repo",
"index": 320,
"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 Solution (\n Id integer, -- example: [1, 2]\n RepoId integer, -- Repository Id, example: [1, 3]\n Path text, -- example: ['wallerdev_htmlsharp\\\\HtmlSharp.sln', 'maravillas_linq-to-delicious\\\\tasty.sln']\n ProcessedTime integer, -- example: [636430963695642191, 636430963721734366]\n WasCompiled integer, -- example: [1, 0]\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Repo (\n Id integer, -- example: [1, 2]\n Url text, -- example: ['https://github.com/wallerdev/htmlsharp.g', 'https://github.com/unclebob/nslim.git']\n Stars integer, -- example: [14, 6]\n Forks integer, -- example: [2, 3]\n ProcessedTime integer, -- example: [636430963247108053, 636472436323838240]\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Method (\n Id integer, -- example: [1, 2]\n Summary text, -- example: ['percentage', 'Converts the query expression into text ', 'Execute the query expression ']\n ApiCalls text, -- example: ['System.String.IsNullOrEmpty HtmlSharp.Ht', 'HtmlSharp.HtmlParser.ScanName System.Col']\n SampledAt integer, -- example: [636430963695654788, 636430963695709898]\n Lang text, -- Language, example: ['en', 'fr']\n NameTokenized text, -- example: ['percentage of', 'html parser feed', 'html parser parse doctype element']\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE MethodParameter (\n Id integer, -- example: [1, 2]\n MethodId text, -- example: ['1', '2']\n Type text, -- example: ['System.String', 'System.Int32']\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:\nstars>2000; percentage = DIVIDE(MULTIPLY(COUNT(Stars>2000), 100), COUNT(Id));\nWhat is the percentage of respositories that receive more than 2,000 stars?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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 Method (\n Id integer, -- example: [1, 2]\n Name text, -- example: ['HtmlSharp.HtmlParser.Feed', 'HtmlSharp.HtmlParser.ParseDoctypeElement']\n FullComment text, -- example: ['Feeds data into the parser', ' interneral -- scan past <!ELEMENT decla']\n Summary text, -- example: ['Converts the query expression into text ', 'Execute the query expression ']\n Lang text, -- Language, example: ['en', 'fr']\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Solution (\n Id integer, -- example: [1, 2]\n RepoId integer, -- Repository Id, example: [1, 3]\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Repo (\n Id integer, -- example: [1, 2]\n Url text, -- example: ['https://github.com/wallerdev/htmlsharp.g', 'https://github.com/unclebob/nslim.git']\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE MethodParameter (\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:\nsolution refers to Solution.Id; Solution.Id = 1;\nWhat is the url of solution 1?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"role": "user"
}
] | nl2sql | {
"ground_truth": "SELECT T1.Url FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T2.Id = 1",
"style": "rule"
} | {
"db_id": "codebase_comments.sqlite",
"gt_sql": "SELECT T1.Url FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T2.Id = 1",
"index": 321,
"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 Method (\n Id integer, -- example: [1, 2]\n Name text, -- example: ['HtmlSharp.HtmlParser.Feed', 'HtmlSharp.HtmlParser.ParseDoctypeElement']\n FullComment text, -- example: ['Feeds data into the parser', ' interneral -- scan past <!ELEMENT decla']\n Summary text, -- example: ['Converts the query expression into text ', 'Execute the query expression ']\n Lang text, -- Language, example: ['en', 'fr']\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Solution (\n Id integer, -- example: [1, 2]\n RepoId integer, -- Repository Id, example: [1, 3]\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Repo (\n Id integer, -- example: [1, 2]\n Url text, -- example: ['https://github.com/wallerdev/htmlsharp.g', 'https://github.com/unclebob/nslim.git']\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE MethodParameter (\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:\nsolution refers to Solution.Id; Solution.Id = 1;\nWhat is the url of solution 1?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"split": "train"
} |
nl2sql | [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE MethodParameter (\n Id integer, -- example: [1, 2]\n MethodId text, -- example: ['1', '2']\n Type text, -- example: ['System.String', 'System.Int32']\n Name text, -- example: ['data', 'i']\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Repo (\n Id integer, -- example: [1, 2]\n Url text, -- example: ['https://github.com/wallerdev/htmlsharp.g', 'https://github.com/unclebob/nslim.git']\n Stars integer, -- example: [14, 6]\n Watchers integer, -- example: [14, 6]\n ProcessedTime integer, -- example: [636430963247108053, 636472436323838240]\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Solution (\n Id integer, -- example: [1, 2]\n RepoId integer, -- Repository Id, example: [1, 3]\n Path text, -- example: ['wallerdev_htmlsharp\\\\HtmlSharp.sln', 'maravillas_linq-to-delicious\\\\tasty.sln']\n WasCompiled integer, -- example: [1, 0]\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Method (\n Id integer, -- example: [1, 2]\n Name text, -- example: ['HtmlSharp.HtmlParser.Feed', 'HtmlSharp.HtmlParser.ParseDoctypeElement']\n FullComment text, -- example: ['Feeds data into the parser', ' interneral -- scan past <!ELEMENT decla']\n ApiCalls text, -- example: ['System.String.IsNullOrEmpty HtmlSharp.Ht', 'HtmlSharp.HtmlParser.ScanName System.Col']\n SolutionId integer, -- example: [1, 2]\n Lang text, -- Language, example: ['en', 'fr']\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:\npath of solution refers to Path; method refers to name; full comment = 'Feeds data into the parser';\nPlease provide the path of solution of method whose full comment is Feeds data into the parser.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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.Path FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T2.FullComment = 'Feeds data into the parser'",
"style": "rule"
} | {
"db_id": "codebase_comments.sqlite",
"gt_sql": "SELECT T1.Path FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T2.FullComment = 'Feeds data into the parser'",
"index": 322,
"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 MethodParameter (\n Id integer, -- example: [1, 2]\n MethodId text, -- example: ['1', '2']\n Type text, -- example: ['System.String', 'System.Int32']\n Name text, -- example: ['data', 'i']\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Repo (\n Id integer, -- example: [1, 2]\n Url text, -- example: ['https://github.com/wallerdev/htmlsharp.g', 'https://github.com/unclebob/nslim.git']\n Stars integer, -- example: [14, 6]\n Watchers integer, -- example: [14, 6]\n ProcessedTime integer, -- example: [636430963247108053, 636472436323838240]\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Solution (\n Id integer, -- example: [1, 2]\n RepoId integer, -- Repository Id, example: [1, 3]\n Path text, -- example: ['wallerdev_htmlsharp\\\\HtmlSharp.sln', 'maravillas_linq-to-delicious\\\\tasty.sln']\n WasCompiled integer, -- example: [1, 0]\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Method (\n Id integer, -- example: [1, 2]\n Name text, -- example: ['HtmlSharp.HtmlParser.Feed', 'HtmlSharp.HtmlParser.ParseDoctypeElement']\n FullComment text, -- example: ['Feeds data into the parser', ' interneral -- scan past <!ELEMENT decla']\n ApiCalls text, -- example: ['System.String.IsNullOrEmpty HtmlSharp.Ht', 'HtmlSharp.HtmlParser.ScanName System.Col']\n SolutionId integer, -- example: [1, 2]\n Lang text, -- Language, example: ['en', 'fr']\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:\npath of solution refers to Path; method refers to name; full comment = 'Feeds data into the parser';\nPlease provide the path of solution of method whose full comment is Feeds data into the parser.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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 Method (\n Id integer, -- example: [1, 2]\n FullComment text, -- example: ['Percentage', ' ENGLISH:', 'Feeds data into the parser', ' interneral -- scan past <!ELEMENT decla']\n Summary text, -- example: ['percentage', 'Converts the query expression into text ', 'Execute the query expression ']\n SampledAt integer, -- example: [636430963695654788, 636430963695709898]\n SolutionId integer, -- example: [1, 2]\n Lang text, -- Language, example: ['en', 'fr']\n NameTokenized text, -- example: ['percentage of', 'html parser feed', 'html parser parse doctype element']\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Solution (\n Id integer, -- example: [1, 2]\n Path text, -- example: ['wallerdev_htmlsharp\\\\HtmlSharp.sln', 'maravillas_linq-to-delicious\\\\tasty.sln']\n ProcessedTime integer, -- example: [636430963695642191, 636430963721734366]\n WasCompiled integer, -- example: [1, 0]\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Repo (\n Id integer, -- example: [1, 2]\n Url text, -- example: ['https://github.com/wallerdev/htmlsharp.g', 'https://github.com/unclebob/nslim.git']\n Forks integer, -- example: [2, 3]\n Watchers integer, -- example: [14, 6]\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE MethodParameter (\n Id integer, -- example: [1, 2]\n Name text, -- example: ['Percentage', 'percentage', 'English', 'english', 'needs', 'What']\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:\nmethod that needs to be compiled refers to WasCompiled = 0; English method refers to Lang = 'en'; percentage of solutions = MULTIPLY(DIVIDE(SUM(WasCompiled = 0), COUNT(Solution.Id)), 100);\nWhat is the percentage of solutions for the method that needs to be compiled in the English methods?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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.WasCompiled = 0 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(Lang) FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T2.Lang = 'en'",
"style": "rule"
} | {
"db_id": "codebase_comments.sqlite",
"gt_sql": "SELECT CAST(SUM(CASE WHEN T1.WasCompiled = 0 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(Lang) FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T2.Lang = 'en'",
"index": 323,
"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 Method (\n Id integer, -- example: [1, 2]\n FullComment text, -- example: ['Percentage', ' ENGLISH:', 'Feeds data into the parser', ' interneral -- scan past <!ELEMENT decla']\n Summary text, -- example: ['percentage', 'Converts the query expression into text ', 'Execute the query expression ']\n SampledAt integer, -- example: [636430963695654788, 636430963695709898]\n SolutionId integer, -- example: [1, 2]\n Lang text, -- Language, example: ['en', 'fr']\n NameTokenized text, -- example: ['percentage of', 'html parser feed', 'html parser parse doctype element']\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Solution (\n Id integer, -- example: [1, 2]\n Path text, -- example: ['wallerdev_htmlsharp\\\\HtmlSharp.sln', 'maravillas_linq-to-delicious\\\\tasty.sln']\n ProcessedTime integer, -- example: [636430963695642191, 636430963721734366]\n WasCompiled integer, -- example: [1, 0]\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Repo (\n Id integer, -- example: [1, 2]\n Url text, -- example: ['https://github.com/wallerdev/htmlsharp.g', 'https://github.com/unclebob/nslim.git']\n Forks integer, -- example: [2, 3]\n Watchers integer, -- example: [14, 6]\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE MethodParameter (\n Id integer, -- example: [1, 2]\n Name text, -- example: ['Percentage', 'percentage', 'English', 'english', 'needs', 'What']\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:\nmethod that needs to be compiled refers to WasCompiled = 0; English method refers to Lang = 'en'; percentage of solutions = MULTIPLY(DIVIDE(SUM(WasCompiled = 0), COUNT(Solution.Id)), 100);\nWhat is the percentage of solutions for the method that needs to be compiled in the English methods?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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 Method (\n Id integer, -- example: [1, 2]\n Name text, -- example: ['HtmlSharp.HtmlParser.Feed', 'HtmlSharp.HtmlParser.ParseDoctypeElement']\n FullComment text, -- example: [' Task 2', 'Feeds data into the parser', ' interneral -- scan past <!ELEMENT decla']\n Summary text, -- example: ['After', 'Converts the query expression into text ', 'Execute the query expression ']\n ApiCalls text, -- example: ['System.String.IsNullOrEmpty HtmlSharp.Ht', 'HtmlSharp.HtmlParser.ScanName System.Col']\n CommentIsXml integer, -- example: [0, 1]\n SampledAt integer, -- example: [636430963695654788, 636430963695709898]\n SolutionId integer, -- example: [1, 2]\n Lang text, -- Language, example: ['en', 'fr']\n NameTokenized text, -- example: ['html parser feed', 'html parser parse doctype element']\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE MethodParameter (\n Id integer, -- example: [1, 2]\n MethodId text, -- example: ['1', '2']\n Type text, -- example: ['System.String', 'System.Int32']\n Name text, -- example: ['What', 'what', 'data', 'i']\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Repo (\n Id integer, -- example: [1, 2]\n Url text, -- example: ['https://github.com/wallerdev/htmlsharp.g', 'https://github.com/unclebob/nslim.git']\n Stars integer, -- example: [14, 6]\n Forks integer, -- example: [2, 3]\n Watchers integer, -- example: [14, 6]\n ProcessedTime integer, -- example: [636430963247108053, 636472436323838240]\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Solution (\n Id integer, -- example: [1, 2]\n RepoId integer, -- Repository Id, example: [1, 3]\n Path text, -- example: ['wallerdev_htmlsharp\\\\HtmlSharp.sln', 'maravillas_linq-to-delicious\\\\tasty.sln']\n ProcessedTime integer, -- example: [636430963695642191, 636430963721734366]\n WasCompiled integer, -- example: [1, 0]\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:\ntask of the method refers to the second part of the Name after the \".\"; method number refers to Method_100k.Id; Method_100k.Id = 2;\nWhat is the task of method number 2?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"role": "user"
}
] | nl2sql | {
"ground_truth": "SELECT SUBSTR(SUBSTR(Name, INSTR(Name, '.') + 1), 1, INSTR(SUBSTR(Name, INSTR(Name, '.') + 1), '.') - 1) task FROM Method WHERE Id = 2",
"style": "rule"
} | {
"db_id": "codebase_comments.sqlite",
"gt_sql": "SELECT SUBSTR(SUBSTR(Name, INSTR(Name, '.') + 1), 1, INSTR(SUBSTR(Name, INSTR(Name, '.') + 1), '.') - 1) task FROM Method WHERE Id = 2",
"index": 324,
"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 Method (\n Id integer, -- example: [1, 2]\n Name text, -- example: ['HtmlSharp.HtmlParser.Feed', 'HtmlSharp.HtmlParser.ParseDoctypeElement']\n FullComment text, -- example: [' Task 2', 'Feeds data into the parser', ' interneral -- scan past <!ELEMENT decla']\n Summary text, -- example: ['After', 'Converts the query expression into text ', 'Execute the query expression ']\n ApiCalls text, -- example: ['System.String.IsNullOrEmpty HtmlSharp.Ht', 'HtmlSharp.HtmlParser.ScanName System.Col']\n CommentIsXml integer, -- example: [0, 1]\n SampledAt integer, -- example: [636430963695654788, 636430963695709898]\n SolutionId integer, -- example: [1, 2]\n Lang text, -- Language, example: ['en', 'fr']\n NameTokenized text, -- example: ['html parser feed', 'html parser parse doctype element']\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE MethodParameter (\n Id integer, -- example: [1, 2]\n MethodId text, -- example: ['1', '2']\n Type text, -- example: ['System.String', 'System.Int32']\n Name text, -- example: ['What', 'what', 'data', 'i']\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Repo (\n Id integer, -- example: [1, 2]\n Url text, -- example: ['https://github.com/wallerdev/htmlsharp.g', 'https://github.com/unclebob/nslim.git']\n Stars integer, -- example: [14, 6]\n Forks integer, -- example: [2, 3]\n Watchers integer, -- example: [14, 6]\n ProcessedTime integer, -- example: [636430963247108053, 636472436323838240]\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Solution (\n Id integer, -- example: [1, 2]\n RepoId integer, -- Repository Id, example: [1, 3]\n Path text, -- example: ['wallerdev_htmlsharp\\\\HtmlSharp.sln', 'maravillas_linq-to-delicious\\\\tasty.sln']\n ProcessedTime integer, -- example: [636430963695642191, 636430963721734366]\n WasCompiled integer, -- example: [1, 0]\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:\ntask of the method refers to the second part of the Name after the \".\"; method number refers to Method_100k.Id; Method_100k.Id = 2;\nWhat is the task of method number 2?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"split": "train"
} |
nl2sql | [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE Repo (\n Id integer, -- example: [1, 2]\n Url text, -- example: ['https://github.com/wallerdev/htmlsharp.g', 'https://github.com/unclebob/nslim.git']\n Forks integer, -- example: [2, 3]\n Watchers integer, -- example: [14, 6]\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE MethodParameter (\n Id integer, -- example: [1, 2]\n Type text, -- example: ['System.String', 'System.Int32']\n Name text, -- example: ['have', 'What', 'what', 'data', 'i']\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Solution (\n Id integer, -- example: [1, 2]\n Path text, -- example: ['wallerdev_htmlsharp\\\\HtmlSharp.sln', 'maravillas_linq-to-delicious\\\\tasty.sln']\n ProcessedTime integer, -- example: [636430963695642191, 636430963721734366]\n WasCompiled integer, -- example: [1, 0]\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Method (\n Id integer, -- example: [1, 2]\n Name text, -- example: ['HtmlSharp.HtmlParser.Feed', 'HtmlSharp.HtmlParser.ParseDoctypeElement']\n FullComment text, -- example: ['Feeds data into the parser', ' interneral -- scan past <!ELEMENT decla']\n Summary text, -- example: ['Converts the query expression into text ', 'Execute the query expression ']\n CommentIsXml integer, -- example: [0, 1]\n SampledAt integer, -- example: [636430963695654788, 636430963695709898]\n SolutionId integer, -- example: [1, 2]\n Lang text, -- Language, example: ['en', 'fr']\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:\nformat refers CommentIsXml; method number refers to Method_100k.Id; Method_100k.Id = 8;\nWhat format does the method number 8's comment have?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"role": "user"
}
] | nl2sql | {
"ground_truth": "SELECT CASE WHEN CommentIsXml = 0 THEN 'isNotXMLFormat' WHEN CommentIsXml = 1 THEN 'isXMLFormat' END format FROM Method WHERE Id = 8",
"style": "rule"
} | {
"db_id": "codebase_comments.sqlite",
"gt_sql": "SELECT CASE WHEN CommentIsXml = 0 THEN 'isNotXMLFormat' WHEN CommentIsXml = 1 THEN 'isXMLFormat' END format FROM Method WHERE Id = 8",
"index": 325,
"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 Repo (\n Id integer, -- example: [1, 2]\n Url text, -- example: ['https://github.com/wallerdev/htmlsharp.g', 'https://github.com/unclebob/nslim.git']\n Forks integer, -- example: [2, 3]\n Watchers integer, -- example: [14, 6]\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE MethodParameter (\n Id integer, -- example: [1, 2]\n Type text, -- example: ['System.String', 'System.Int32']\n Name text, -- example: ['have', 'What', 'what', 'data', 'i']\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Solution (\n Id integer, -- example: [1, 2]\n Path text, -- example: ['wallerdev_htmlsharp\\\\HtmlSharp.sln', 'maravillas_linq-to-delicious\\\\tasty.sln']\n ProcessedTime integer, -- example: [636430963695642191, 636430963721734366]\n WasCompiled integer, -- example: [1, 0]\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Method (\n Id integer, -- example: [1, 2]\n Name text, -- example: ['HtmlSharp.HtmlParser.Feed', 'HtmlSharp.HtmlParser.ParseDoctypeElement']\n FullComment text, -- example: ['Feeds data into the parser', ' interneral -- scan past <!ELEMENT decla']\n Summary text, -- example: ['Converts the query expression into text ', 'Execute the query expression ']\n CommentIsXml integer, -- example: [0, 1]\n SampledAt integer, -- example: [636430963695654788, 636430963695709898]\n SolutionId integer, -- example: [1, 2]\n Lang text, -- Language, example: ['en', 'fr']\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:\nformat refers CommentIsXml; method number refers to Method_100k.Id; Method_100k.Id = 8;\nWhat format does the method number 8's comment have?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"split": "train"
} |
nl2sql | [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE Solution (\n Id integer, -- example: [1, 2]\n RepoId integer, -- Repository Id, example: [1, 3]\n Path text, -- example: ['wallerdev_htmlsharp\\\\HtmlSharp.sln', 'maravillas_linq-to-delicious\\\\tasty.sln']\n ProcessedTime integer, -- example: [636430963695642191, 636430963721734366]\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Repo (\n Id integer, -- example: [1, 2]\n Url text, -- example: ['https://github.com/wallerdev/htmlsharp.g', 'https://github.com/unclebob/nslim.git']\n Stars integer, -- example: [14, 6]\n Forks integer, -- example: [2, 3]\n Watchers integer, -- example: [14, 6]\n ProcessedTime integer, -- example: [636430963247108053, 636472436323838240]\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Method (\n Id integer, -- example: [1, 2]\n FullComment text, -- example: ['Feeds data into the parser', ' interneral -- scan past <!ELEMENT decla']\n Summary text, -- example: ['Converts the query expression into text ', 'Execute the query expression ']\n ApiCalls text, -- example: ['System.String.IsNullOrEmpty HtmlSharp.Ht', 'HtmlSharp.HtmlParser.ScanName System.Col']\n CommentIsXml integer, -- example: [0, 1]\n SampledAt integer, -- example: [636430963695654788, 636430963695709898]\n SolutionId integer, -- example: [1, 2]\n Lang text, -- Language, example: ['en', 'fr']\n NameTokenized text, -- example: ['html parser feed', 'html parser parse doctype element']\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE MethodParameter (\n Id integer, -- example: [1, 2]\n MethodId text, -- example: ['1', '2']\n Type text, -- example: ['System.String', 'System.Int32']\n Name text, -- example: ['repoID', 'repoId', 'Found', 'found', 'What', 'what']\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:\nlanguage of method refers to Lang; method number refers to Method_100k.Id; Method_100k.Id = 28; repository number refers to RepoId; RepoID = 3;\nWhat is the language of method number 28 that can be found in the repository number 3?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"role": "user"
}
] | nl2sql | {
"ground_truth": "SELECT T2.Lang FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T2.Id = 28 AND T1.RepoId = 3",
"style": "rule"
} | {
"db_id": "codebase_comments.sqlite",
"gt_sql": "SELECT T2.Lang FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T2.Id = 28 AND T1.RepoId = 3",
"index": 326,
"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 Solution (\n Id integer, -- example: [1, 2]\n RepoId integer, -- Repository Id, example: [1, 3]\n Path text, -- example: ['wallerdev_htmlsharp\\\\HtmlSharp.sln', 'maravillas_linq-to-delicious\\\\tasty.sln']\n ProcessedTime integer, -- example: [636430963695642191, 636430963721734366]\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Repo (\n Id integer, -- example: [1, 2]\n Url text, -- example: ['https://github.com/wallerdev/htmlsharp.g', 'https://github.com/unclebob/nslim.git']\n Stars integer, -- example: [14, 6]\n Forks integer, -- example: [2, 3]\n Watchers integer, -- example: [14, 6]\n ProcessedTime integer, -- example: [636430963247108053, 636472436323838240]\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Method (\n Id integer, -- example: [1, 2]\n FullComment text, -- example: ['Feeds data into the parser', ' interneral -- scan past <!ELEMENT decla']\n Summary text, -- example: ['Converts the query expression into text ', 'Execute the query expression ']\n ApiCalls text, -- example: ['System.String.IsNullOrEmpty HtmlSharp.Ht', 'HtmlSharp.HtmlParser.ScanName System.Col']\n CommentIsXml integer, -- example: [0, 1]\n SampledAt integer, -- example: [636430963695654788, 636430963695709898]\n SolutionId integer, -- example: [1, 2]\n Lang text, -- Language, example: ['en', 'fr']\n NameTokenized text, -- example: ['html parser feed', 'html parser parse doctype element']\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE MethodParameter (\n Id integer, -- example: [1, 2]\n MethodId text, -- example: ['1', '2']\n Type text, -- example: ['System.String', 'System.Int32']\n Name text, -- example: ['repoID', 'repoId', 'Found', 'found', 'What', 'what']\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:\nlanguage of method refers to Lang; method number refers to Method_100k.Id; Method_100k.Id = 28; repository number refers to RepoId; RepoID = 3;\nWhat is the language of method number 28 that can be found in the repository number 3?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"split": "train"
} |
nl2sql | [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE Solution (\n Id integer, -- example: [1, 2]\n RepoId integer, -- Repository Id, example: [1, 3]\n Path text, -- example: ['wallerdev_htmlsharp\\\\HtmlSharp.sln', 'maravillas_linq-to-delicious\\\\tasty.sln']\n ProcessedTime integer, -- example: [636430963695642191, 636430963721734366]\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Method (\n Id integer, -- example: [1, 2]\n Name text, -- example: ['HtmlSharp.HtmlParser.Feed', 'HtmlSharp.HtmlParser.ParseDoctypeElement']\n ApiCalls text, -- example: ['System.String.IsNullOrEmpty HtmlSharp.Ht', 'HtmlSharp.HtmlParser.ScanName System.Col']\n CommentIsXml integer, -- example: [0, 1]\n SolutionId integer, -- example: [1, 2]\n Lang text, -- Language, example: ['en', 'fr']\n NameTokenized text, -- example: ['api call', 'html parser feed', 'html parser parse doctype element']\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Repo (\n Id integer, -- example: [1, 2]\n Stars integer, -- example: [14, 6]\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE MethodParameter (\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:\nmethod number refers to Method_100k.Id; Method_100k.Id = 10; intended course of action refers to Path;\nPlease state the API calls for method number 10 and its intended course of action.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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.ApiCalls, T1.Path FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T2.Id = 10",
"style": "rule"
} | {
"db_id": "codebase_comments.sqlite",
"gt_sql": "SELECT T2.ApiCalls, T1.Path FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T2.Id = 10",
"index": 327,
"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 Solution (\n Id integer, -- example: [1, 2]\n RepoId integer, -- Repository Id, example: [1, 3]\n Path text, -- example: ['wallerdev_htmlsharp\\\\HtmlSharp.sln', 'maravillas_linq-to-delicious\\\\tasty.sln']\n ProcessedTime integer, -- example: [636430963695642191, 636430963721734366]\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Method (\n Id integer, -- example: [1, 2]\n Name text, -- example: ['HtmlSharp.HtmlParser.Feed', 'HtmlSharp.HtmlParser.ParseDoctypeElement']\n ApiCalls text, -- example: ['System.String.IsNullOrEmpty HtmlSharp.Ht', 'HtmlSharp.HtmlParser.ScanName System.Col']\n CommentIsXml integer, -- example: [0, 1]\n SolutionId integer, -- example: [1, 2]\n Lang text, -- Language, example: ['en', 'fr']\n NameTokenized text, -- example: ['api call', 'html parser feed', 'html parser parse doctype element']\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Repo (\n Id integer, -- example: [1, 2]\n Stars integer, -- example: [14, 6]\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE MethodParameter (\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:\nmethod number refers to Method_100k.Id; Method_100k.Id = 10; intended course of action refers to Path;\nPlease state the API calls for method number 10 and its intended course of action.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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 Repo (\n Id integer, -- example: [1, 2]\n Stars integer, -- example: [14, 6]\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Method (\n Id integer, -- example: [1, 2]\n Name text, -- example: ['HtmlSharp.HtmlParser.Feed', 'HtmlSharp.HtmlParser.ParseDoctypeElement']\n CommentIsXml integer, -- example: [0, 1]\n NameTokenized text, -- example: ['string extensions to pascal case', 'extensions to pascal case', 'html parser feed', 'html parser parse doctype element']\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE MethodParameter (\n Id integer, -- example: [1, 2]\n Name text, -- example: ['nameToken', 'pascal', 'What', 'what', 'nameTokens', 'data']\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Solution (\n Id integer, -- example: [1, 2]\n ProcessedTime integer, -- example: [636430963695642191, 636430963721734366]\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:\nmethod refers to Name; task of the method refers to the second part of the Name after the \".\"; tokenized name refers to NameTokenized; NameTokenized = 'string extensions to pascal case';\nWhat is the task method of the tokenized name \"string extensions to pascal case\n\"?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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 SUBSTR(SUBSTR(Name, INSTR(Name, '.') + 1), 1, INSTR(SUBSTR(Name, INSTR(Name, '.') + 1), '.') - 1) task FROM Method WHERE NameTokenized = 'string extensions to pascal case'",
"style": "rule"
} | {
"db_id": "codebase_comments.sqlite",
"gt_sql": "SELECT DISTINCT SUBSTR(SUBSTR(Name, INSTR(Name, '.') + 1), 1, INSTR(SUBSTR(Name, INSTR(Name, '.') + 1), '.') - 1) task FROM Method WHERE NameTokenized = 'string extensions to pascal case'",
"index": 328,
"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 Repo (\n Id integer, -- example: [1, 2]\n Stars integer, -- example: [14, 6]\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Method (\n Id integer, -- example: [1, 2]\n Name text, -- example: ['HtmlSharp.HtmlParser.Feed', 'HtmlSharp.HtmlParser.ParseDoctypeElement']\n CommentIsXml integer, -- example: [0, 1]\n NameTokenized text, -- example: ['string extensions to pascal case', 'extensions to pascal case', 'html parser feed', 'html parser parse doctype element']\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE MethodParameter (\n Id integer, -- example: [1, 2]\n Name text, -- example: ['nameToken', 'pascal', 'What', 'what', 'nameTokens', 'data']\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Solution (\n Id integer, -- example: [1, 2]\n ProcessedTime integer, -- example: [636430963695642191, 636430963721734366]\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:\nmethod refers to Name; task of the method refers to the second part of the Name after the \".\"; tokenized name refers to NameTokenized; NameTokenized = 'string extensions to pascal case';\nWhat is the task method of the tokenized name \"string extensions to pascal case\n\"?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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 Solution (\n Id integer, -- example: [1, 2]\n RepoId integer, -- Repository Id, example: [1, 3]\n Path text, -- example: ['wallerdev_htmlsharp\\\\HtmlSharp.sln', 'maravillas_linq-to-delicious\\\\tasty.sln']\n ProcessedTime integer, -- example: [636430963695642191, 636430963721734366]\n WasCompiled integer, -- example: [1, 0]\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Repo (\n Id integer, -- example: [1, 2]\n Url text, -- example: ['https://github.com/jeffdik/tachy.git', 'https://github.com/wallerdev/htmlsharp.g', 'https://github.com/unclebob/nslim.git']\n Stars integer, -- example: [14, 6]\n Forks integer, -- example: [2, 3]\n Watchers integer, -- example: [14, 6]\n ProcessedTime integer, -- example: [636430963247108053, 636472436323838240]\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE MethodParameter (\n Id integer, -- example: [1, 2]\n MethodId text, -- example: ['1', '2']\n Type text, -- example: ['System.String', 'System.Int32']\n Name text, -- example: ['github', 'have', 'how', 'How', 'data', 'i']\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Method (\n Id integer, -- example: [1, 2]\n Name text, -- example: ['HtmlSharp.HtmlParser.Feed', 'HtmlSharp.HtmlParser.ParseDoctypeElement']\n FullComment text, -- example: ['Feeds data into the parser', ' interneral -- scan past <!ELEMENT decla']\n Summary text, -- example: ['Converts the query expression into text ', 'Execute the query expression ']\n ApiCalls text, -- example: ['System.String.IsNullOrEmpty HtmlSharp.Ht', 'HtmlSharp.HtmlParser.ScanName System.Col']\n CommentIsXml integer, -- example: [0, 1]\n SampledAt integer, -- example: [636430963695654788, 636430963695709898]\n SolutionId integer, -- example: [1, 2]\n Lang text, -- Language, example: ['en', 'fr']\n NameTokenized text, -- example: ['html parser feed', 'html parser parse doctype element']\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:\ngithub address refers to Url; Url = 'https://github.com/jeffdik/tachy.git';\nHow many path does the github address \"https://github.com/jeffdik/tachy.git\" have?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"role": "user"
}
] | nl2sql | {
"ground_truth": "SELECT COUNT(DISTINCT T2.Path) FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T1.Url = 'https://github.com/jeffdik/tachy.git'",
"style": "rule"
} | {
"db_id": "codebase_comments.sqlite",
"gt_sql": "SELECT COUNT(DISTINCT T2.Path) FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T1.Url = 'https://github.com/jeffdik/tachy.git'",
"index": 329,
"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 Solution (\n Id integer, -- example: [1, 2]\n RepoId integer, -- Repository Id, example: [1, 3]\n Path text, -- example: ['wallerdev_htmlsharp\\\\HtmlSharp.sln', 'maravillas_linq-to-delicious\\\\tasty.sln']\n ProcessedTime integer, -- example: [636430963695642191, 636430963721734366]\n WasCompiled integer, -- example: [1, 0]\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Repo (\n Id integer, -- example: [1, 2]\n Url text, -- example: ['https://github.com/jeffdik/tachy.git', 'https://github.com/wallerdev/htmlsharp.g', 'https://github.com/unclebob/nslim.git']\n Stars integer, -- example: [14, 6]\n Forks integer, -- example: [2, 3]\n Watchers integer, -- example: [14, 6]\n ProcessedTime integer, -- example: [636430963247108053, 636472436323838240]\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE MethodParameter (\n Id integer, -- example: [1, 2]\n MethodId text, -- example: ['1', '2']\n Type text, -- example: ['System.String', 'System.Int32']\n Name text, -- example: ['github', 'have', 'how', 'How', 'data', 'i']\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Method (\n Id integer, -- example: [1, 2]\n Name text, -- example: ['HtmlSharp.HtmlParser.Feed', 'HtmlSharp.HtmlParser.ParseDoctypeElement']\n FullComment text, -- example: ['Feeds data into the parser', ' interneral -- scan past <!ELEMENT decla']\n Summary text, -- example: ['Converts the query expression into text ', 'Execute the query expression ']\n ApiCalls text, -- example: ['System.String.IsNullOrEmpty HtmlSharp.Ht', 'HtmlSharp.HtmlParser.ScanName System.Col']\n CommentIsXml integer, -- example: [0, 1]\n SampledAt integer, -- example: [636430963695654788, 636430963695709898]\n SolutionId integer, -- example: [1, 2]\n Lang text, -- Language, example: ['en', 'fr']\n NameTokenized text, -- example: ['html parser feed', 'html parser parse doctype element']\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:\ngithub address refers to Url; Url = 'https://github.com/jeffdik/tachy.git';\nHow many path does the github address \"https://github.com/jeffdik/tachy.git\" have?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"split": "train"
} |
nl2sql | [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE Method (\n Id integer, -- example: [1, 2]\n Name text, -- example: ['HtmlSharp.HtmlParser.Feed', 'HtmlSharp.HtmlParser.ParseDoctypeElement']\n Summary text, -- example: ['Converts the query expression into text ', 'Execute the query expression ']\n ApiCalls text, -- example: ['System.String.IsNullOrEmpty HtmlSharp.Ht', 'HtmlSharp.HtmlParser.ScanName System.Col']\n CommentIsXml integer, -- example: [0, 1]\n SampledAt integer, -- example: [636430963695654788, 636430963695709898]\n SolutionId integer, -- example: [1, 2]\n Lang text, -- Language, example: ['en', 'fr']\n NameTokenized text, -- example: ['r without', 'html parser feed', 'html parser parse doctype element']\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Repo (\n Id integer, -- example: [1, 2]\n Url text, -- example: ['https://github.com/wallerdev/htmlsharp.g', 'https://github.com/unclebob/nslim.git']\n Forks integer, -- example: [2, 3]\n Watchers integer, -- example: [14, 6]\n ProcessedTime integer, -- example: [636430963247108053, 636472436323838240]\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Solution (\n Id integer, -- example: [1, 2]\n RepoId integer, -- Repository Id, example: [1, 3]\n Path text, -- example: ['wallerdev_htmlsharp\\\\HtmlSharp.sln', 'maravillas_linq-to-delicious\\\\tasty.sln']\n ProcessedTime integer, -- example: [636430963695642191, 636430963721734366]\n WasCompiled integer, -- example: [1, 0]\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE MethodParameter (\n Id integer, -- example: [1, 2]\n MethodId text, -- example: ['1', '2']\n Type text, -- example: ['System.String', 'System.Int32']\n Name text, -- example: ['without', 'github', 'Need', 'need', 'can', 'Can']\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:\ngithub address refers to Url; solution can be implemented without the need of compliation refers to WasCompiled = 1;\nList 5 github address that the solutions can be implemented without the need of compilation.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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.Url FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T2.WasCompiled = 1 LIMIT 5",
"style": "rule"
} | {
"db_id": "codebase_comments.sqlite",
"gt_sql": "SELECT T1.Url FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T2.WasCompiled = 1 LIMIT 5",
"index": 330,
"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 Method (\n Id integer, -- example: [1, 2]\n Name text, -- example: ['HtmlSharp.HtmlParser.Feed', 'HtmlSharp.HtmlParser.ParseDoctypeElement']\n Summary text, -- example: ['Converts the query expression into text ', 'Execute the query expression ']\n ApiCalls text, -- example: ['System.String.IsNullOrEmpty HtmlSharp.Ht', 'HtmlSharp.HtmlParser.ScanName System.Col']\n CommentIsXml integer, -- example: [0, 1]\n SampledAt integer, -- example: [636430963695654788, 636430963695709898]\n SolutionId integer, -- example: [1, 2]\n Lang text, -- Language, example: ['en', 'fr']\n NameTokenized text, -- example: ['r without', 'html parser feed', 'html parser parse doctype element']\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Repo (\n Id integer, -- example: [1, 2]\n Url text, -- example: ['https://github.com/wallerdev/htmlsharp.g', 'https://github.com/unclebob/nslim.git']\n Forks integer, -- example: [2, 3]\n Watchers integer, -- example: [14, 6]\n ProcessedTime integer, -- example: [636430963247108053, 636472436323838240]\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Solution (\n Id integer, -- example: [1, 2]\n RepoId integer, -- Repository Id, example: [1, 3]\n Path text, -- example: ['wallerdev_htmlsharp\\\\HtmlSharp.sln', 'maravillas_linq-to-delicious\\\\tasty.sln']\n ProcessedTime integer, -- example: [636430963695642191, 636430963721734366]\n WasCompiled integer, -- example: [1, 0]\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE MethodParameter (\n Id integer, -- example: [1, 2]\n MethodId text, -- example: ['1', '2']\n Type text, -- example: ['System.String', 'System.Int32']\n Name text, -- example: ['without', 'github', 'Need', 'need', 'can', 'Can']\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:\ngithub address refers to Url; solution can be implemented without the need of compliation refers to WasCompiled = 1;\nList 5 github address that the solutions can be implemented without the need of compilation.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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 Solution (\n Id integer, -- example: [1, 2]\n RepoId integer, -- Repository Id, example: [1, 3]\n ProcessedTime integer, -- example: [636430963695642191, 636430963721734366]\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Repo (\n Id integer, -- example: [1, 2]\n Url text, -- example: ['https://github.com/dogeth/vss2git.git', 'https://github.com/wallerdev/htmlsharp.g', 'https://github.com/unclebob/nslim.git']\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE MethodParameter (\n Id integer, -- example: [1, 2]\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Method (\n Id integer, -- example: [1, 2]\n CommentIsXml integer, -- example: [0, 1]\n SolutionId integer, -- example: [1, 2]\n Lang text, -- Language, example: ['en', 'fr']\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:\nXml format refers to CommentisXml, github address refers to Url; Url = 'https://github.com/dogeth/vss2git.git';\nHow many XML format does the github address \"https://github.com/dogeth/vss2git.git\" have?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"role": "user"
}
] | nl2sql | {
"ground_truth": "SELECT COUNT(T3.CommentIsXml) FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId INNER JOIN Method AS T3 ON T2.Id = T3.SolutionId WHERE T1.Url = 'https://github.com/dogeth/vss2git.git' AND T3.CommentIsXml = 1",
"style": "rule"
} | {
"db_id": "codebase_comments.sqlite",
"gt_sql": "SELECT COUNT(T3.CommentIsXml) FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId INNER JOIN Method AS T3 ON T2.Id = T3.SolutionId WHERE T1.Url = 'https://github.com/dogeth/vss2git.git' AND T3.CommentIsXml = 1",
"index": 331,
"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 Solution (\n Id integer, -- example: [1, 2]\n RepoId integer, -- Repository Id, example: [1, 3]\n ProcessedTime integer, -- example: [636430963695642191, 636430963721734366]\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Repo (\n Id integer, -- example: [1, 2]\n Url text, -- example: ['https://github.com/dogeth/vss2git.git', 'https://github.com/wallerdev/htmlsharp.g', 'https://github.com/unclebob/nslim.git']\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE MethodParameter (\n Id integer, -- example: [1, 2]\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Method (\n Id integer, -- example: [1, 2]\n CommentIsXml integer, -- example: [0, 1]\n SolutionId integer, -- example: [1, 2]\n Lang text, -- Language, example: ['en', 'fr']\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:\nXml format refers to CommentisXml, github address refers to Url; Url = 'https://github.com/dogeth/vss2git.git';\nHow many XML format does the github address \"https://github.com/dogeth/vss2git.git\" have?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"split": "train"
} |
nl2sql | [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE Method (\n Id integer, -- example: [1, 2]\n Name text, -- example: ['HtmlSharp.HtmlParser.Feed', 'HtmlSharp.HtmlParser.ParseDoctypeElement']\n FullComment text, -- example: ['Feeds data into the parser', ' interneral -- scan past <!ELEMENT decla']\n CommentIsXml integer, -- example: [0, 1]\n SampledAt integer, -- example: [636430963695654788, 636430963695709898]\n SolutionId integer, -- example: [1, 2]\n Lang text, -- Language, example: ['en', 'fr']\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Repo (\n Id integer, -- example: [1, 2]\n Url text, -- example: ['https://github.com/wallerdev/htmlsharp.g', 'https://github.com/unclebob/nslim.git']\n Stars integer, -- example: [14, 6]\n Watchers integer, -- example: [14, 6]\n ProcessedTime integer, -- example: [636430963247108053, 636472436323838240]\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE MethodParameter (\n Id integer, -- example: [1, 2]\n MethodId text, -- example: ['1', '2']\n Type text, -- example: ['System.String', 'System.Int32']\n Name text, -- example: ['has', 'data', 'i']\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Solution (\n Id integer, -- example: [1, 2]\n RepoId integer, -- Repository Id, example: [1, 3]\n Path text, -- example: ['wallerdev_htmlsharp\\\\HtmlSharp.sln', 'maravillas_linq-to-delicious\\\\tasty.sln']\n ProcessedTime integer, -- example: [636430963695642191, 636430963721734366]\n WasCompiled integer, -- example: [1, 0]\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:\nsolution path refers to Path; sampling time refers to SampledAt; SampledAt = '636431758961741000';\nList 5 solution path that has sampling time of 636431758961741000.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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.Path FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T2.SampledAt = 636431758961741000 LIMIT 5",
"style": "rule"
} | {
"db_id": "codebase_comments.sqlite",
"gt_sql": "SELECT DISTINCT T1.Path FROM Solution AS T1 INNER JOIN Method AS T2 ON T1.Id = T2.SolutionId WHERE T2.SampledAt = 636431758961741000 LIMIT 5",
"index": 332,
"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 Method (\n Id integer, -- example: [1, 2]\n Name text, -- example: ['HtmlSharp.HtmlParser.Feed', 'HtmlSharp.HtmlParser.ParseDoctypeElement']\n FullComment text, -- example: ['Feeds data into the parser', ' interneral -- scan past <!ELEMENT decla']\n CommentIsXml integer, -- example: [0, 1]\n SampledAt integer, -- example: [636430963695654788, 636430963695709898]\n SolutionId integer, -- example: [1, 2]\n Lang text, -- Language, example: ['en', 'fr']\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Repo (\n Id integer, -- example: [1, 2]\n Url text, -- example: ['https://github.com/wallerdev/htmlsharp.g', 'https://github.com/unclebob/nslim.git']\n Stars integer, -- example: [14, 6]\n Watchers integer, -- example: [14, 6]\n ProcessedTime integer, -- example: [636430963247108053, 636472436323838240]\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE MethodParameter (\n Id integer, -- example: [1, 2]\n MethodId text, -- example: ['1', '2']\n Type text, -- example: ['System.String', 'System.Int32']\n Name text, -- example: ['has', 'data', 'i']\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Solution (\n Id integer, -- example: [1, 2]\n RepoId integer, -- Repository Id, example: [1, 3]\n Path text, -- example: ['wallerdev_htmlsharp\\\\HtmlSharp.sln', 'maravillas_linq-to-delicious\\\\tasty.sln']\n ProcessedTime integer, -- example: [636430963695642191, 636430963721734366]\n WasCompiled integer, -- example: [1, 0]\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:\nsolution path refers to Path; sampling time refers to SampledAt; SampledAt = '636431758961741000';\nList 5 solution path that has sampling time of 636431758961741000.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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 Solution (\n Id integer, -- example: [1, 2]\n RepoId integer, -- Repository Id, example: [1, 3]\n Path text, -- example: ['wallerdev_htmlsharp\\\\HtmlSharp.sln', 'maravillas_linq-to-delicious\\\\tasty.sln']\n ProcessedTime integer, -- example: [636430963695642191, 636430963721734366]\n WasCompiled integer, -- example: [1, 0]\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Repo (\n Id integer, -- example: [1, 2]\n Url text, -- example: ['https://github.com/wallerdev/htmlsharp.g', 'https://github.com/unclebob/nslim.git']\n Stars integer, -- example: [14, 6]\n Forks integer, -- example: [2, 3]\n Watchers integer, -- example: [14, 6]\n ProcessedTime integer, -- example: [636430963247108053, 636472436323838240]\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE MethodParameter (\n Id integer, -- example: [1, 2]\n MethodId text, -- example: ['1', '2']\n Type text, -- example: ['System.String', 'System.Int32']\n Name text, -- example: ['github', 'What', 'what', 'data', 'i']\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Method (\n Id integer, -- example: [1, 2]\n Name text, -- example: ['HtmlSharp.HtmlParser.Feed', 'HtmlSharp.HtmlParser.ParseDoctypeElement']\n FullComment text, -- example: ['Feeds data into the parser', ' interneral -- scan past <!ELEMENT decla']\n Summary text, -- example: ['Converts the query expression into text ', 'Execute the query expression ']\n ApiCalls text, -- example: ['System.String.IsNullOrEmpty HtmlSharp.Ht', 'HtmlSharp.HtmlParser.ScanName System.Col']\n CommentIsXml integer, -- example: [0, 1]\n SampledAt integer, -- example: [636430963695654788, 636430963695709898]\n SolutionId integer, -- example: [1, 2]\n Lang text, -- Language, example: ['en', 'fr']\n NameTokenized text, -- example: ['html parser feed', 'html parser parse doctype element']\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:\ngithub address refers to Url; solution path refers to Path; Path = 'joeyrobert_bloomfilter\\DataTypes.BloomFilter.sln';\nWhat is the github address of the solution path \"joeyrobert_bloomfilter\\DataTypes.BloomFilter.sln\"?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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.Url FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T2.Path = 'joeyrobert_bloomfilterDataTypes.BloomFilter.sln'",
"style": "rule"
} | {
"db_id": "codebase_comments.sqlite",
"gt_sql": "SELECT T1.Url FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId WHERE T2.Path = 'joeyrobert_bloomfilterDataTypes.BloomFilter.sln'",
"index": 333,
"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 Solution (\n Id integer, -- example: [1, 2]\n RepoId integer, -- Repository Id, example: [1, 3]\n Path text, -- example: ['wallerdev_htmlsharp\\\\HtmlSharp.sln', 'maravillas_linq-to-delicious\\\\tasty.sln']\n ProcessedTime integer, -- example: [636430963695642191, 636430963721734366]\n WasCompiled integer, -- example: [1, 0]\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Repo (\n Id integer, -- example: [1, 2]\n Url text, -- example: ['https://github.com/wallerdev/htmlsharp.g', 'https://github.com/unclebob/nslim.git']\n Stars integer, -- example: [14, 6]\n Forks integer, -- example: [2, 3]\n Watchers integer, -- example: [14, 6]\n ProcessedTime integer, -- example: [636430963247108053, 636472436323838240]\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE MethodParameter (\n Id integer, -- example: [1, 2]\n MethodId text, -- example: ['1', '2']\n Type text, -- example: ['System.String', 'System.Int32']\n Name text, -- example: ['github', 'What', 'what', 'data', 'i']\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Method (\n Id integer, -- example: [1, 2]\n Name text, -- example: ['HtmlSharp.HtmlParser.Feed', 'HtmlSharp.HtmlParser.ParseDoctypeElement']\n FullComment text, -- example: ['Feeds data into the parser', ' interneral -- scan past <!ELEMENT decla']\n Summary text, -- example: ['Converts the query expression into text ', 'Execute the query expression ']\n ApiCalls text, -- example: ['System.String.IsNullOrEmpty HtmlSharp.Ht', 'HtmlSharp.HtmlParser.ScanName System.Col']\n CommentIsXml integer, -- example: [0, 1]\n SampledAt integer, -- example: [636430963695654788, 636430963695709898]\n SolutionId integer, -- example: [1, 2]\n Lang text, -- Language, example: ['en', 'fr']\n NameTokenized text, -- example: ['html parser feed', 'html parser parse doctype element']\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:\ngithub address refers to Url; solution path refers to Path; Path = 'joeyrobert_bloomfilter\\DataTypes.BloomFilter.sln';\nWhat is the github address of the solution path \"joeyrobert_bloomfilter\\DataTypes.BloomFilter.sln\"?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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 MethodParameter (\n Id integer, -- example: [1, 2]\n MethodId text, -- example: ['1', '2']\n Type text, -- example: ['System.String', 'System.Int32']\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Solution (\n Id integer, -- example: [1, 2]\n RepoId integer, -- Repository Id, example: [1, 3]\n Path text, -- example: ['wallerdev_htmlsharp\\\\HtmlSharp.sln', 'maravillas_linq-to-delicious\\\\tasty.sln']\n ProcessedTime integer, -- example: [636430963695642191, 636430963721734366]\n WasCompiled integer, -- example: [1, 0]\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Method (\n Id integer, -- example: [1, 2]\n Name text, -- example: ['HtmlSharp.HtmlParser.Feed', 'HtmlSharp.HtmlParser.ParseDoctypeElement']\n FullComment text, -- example: ['Feeds data into the parser', ' interneral -- scan past <!ELEMENT decla']\n Summary text, -- example: ['A test for Decompose', 'Converts the query expression into text ', 'Execute the query expression ']\n ApiCalls text, -- example: ['System.String.IsNullOrEmpty HtmlSharp.Ht', 'HtmlSharp.HtmlParser.ScanName System.Col']\n CommentIsXml integer, -- example: [0, 1]\n SampledAt integer, -- example: [636430963695654788, 636430963695709898]\n SolutionId integer, -- example: [1, 2]\n Lang text, -- Language, example: ['en', 'fr']\n NameTokenized text, -- example: ['html parser feed', 'html parser parse doctype element']\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Repo (\n Id integer, -- example: [1, 2]\n Url text, -- example: ['https://github.com/wallerdev/htmlsharp.g', 'https://github.com/unclebob/nslim.git']\n Stars integer, -- example: [14, 6]\n Forks integer, -- example: [2, 3]\n ProcessedTime integer, -- example: [636430963247108053, 636472436323838240]\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:\ngithub address refers to Url; summary of method refers to Summary; Summary = 'A test for Decompose';\nProvide the github address with the summary of method \"A test for Decompose\n\".\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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.Url FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId INNER JOIN Method AS T3 ON T2.Id = T3.SolutionId WHERE T3.Summary = 'A test for Decompose'",
"style": "rule"
} | {
"db_id": "codebase_comments.sqlite",
"gt_sql": "SELECT T1.Url FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId INNER JOIN Method AS T3 ON T2.Id = T3.SolutionId WHERE T3.Summary = 'A test for Decompose'",
"index": 334,
"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 MethodParameter (\n Id integer, -- example: [1, 2]\n MethodId text, -- example: ['1', '2']\n Type text, -- example: ['System.String', 'System.Int32']\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Solution (\n Id integer, -- example: [1, 2]\n RepoId integer, -- Repository Id, example: [1, 3]\n Path text, -- example: ['wallerdev_htmlsharp\\\\HtmlSharp.sln', 'maravillas_linq-to-delicious\\\\tasty.sln']\n ProcessedTime integer, -- example: [636430963695642191, 636430963721734366]\n WasCompiled integer, -- example: [1, 0]\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Method (\n Id integer, -- example: [1, 2]\n Name text, -- example: ['HtmlSharp.HtmlParser.Feed', 'HtmlSharp.HtmlParser.ParseDoctypeElement']\n FullComment text, -- example: ['Feeds data into the parser', ' interneral -- scan past <!ELEMENT decla']\n Summary text, -- example: ['A test for Decompose', 'Converts the query expression into text ', 'Execute the query expression ']\n ApiCalls text, -- example: ['System.String.IsNullOrEmpty HtmlSharp.Ht', 'HtmlSharp.HtmlParser.ScanName System.Col']\n CommentIsXml integer, -- example: [0, 1]\n SampledAt integer, -- example: [636430963695654788, 636430963695709898]\n SolutionId integer, -- example: [1, 2]\n Lang text, -- Language, example: ['en', 'fr']\n NameTokenized text, -- example: ['html parser feed', 'html parser parse doctype element']\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Repo (\n Id integer, -- example: [1, 2]\n Url text, -- example: ['https://github.com/wallerdev/htmlsharp.g', 'https://github.com/unclebob/nslim.git']\n Stars integer, -- example: [14, 6]\n Forks integer, -- example: [2, 3]\n ProcessedTime integer, -- example: [636430963247108053, 636472436323838240]\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:\ngithub address refers to Url; summary of method refers to Summary; Summary = 'A test for Decompose';\nProvide the github address with the summary of method \"A test for Decompose\n\".\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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 Solution (\n Id integer, -- example: [1, 2]\n RepoId integer, -- Repository Id, example: [1, 3]\n Path text, -- example: ['wallerdev_htmlsharp\\\\HtmlSharp.sln', 'maravillas_linq-to-delicious\\\\tasty.sln']\n WasCompiled integer, -- example: [1, 0]\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE MethodParameter (\n Id integer, -- example: [1, 2]\n MethodId text, -- example: ['1', '2']\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Method (\n Id integer, -- example: [1, 2]\n FullComment text, -- example: ['Feeds data into the parser', ' interneral -- scan past <!ELEMENT decla']\n CommentIsXml integer, -- example: [0, 1]\n SampledAt integer, -- example: [636430963695654788, 636430963695709898]\n SolutionId integer, -- example: [1, 2]\n Lang text, -- Language, example: ['en', 'fr']\n NameTokenized text, -- example: ['html parser feed', 'html parser parse doctype element']\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Repo (\n Id integer, -- example: [1, 2]\n Url text, -- example: ['https://github.com/wallerdev/htmlsharp.g', 'https://github.com/unclebob/nslim.git']\n Stars integer, -- example: [14, 6]\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:\nlanguage code of method refers to Lang; github address refers to Url; Url = 'https://github.com/managedfusion/managedfusion.git';\nHow many language code of method is used for the github address \"https://github.com/managedfusion/managedfusion.git\n\"?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"role": "user"
}
] | nl2sql | {
"ground_truth": "SELECT COUNT(DISTINCT T3.Lang) FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId INNER JOIN Method AS T3 ON T2.Id = T3.SolutionId WHERE T1.Url = 'https://github.com/managedfusion/managedfusion.git'",
"style": "rule"
} | {
"db_id": "codebase_comments.sqlite",
"gt_sql": "SELECT COUNT(DISTINCT T3.Lang) FROM Repo AS T1 INNER JOIN Solution AS T2 ON T1.Id = T2.RepoId INNER JOIN Method AS T3 ON T2.Id = T3.SolutionId WHERE T1.Url = 'https://github.com/managedfusion/managedfusion.git'",
"index": 335,
"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 Solution (\n Id integer, -- example: [1, 2]\n RepoId integer, -- Repository Id, example: [1, 3]\n Path text, -- example: ['wallerdev_htmlsharp\\\\HtmlSharp.sln', 'maravillas_linq-to-delicious\\\\tasty.sln']\n WasCompiled integer, -- example: [1, 0]\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE MethodParameter (\n Id integer, -- example: [1, 2]\n MethodId text, -- example: ['1', '2']\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Method (\n Id integer, -- example: [1, 2]\n FullComment text, -- example: ['Feeds data into the parser', ' interneral -- scan past <!ELEMENT decla']\n CommentIsXml integer, -- example: [0, 1]\n SampledAt integer, -- example: [636430963695654788, 636430963695709898]\n SolutionId integer, -- example: [1, 2]\n Lang text, -- Language, example: ['en', 'fr']\n NameTokenized text, -- example: ['html parser feed', 'html parser parse doctype element']\n PRIMARY KEY (Id)\n);\n\nCREATE TABLE Repo (\n Id integer, -- example: [1, 2]\n Url text, -- example: ['https://github.com/wallerdev/htmlsharp.g', 'https://github.com/unclebob/nslim.git']\n Stars integer, -- example: [14, 6]\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:\nlanguage code of method refers to Lang; github address refers to Url; Url = 'https://github.com/managedfusion/managedfusion.git';\nHow many language code of method is used for the github address \"https://github.com/managedfusion/managedfusion.git\n\"?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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 cars (\n id integer, -- example: [1, 2]\n train_id integer, -- example: [1, 2]\n `position` integer, -- example: [1, 2]\n len text, -- length, example: ['short', 'long']\n PRIMARY KEY (id),\n CONSTRAINT fk_cars_train_id FOREIGN KEY (train_id) REFERENCES trains (id)\n);\n\nCREATE TABLE trains (\n id integer, -- example: [1, 2]\n direction text, -- example: ['east', 'west']\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:\neast is a direction\nHow many trains are there that run in the east direction?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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(id) FROM trains WHERE direction = 'east'",
"style": "rule"
} | {
"db_id": "trains.sqlite",
"gt_sql": "SELECT COUNT(id) FROM trains WHERE direction = 'east'",
"index": 336,
"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 cars (\n id integer, -- example: [1, 2]\n train_id integer, -- example: [1, 2]\n `position` integer, -- example: [1, 2]\n len text, -- length, example: ['short', 'long']\n PRIMARY KEY (id),\n CONSTRAINT fk_cars_train_id FOREIGN KEY (train_id) REFERENCES trains (id)\n);\n\nCREATE TABLE trains (\n id integer, -- example: [1, 2]\n direction text, -- example: ['east', 'west']\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:\neast is a direction\nHow many trains are there that run in the east direction?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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 cars (\n id integer, -- example: [1, 2]\n train_id integer, -- example: [1, 2]\n `position` integer, -- example: [1, 2]\n shape text, -- example: ['rectangle', 'bucket']\n len text, -- length, example: ['short', 'long']\n sides text, -- example: ['not_double', 'double']\n roof text, -- example: ['none', 'peaked']\n wheels integer, -- example: [2, 3]\n load_num integer, -- load number, example: [1, 3]\n PRIMARY KEY (id),\n CONSTRAINT fk_cars_train_id FOREIGN KEY (train_id) REFERENCES trains (id)\n);\n\nCREATE TABLE trains (\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:\ntrain no.1 refers to train_id = 1\nHow many cars are there on train no.1?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"role": "user"
}
] | nl2sql | {
"ground_truth": "SELECT COUNT(id) FROM cars WHERE train_id = 1",
"style": "rule"
} | {
"db_id": "trains.sqlite",
"gt_sql": "SELECT COUNT(id) FROM cars WHERE train_id = 1",
"index": 337,
"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 cars (\n id integer, -- example: [1, 2]\n train_id integer, -- example: [1, 2]\n `position` integer, -- example: [1, 2]\n shape text, -- example: ['rectangle', 'bucket']\n len text, -- length, example: ['short', 'long']\n sides text, -- example: ['not_double', 'double']\n roof text, -- example: ['none', 'peaked']\n wheels integer, -- example: [2, 3]\n load_num integer, -- load number, example: [1, 3]\n PRIMARY KEY (id),\n CONSTRAINT fk_cars_train_id FOREIGN KEY (train_id) REFERENCES trains (id)\n);\n\nCREATE TABLE trains (\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:\ntrain no.1 refers to train_id = 1\nHow many cars are there on train no.1?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"split": "train"
} |
nl2sql | [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE cars (\n id integer, -- example: [1, 2]\n train_id integer, -- example: [1, 2]\n `position` integer, -- example: [1, 2]\n shape text, -- example: ['rectangle', 'bucket']\n sides text, -- example: ['not_double', 'double']\n load_num integer, -- load number, example: [1, 3]\n PRIMARY KEY (id),\n CONSTRAINT fk_cars_train_id FOREIGN KEY (train_id) REFERENCES trains (id)\n);\n\nCREATE TABLE trains (\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:\ntrain no.1 refers to train_id = 1; tail car refers to position = 4\nWhat is the shape of the tail car on train no.1?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"role": "user"
}
] | nl2sql | {
"ground_truth": "SELECT shape FROM cars WHERE train_id = 1 AND position = 4",
"style": "rule"
} | {
"db_id": "trains.sqlite",
"gt_sql": "SELECT shape FROM cars WHERE train_id = 1 AND position = 4",
"index": 338,
"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 cars (\n id integer, -- example: [1, 2]\n train_id integer, -- example: [1, 2]\n `position` integer, -- example: [1, 2]\n shape text, -- example: ['rectangle', 'bucket']\n sides text, -- example: ['not_double', 'double']\n load_num integer, -- load number, example: [1, 3]\n PRIMARY KEY (id),\n CONSTRAINT fk_cars_train_id FOREIGN KEY (train_id) REFERENCES trains (id)\n);\n\nCREATE TABLE trains (\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:\ntrain no.1 refers to train_id = 1; tail car refers to position = 4\nWhat is the shape of the tail car on train no.1?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"split": "train"
} |
nl2sql | [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE cars (\n id integer, -- example: [1, 2]\n train_id integer, -- example: [1, 2]\n `position` integer, -- example: [1, 2]\n shape text, -- example: ['bucket', 'rectangle']\n len text, -- length, example: ['short', 'long']\n sides text, -- example: ['not_double', 'double']\n roof text, -- example: ['none', 'peaked']\n load_shape text, -- example: ['circle', 'hexagon']\n load_num integer, -- load number, example: [1, 3]\n PRIMARY KEY (id),\n CONSTRAINT fk_cars_train_id FOREIGN KEY (train_id) REFERENCES trains (id)\n);\n\nCREATE TABLE trains (\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:\nnon-regular shape refers to shape in ('elipse', 'bucket')\nPlease list the IDs of all the trains with at least one car in a non-regular shape.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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 train_id FROM cars WHERE shape IN ('elipse', 'bucket') GROUP BY train_id",
"style": "rule"
} | {
"db_id": "trains.sqlite",
"gt_sql": "SELECT train_id FROM cars WHERE shape IN ('elipse', 'bucket') GROUP BY train_id",
"index": 339,
"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 cars (\n id integer, -- example: [1, 2]\n train_id integer, -- example: [1, 2]\n `position` integer, -- example: [1, 2]\n shape text, -- example: ['bucket', 'rectangle']\n len text, -- length, example: ['short', 'long']\n sides text, -- example: ['not_double', 'double']\n roof text, -- example: ['none', 'peaked']\n load_shape text, -- example: ['circle', 'hexagon']\n load_num integer, -- load number, example: [1, 3]\n PRIMARY KEY (id),\n CONSTRAINT fk_cars_train_id FOREIGN KEY (train_id) REFERENCES trains (id)\n);\n\nCREATE TABLE trains (\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:\nnon-regular shape refers to shape in ('elipse', 'bucket')\nPlease list the IDs of all the trains with at least one car in a non-regular shape.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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 trains (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE cars (\n id integer, -- example: [1, 2]\n train_id integer, -- example: [1, 2]\n shape text, -- example: ['rectangle', 'bucket']\n roof text, -- example: ['none', 'peaked']\n wheels integer, -- example: [2, 3]\n load_shape text, -- example: ['circle', 'hexagon']\n load_num integer, -- load number, example: [1, 3]\n PRIMARY KEY (id),\n CONSTRAINT fk_cars_train_id FOREIGN KEY (train_id) REFERENCES trains (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\ntrain no. 1 refers to train_id = 1; roof open refers to roof = 'none'\nHow many cars on train no.1 have the roof open?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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(id) FROM cars WHERE train_id = 1 AND roof = 'none'",
"style": "rule"
} | {
"db_id": "trains.sqlite",
"gt_sql": "SELECT COUNT(id) FROM cars WHERE train_id = 1 AND roof = 'none'",
"index": 340,
"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 trains (\n id integer, -- example: [1, 2]\n PRIMARY KEY (id)\n);\n\nCREATE TABLE cars (\n id integer, -- example: [1, 2]\n train_id integer, -- example: [1, 2]\n shape text, -- example: ['rectangle', 'bucket']\n roof text, -- example: ['none', 'peaked']\n wheels integer, -- example: [2, 3]\n load_shape text, -- example: ['circle', 'hexagon']\n load_num integer, -- load number, example: [1, 3]\n PRIMARY KEY (id),\n CONSTRAINT fk_cars_train_id FOREIGN KEY (train_id) REFERENCES trains (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\ntrain no. 1 refers to train_id = 1; roof open refers to roof = 'none'\nHow many cars on train no.1 have the roof open?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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 cars (\n id integer, -- example: [1, 2]\n train_id integer, -- example: [1, 2]\n len text, -- length, example: ['long', 'short']\n roof text, -- example: ['none', 'peaked']\n load_shape text, -- example: ['circle', 'hexagon']\n PRIMARY KEY (id),\n CONSTRAINT fk_cars_train_id FOREIGN KEY (train_id) REFERENCES trains (id)\n);\n\nCREATE TABLE trains (\n id integer, -- example: [1, 2]\n direction text, -- example: ['east', 'west']\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:\nmore than 2 long cars refers to longCarsNum > 2\nAmong the trains that run in the east direction, how many of them have more than 2 long 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 SUM(CASE WHEN T2.longCarsNum > 2 THEN 1 ELSE 0 END)as count FROM trains AS T1 INNER JOIN ( SELECT train_id, COUNT(id) AS longCarsNum FROM cars WHERE len = 'long' GROUP BY train_id ) AS T2 ON T1.id = T2.train_id WHERE T1.direction = 'west'",
"style": "rule"
} | {
"db_id": "trains.sqlite",
"gt_sql": "SELECT SUM(CASE WHEN T2.longCarsNum > 2 THEN 1 ELSE 0 END)as count FROM trains AS T1 INNER JOIN ( SELECT train_id, COUNT(id) AS longCarsNum FROM cars WHERE len = 'long' GROUP BY train_id ) AS T2 ON T1.id = T2.train_id WHERE T1.direction = 'west'",
"index": 341,
"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 cars (\n id integer, -- example: [1, 2]\n train_id integer, -- example: [1, 2]\n len text, -- length, example: ['long', 'short']\n roof text, -- example: ['none', 'peaked']\n load_shape text, -- example: ['circle', 'hexagon']\n PRIMARY KEY (id),\n CONSTRAINT fk_cars_train_id FOREIGN KEY (train_id) REFERENCES trains (id)\n);\n\nCREATE TABLE trains (\n id integer, -- example: [1, 2]\n direction text, -- example: ['east', 'west']\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:\nmore than 2 long cars refers to longCarsNum > 2\nAmong the trains that run in the east direction, how many of them have more than 2 long 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 cars (\n id integer, -- example: [1, 2]\n train_id integer, -- example: [1, 2]\n roof text, -- example: ['none', 'peaked']\n wheels integer, -- example: [2, 3]\n load_shape text, -- example: ['circle', 'hexagon']\n load_num integer, -- load number, example: [1, 3]\n PRIMARY KEY (id),\n CONSTRAINT fk_cars_train_id FOREIGN KEY (train_id) REFERENCES trains (id)\n);\n\nCREATE TABLE trains (\n id integer, -- example: [1, 2]\n direction text, -- example: ['east', 'west']\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:\nat least one empty-loaded car run refers to load_num = 0\nPlease list the directions in which the trains with at least one empty-loaded car run.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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.direction FROM cars AS T1 INNER JOIN trains AS T2 ON T1.train_id = T2.id WHERE T1.load_num = 0",
"style": "rule"
} | {
"db_id": "trains.sqlite",
"gt_sql": "SELECT T2.direction FROM cars AS T1 INNER JOIN trains AS T2 ON T1.train_id = T2.id WHERE T1.load_num = 0",
"index": 342,
"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 cars (\n id integer, -- example: [1, 2]\n train_id integer, -- example: [1, 2]\n roof text, -- example: ['none', 'peaked']\n wheels integer, -- example: [2, 3]\n load_shape text, -- example: ['circle', 'hexagon']\n load_num integer, -- load number, example: [1, 3]\n PRIMARY KEY (id),\n CONSTRAINT fk_cars_train_id FOREIGN KEY (train_id) REFERENCES trains (id)\n);\n\nCREATE TABLE trains (\n id integer, -- example: [1, 2]\n direction text, -- example: ['east', 'west']\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:\nat least one empty-loaded car run refers to load_num = 0\nPlease list the directions in which the trains with at least one empty-loaded car run.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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 cars (\n id integer, -- example: [1, 2]\n train_id integer, -- example: [1, 2]\n `position` integer, -- example: [1, 2]\n shape text, -- example: ['ellipse', 'rectangle', 'bucket']\n sides text, -- example: ['not_double', 'double']\n roof text, -- example: ['none', 'peaked']\n wheels integer, -- example: [2, 3]\n load_shape text, -- example: ['circle', 'hexagon']\n load_num integer, -- load number, example: [1, 3]\n PRIMARY KEY (id),\n CONSTRAINT fk_cars_train_id FOREIGN KEY (train_id) REFERENCES trains (id)\n);\n\nCREATE TABLE trains (\n id integer, -- example: [1, 2]\n direction text, -- example: ['east', 'west']\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:\nshape = 'ellipse'\nIn which direction does the train with an ellipse-shape car run?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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.direction FROM cars AS T1 INNER JOIN trains AS T2 ON T1.train_id = T2.id WHERE T1.shape = 'ellipse'",
"style": "rule"
} | {
"db_id": "trains.sqlite",
"gt_sql": "SELECT T2.direction FROM cars AS T1 INNER JOIN trains AS T2 ON T1.train_id = T2.id WHERE T1.shape = 'ellipse'",
"index": 343,
"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 cars (\n id integer, -- example: [1, 2]\n train_id integer, -- example: [1, 2]\n `position` integer, -- example: [1, 2]\n shape text, -- example: ['ellipse', 'rectangle', 'bucket']\n sides text, -- example: ['not_double', 'double']\n roof text, -- example: ['none', 'peaked']\n wheels integer, -- example: [2, 3]\n load_shape text, -- example: ['circle', 'hexagon']\n load_num integer, -- load number, example: [1, 3]\n PRIMARY KEY (id),\n CONSTRAINT fk_cars_train_id FOREIGN KEY (train_id) REFERENCES trains (id)\n);\n\nCREATE TABLE trains (\n id integer, -- example: [1, 2]\n direction text, -- example: ['east', 'west']\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:\nshape = 'ellipse'\nIn which direction does the train with an ellipse-shape car run?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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 trains (\n id integer, -- example: [1, 2]\n direction text, -- example: ['east', 'west']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE cars (\n id integer, -- example: [1, 2]\n train_id integer, -- example: [1, 2]\n `position` integer, -- example: [1, 2]\n shape text, -- example: ['rectangle', 'bucket']\n len text, -- length, example: ['short', 'long']\n sides text, -- example: ['not_double', 'double']\n roof text, -- example: ['none', 'peaked']\n load_shape text, -- example: ['circle', 'hexagon']\n PRIMARY KEY (id),\n CONSTRAINT fk_cars_train_id FOREIGN KEY (train_id) REFERENCES trains (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nhead cars refers to position = 1;\nPlease list the shapes of all the head cars on the trains that run in the east direction.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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.shape FROM cars AS T1 INNER JOIN trains AS T2 ON T1.train_id = T2.id WHERE T2.direction = 'east' AND T1.position = 1 GROUP BY T1.shape",
"style": "rule"
} | {
"db_id": "trains.sqlite",
"gt_sql": "SELECT T1.shape FROM cars AS T1 INNER JOIN trains AS T2 ON T1.train_id = T2.id WHERE T2.direction = 'east' AND T1.position = 1 GROUP BY T1.shape",
"index": 344,
"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 trains (\n id integer, -- example: [1, 2]\n direction text, -- example: ['east', 'west']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE cars (\n id integer, -- example: [1, 2]\n train_id integer, -- example: [1, 2]\n `position` integer, -- example: [1, 2]\n shape text, -- example: ['rectangle', 'bucket']\n len text, -- length, example: ['short', 'long']\n sides text, -- example: ['not_double', 'double']\n roof text, -- example: ['none', 'peaked']\n load_shape text, -- example: ['circle', 'hexagon']\n PRIMARY KEY (id),\n CONSTRAINT fk_cars_train_id FOREIGN KEY (train_id) REFERENCES trains (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nhead cars refers to position = 1;\nPlease list the shapes of all the head cars on the trains that run in the east direction.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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 cars (\n id integer, -- example: [1, 2]\n train_id integer, -- example: [1, 2]\n `position` integer, -- example: [1, 2]\n len text, -- length, example: ['short', 'long']\n roof text, -- example: ['flat', 'none', 'peaked']\n wheels integer, -- example: [2, 3]\n load_shape text, -- example: ['circle', 'hexagon']\n load_num integer, -- load number, example: [1, 3]\n PRIMARY KEY (id),\n CONSTRAINT fk_cars_train_id FOREIGN KEY (train_id) REFERENCES trains (id)\n);\n\nCREATE TABLE trains (\n id integer, -- example: [1, 2]\n direction text, -- example: ['east', 'west']\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:\nflat roof refers to roof = 'flat'\nHow many cars on a train that runs in the east direction have a flat roof?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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 T1.roof = 'flat' THEN 1 ELSE 0 END)as count FROM cars AS T1 INNER JOIN trains AS T2 ON T1.train_id = T2.id WHERE T2.direction = 'east'",
"style": "rule"
} | {
"db_id": "trains.sqlite",
"gt_sql": "SELECT SUM(CASE WHEN T1.roof = 'flat' THEN 1 ELSE 0 END)as count FROM cars AS T1 INNER JOIN trains AS T2 ON T1.train_id = T2.id WHERE T2.direction = 'east'",
"index": 345,
"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 cars (\n id integer, -- example: [1, 2]\n train_id integer, -- example: [1, 2]\n `position` integer, -- example: [1, 2]\n len text, -- length, example: ['short', 'long']\n roof text, -- example: ['flat', 'none', 'peaked']\n wheels integer, -- example: [2, 3]\n load_shape text, -- example: ['circle', 'hexagon']\n load_num integer, -- load number, example: [1, 3]\n PRIMARY KEY (id),\n CONSTRAINT fk_cars_train_id FOREIGN KEY (train_id) REFERENCES trains (id)\n);\n\nCREATE TABLE trains (\n id integer, -- example: [1, 2]\n direction text, -- example: ['east', 'west']\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:\nflat roof refers to roof = 'flat'\nHow many cars on a train that runs in the east direction have a flat roof?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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 cars (\n id integer, -- example: [1, 2]\n train_id integer, -- example: [1, 2]\n `position` integer, -- example: [1, 2]\n shape text, -- example: ['rectangle', 'bucket']\n roof text, -- example: ['flat', 'none', 'peaked']\n load_shape text, -- example: ['circle', 'hexagon']\n load_num integer, -- load number, example: [1, 3]\n PRIMARY KEY (id),\n CONSTRAINT fk_cars_train_id FOREIGN KEY (train_id) REFERENCES trains (id)\n);\n\nCREATE TABLE trains (\n id integer, -- example: [1, 2]\n direction text, -- example: ['east', 'west']\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:\nflat roof refers to roof = 'flat'; load_shape = 'circle'\nAmong the cars on a train that runs in the east direction, how many of them have a flat roof and a circle load shape?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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 T1.load_shape = 'circle' THEN 1 ELSE 0 END)as count FROM cars AS T1 INNER JOIN trains AS T2 ON T1.train_id = T2.id WHERE T2.direction = 'east' AND T1.roof = 'flat' ",
"style": "rule"
} | {
"db_id": "trains.sqlite",
"gt_sql": "SELECT SUM(CASE WHEN T1.load_shape = 'circle' THEN 1 ELSE 0 END)as count FROM cars AS T1 INNER JOIN trains AS T2 ON T1.train_id = T2.id WHERE T2.direction = 'east' AND T1.roof = 'flat' ",
"index": 346,
"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 cars (\n id integer, -- example: [1, 2]\n train_id integer, -- example: [1, 2]\n `position` integer, -- example: [1, 2]\n shape text, -- example: ['rectangle', 'bucket']\n roof text, -- example: ['flat', 'none', 'peaked']\n load_shape text, -- example: ['circle', 'hexagon']\n load_num integer, -- load number, example: [1, 3]\n PRIMARY KEY (id),\n CONSTRAINT fk_cars_train_id FOREIGN KEY (train_id) REFERENCES trains (id)\n);\n\nCREATE TABLE trains (\n id integer, -- example: [1, 2]\n direction text, -- example: ['east', 'west']\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:\nflat roof refers to roof = 'flat'; load_shape = 'circle'\nAmong the cars on a train that runs in the east direction, how many of them have a flat roof and a circle load shape?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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 trains (\n id integer, -- example: [1, 2]\n direction text, -- example: ['east', 'west']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE cars (\n id integer, -- example: [1, 2]\n train_id integer, -- example: [1, 2]\n `position` integer, -- example: [1, 2]\n len text, -- length, example: ['short', 'long']\n sides text, -- example: ['not_double', 'double']\n roof text, -- example: ['none', 'peaked']\n wheels integer, -- example: [2, 3]\n PRIMARY KEY (id),\n CONSTRAINT fk_cars_train_id FOREIGN KEY (train_id) REFERENCES trains (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nshort refers to len = 'short'; 4 cars run refers to position = 4\nPlease list the directions in which the trains with 4 short cars run.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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.direction FROM cars AS T1 INNER JOIN trains AS T2 ON T1.train_id = T2.id WHERE T1.len = 'short' AND T1.position = 4",
"style": "rule"
} | {
"db_id": "trains.sqlite",
"gt_sql": "SELECT T2.direction FROM cars AS T1 INNER JOIN trains AS T2 ON T1.train_id = T2.id WHERE T1.len = 'short' AND T1.position = 4",
"index": 347,
"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 trains (\n id integer, -- example: [1, 2]\n direction text, -- example: ['east', 'west']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE cars (\n id integer, -- example: [1, 2]\n train_id integer, -- example: [1, 2]\n `position` integer, -- example: [1, 2]\n len text, -- length, example: ['short', 'long']\n sides text, -- example: ['not_double', 'double']\n roof text, -- example: ['none', 'peaked']\n wheels integer, -- example: [2, 3]\n PRIMARY KEY (id),\n CONSTRAINT fk_cars_train_id FOREIGN KEY (train_id) REFERENCES trains (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nshort refers to len = 'short'; 4 cars run refers to position = 4\nPlease list the directions in which the trains with 4 short cars run.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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 trains (\n id integer, -- example: [1, 2]\n direction text, -- example: ['east', 'west']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE cars (\n id integer, -- example: [1, 2]\n train_id integer, -- example: [1, 2]\n `position` integer, -- example: [1, 2]\n shape text, -- example: ['rectangle', 'bucket']\n len text, -- length, example: ['short', 'long']\n sides text, -- example: ['not_double', 'double']\n roof text, -- example: ['none', 'peaked']\n load_shape text, -- example: ['circle', 'hexagon']\n PRIMARY KEY (id),\n CONSTRAINT fk_cars_train_id FOREIGN KEY (train_id) REFERENCES trains (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\ncalculation = DIVIDE(count(id), count(train_id))\nWhat is the average number of cars on trains that run in the east direction?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"role": "user"
}
] | nl2sql | {
"ground_truth": "SELECT CAST(COUNT(T1.id) AS REAL) / COUNT(DISTINCT T1.train_id) FROM cars AS T1 INNER JOIN trains AS T2 ON T1.train_id = T2.id WHERE T2.direction = 'east'",
"style": "rule"
} | {
"db_id": "trains.sqlite",
"gt_sql": "SELECT CAST(COUNT(T1.id) AS REAL) / COUNT(DISTINCT T1.train_id) FROM cars AS T1 INNER JOIN trains AS T2 ON T1.train_id = T2.id WHERE T2.direction = 'east'",
"index": 348,
"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 trains (\n id integer, -- example: [1, 2]\n direction text, -- example: ['east', 'west']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE cars (\n id integer, -- example: [1, 2]\n train_id integer, -- example: [1, 2]\n `position` integer, -- example: [1, 2]\n shape text, -- example: ['rectangle', 'bucket']\n len text, -- length, example: ['short', 'long']\n sides text, -- example: ['not_double', 'double']\n roof text, -- example: ['none', 'peaked']\n load_shape text, -- example: ['circle', 'hexagon']\n PRIMARY KEY (id),\n CONSTRAINT fk_cars_train_id FOREIGN KEY (train_id) REFERENCES trains (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\ncalculation = DIVIDE(count(id), count(train_id))\nWhat is the average number of cars on trains that run in the east direction?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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 trains (\n id integer, -- example: [1, 2]\n direction text, -- example: ['east', 'west']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE cars (\n id integer, -- example: [1, 2]\n train_id integer, -- example: [1, 2]\n `position` integer, -- example: [1, 2]\n shape text, -- example: ['hexagon', 'rectangle', 'bucket']\n len text, -- length, example: ['short', 'long']\n sides text, -- example: ['not_double', 'double']\n roof text, -- example: ['none', 'peaked']\n load_shape text, -- example: ['hexagon', 'circle']\n load_num integer, -- load number, example: [1, 3]\n PRIMARY KEY (id),\n CONSTRAINT fk_cars_train_id FOREIGN KEY (train_id) REFERENCES trains (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nshort cars refers to len = 'short'; in the shape of hexagon refers to shape = 'hexagon'\nHow many short cars are in the shape of hexagon?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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(id) FROM cars WHERE shape = 'hexagon' AND len = 'short'",
"style": "rule"
} | {
"db_id": "trains.sqlite",
"gt_sql": "SELECT COUNT(id) FROM cars WHERE shape = 'hexagon' AND len = 'short'",
"index": 349,
"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 trains (\n id integer, -- example: [1, 2]\n direction text, -- example: ['east', 'west']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE cars (\n id integer, -- example: [1, 2]\n train_id integer, -- example: [1, 2]\n `position` integer, -- example: [1, 2]\n shape text, -- example: ['hexagon', 'rectangle', 'bucket']\n len text, -- length, example: ['short', 'long']\n sides text, -- example: ['not_double', 'double']\n roof text, -- example: ['none', 'peaked']\n load_shape text, -- example: ['hexagon', 'circle']\n load_num integer, -- load number, example: [1, 3]\n PRIMARY KEY (id),\n CONSTRAINT fk_cars_train_id FOREIGN KEY (train_id) REFERENCES trains (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nshort cars refers to len = 'short'; in the shape of hexagon refers to shape = 'hexagon'\nHow many short cars are in the shape of hexagon?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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 cars (\n id integer, -- example: [1, 2]\n train_id integer, -- example: [1, 2]\n shape text, -- example: ['rectangle', 'bucket']\n len text, -- length, example: ['short', 'long']\n load_num integer, -- load number, example: [1, 3]\n PRIMARY KEY (id),\n CONSTRAINT fk_cars_train_id FOREIGN KEY (train_id) REFERENCES trains (id)\n);\n\nCREATE TABLE trains (\n id integer, -- example: [1, 2]\n direction text, -- example: ['west', 'east']\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:\nwest is a direction\nHow many trains are running west?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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(id) FROM trains WHERE direction = 'west'",
"style": "rule"
} | {
"db_id": "trains.sqlite",
"gt_sql": "SELECT COUNT(id) FROM trains WHERE direction = 'west'",
"index": 350,
"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 cars (\n id integer, -- example: [1, 2]\n train_id integer, -- example: [1, 2]\n shape text, -- example: ['rectangle', 'bucket']\n len text, -- length, example: ['short', 'long']\n load_num integer, -- load number, example: [1, 3]\n PRIMARY KEY (id),\n CONSTRAINT fk_cars_train_id FOREIGN KEY (train_id) REFERENCES trains (id)\n);\n\nCREATE TABLE trains (\n id integer, -- example: [1, 2]\n direction text, -- example: ['west', 'east']\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:\nwest is a direction\nHow many trains are running west?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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 cars (\n id integer, -- example: [1, 2]\n train_id integer, -- example: [1, 2]\n `position` integer, -- example: [1, 2]\n shape text, -- example: ['ellipse', 'rectangle', 'bucket']\n len text, -- length, example: ['short', 'long']\n sides text, -- example: ['not_double', 'double']\n wheels integer, -- example: [2, 3]\n load_shape text, -- example: ['circle', 'hexagon']\n load_num integer, -- load number, example: [1, 3]\n PRIMARY KEY (id),\n CONSTRAINT fk_cars_train_id FOREIGN KEY (train_id) REFERENCES trains (id)\n);\n\nCREATE TABLE trains (\n id integer, -- example: [1, 2]\n direction text, -- example: ['east', 'west']\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:\nshort refers to len = 'short'; ellipse cars refers to shape = 'ellipse'\nWhat are the load shapes of all the short ellipse 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 load_shape FROM cars WHERE shape = 'ellipse' AND len = 'short'",
"style": "rule"
} | {
"db_id": "trains.sqlite",
"gt_sql": "SELECT load_shape FROM cars WHERE shape = 'ellipse' AND len = 'short'",
"index": 351,
"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 cars (\n id integer, -- example: [1, 2]\n train_id integer, -- example: [1, 2]\n `position` integer, -- example: [1, 2]\n shape text, -- example: ['ellipse', 'rectangle', 'bucket']\n len text, -- length, example: ['short', 'long']\n sides text, -- example: ['not_double', 'double']\n wheels integer, -- example: [2, 3]\n load_shape text, -- example: ['circle', 'hexagon']\n load_num integer, -- load number, example: [1, 3]\n PRIMARY KEY (id),\n CONSTRAINT fk_cars_train_id FOREIGN KEY (train_id) REFERENCES trains (id)\n);\n\nCREATE TABLE trains (\n id integer, -- example: [1, 2]\n direction text, -- example: ['east', 'west']\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:\nshort refers to len = 'short'; ellipse cars refers to shape = 'ellipse'\nWhat are the load shapes of all the short ellipse 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 cars (\n id integer, -- example: [1, 2]\n train_id integer, -- example: [1, 2]\n `position` integer, -- example: [1, 2]\n len text, -- length, example: ['short', 'long']\n roof text, -- example: ['none', 'peaked']\n PRIMARY KEY (id),\n CONSTRAINT fk_cars_train_id FOREIGN KEY (train_id) REFERENCES trains (id)\n);\n\nCREATE TABLE trains (\n id integer, -- example: [1, 2]\n direction text, -- example: ['east', 'west']\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:\neast is a direction\nWhat are the ids of the train running east?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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 id FROM trains WHERE direction = 'east'",
"style": "rule"
} | {
"db_id": "trains.sqlite",
"gt_sql": "SELECT id FROM trains WHERE direction = 'east'",
"index": 352,
"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 cars (\n id integer, -- example: [1, 2]\n train_id integer, -- example: [1, 2]\n `position` integer, -- example: [1, 2]\n len text, -- length, example: ['short', 'long']\n roof text, -- example: ['none', 'peaked']\n PRIMARY KEY (id),\n CONSTRAINT fk_cars_train_id FOREIGN KEY (train_id) REFERENCES trains (id)\n);\n\nCREATE TABLE trains (\n id integer, -- example: [1, 2]\n direction text, -- example: ['east', 'west']\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:\neast is a direction\nWhat are the ids of the train running east?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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 cars (\n id integer, -- example: [1, 2]\n train_id integer, -- example: [1, 2]\n len text, -- length, example: ['long', 'short']\n sides text, -- example: ['not_double', 'double']\n wheels integer, -- example: [2, 3]\n PRIMARY KEY (id),\n CONSTRAINT fk_cars_train_id FOREIGN KEY (train_id) REFERENCES trains (id)\n);\n\nCREATE TABLE trains (\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:\nlong cars refers to len = 'long'\nHow many wheels do the long cars have?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"role": "user"
}
] | nl2sql | {
"ground_truth": "SELECT SUM(wheels) FROM cars WHERE len = 'long'",
"style": "rule"
} | {
"db_id": "trains.sqlite",
"gt_sql": "SELECT SUM(wheels) FROM cars WHERE len = 'long'",
"index": 353,
"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 cars (\n id integer, -- example: [1, 2]\n train_id integer, -- example: [1, 2]\n len text, -- length, example: ['long', 'short']\n sides text, -- example: ['not_double', 'double']\n wheels integer, -- example: [2, 3]\n PRIMARY KEY (id),\n CONSTRAINT fk_cars_train_id FOREIGN KEY (train_id) REFERENCES trains (id)\n);\n\nCREATE TABLE trains (\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:\nlong cars refers to len = 'long'\nHow many wheels do the long cars have?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"split": "train"
} |
nl2sql | [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "Task Overview:\nYou are a data science expert. Below, you are provided with a database schema and a natural language question. Your task is to understand the schema and generate a valid SQL query to answer the question.\n\nDatabase Engine:\nSQLite\n\nDatabase Schema:\nCREATE TABLE trains (\n id integer, -- example: [1, 2]\n direction text, -- example: ['east', 'west']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE cars (\n id integer, -- example: [1, 2]\n train_id integer, -- example: [1, 2]\n `position` integer, -- example: [1, 2]\n shape text, -- example: ['rectangle', 'bucket']\n len text, -- length, example: ['short', 'long']\n roof text, -- example: ['none', 'peaked']\n wheels integer, -- example: [2, 3]\n load_shape text, -- example: ['circle', 'hexagon']\n load_num integer, -- load number, example: [1, 3]\n PRIMARY KEY (id),\n CONSTRAINT fk_cars_train_id FOREIGN KEY (train_id) REFERENCES trains (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\neast is a direction; at least 4 cars refers to carsNum > = 4\nAmong the trains running east, how many trains have at least 4 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 SUM(CASE WHEN T1.direction = 'east' THEN 1 ELSE 0 END)as count FROM trains AS T1 INNER JOIN ( SELECT train_id, COUNT(id) AS carsNum FROM cars GROUP BY train_id ) AS T2 ON T1.id = T2.train_id WHERE T2.carsNum >= 4",
"style": "rule"
} | {
"db_id": "trains.sqlite",
"gt_sql": "SELECT SUM(CASE WHEN T1.direction = 'east' THEN 1 ELSE 0 END)as count FROM trains AS T1 INNER JOIN ( SELECT train_id, COUNT(id) AS carsNum FROM cars GROUP BY train_id ) AS T2 ON T1.id = T2.train_id WHERE T2.carsNum >= 4",
"index": 354,
"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 trains (\n id integer, -- example: [1, 2]\n direction text, -- example: ['east', 'west']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE cars (\n id integer, -- example: [1, 2]\n train_id integer, -- example: [1, 2]\n `position` integer, -- example: [1, 2]\n shape text, -- example: ['rectangle', 'bucket']\n len text, -- length, example: ['short', 'long']\n roof text, -- example: ['none', 'peaked']\n wheels integer, -- example: [2, 3]\n load_shape text, -- example: ['circle', 'hexagon']\n load_num integer, -- load number, example: [1, 3]\n PRIMARY KEY (id),\n CONSTRAINT fk_cars_train_id FOREIGN KEY (train_id) REFERENCES trains (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\neast is a direction; at least 4 cars refers to carsNum > = 4\nAmong the trains running east, how many trains have at least 4 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 cars (\n id integer, -- example: [1, 2]\n train_id integer, -- example: [1, 2]\n `position` integer, -- example: [1, 2]\n shape text, -- example: ['rectangle', 'bucket']\n roof text, -- example: ['none', 'peaked']\n wheels integer, -- example: [2, 3]\n load_shape text, -- example: ['rectangle', 'circle', 'hexagon']\n PRIMARY KEY (id),\n CONSTRAINT fk_cars_train_id FOREIGN KEY (train_id) REFERENCES trains (id)\n);\n\nCREATE TABLE trains (\n id integer, -- example: [1, 2]\n direction text, -- example: ['east', 'west']\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:\nmost of the trains refers to MAX(count(id)); second cars refers to position = 2\nWhich direction do most of the trains with rectangle-shaped second cars run?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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.direction FROM cars AS T1 INNER JOIN trains AS T2 ON T1.train_id = T2.id WHERE T1.position = 2 AND T1.shape = 'rectangle' GROUP BY T2.direction ORDER BY COUNT(T2.id) DESC LIMIT 1",
"style": "rule"
} | {
"db_id": "trains.sqlite",
"gt_sql": "SELECT T2.direction FROM cars AS T1 INNER JOIN trains AS T2 ON T1.train_id = T2.id WHERE T1.position = 2 AND T1.shape = 'rectangle' GROUP BY T2.direction ORDER BY COUNT(T2.id) DESC LIMIT 1",
"index": 355,
"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 cars (\n id integer, -- example: [1, 2]\n train_id integer, -- example: [1, 2]\n `position` integer, -- example: [1, 2]\n shape text, -- example: ['rectangle', 'bucket']\n roof text, -- example: ['none', 'peaked']\n wheels integer, -- example: [2, 3]\n load_shape text, -- example: ['rectangle', 'circle', 'hexagon']\n PRIMARY KEY (id),\n CONSTRAINT fk_cars_train_id FOREIGN KEY (train_id) REFERENCES trains (id)\n);\n\nCREATE TABLE trains (\n id integer, -- example: [1, 2]\n direction text, -- example: ['east', 'west']\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:\nmost of the trains refers to MAX(count(id)); second cars refers to position = 2\nWhich direction do most of the trains with rectangle-shaped second cars run?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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 trains (\n id integer, -- example: [1, 2]\n direction text, -- example: ['west', 'east']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE cars (\n id integer, -- example: [1, 2]\n train_id integer, -- example: [1, 2]\n `position` integer, -- example: [1, 2]\n len text, -- length, example: ['short', 'long']\n sides text, -- example: ['double', 'not_double']\n roof text, -- example: ['none', 'peaked']\n wheels integer, -- example: [2, 3]\n load_shape text, -- example: ['circle', 'hexagon']\n PRIMARY KEY (id),\n CONSTRAINT fk_cars_train_id FOREIGN KEY (train_id) REFERENCES trains (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nwest is a direction; double sided cars refers to sides = 'double'; 3rd position refers to position = 3\nHow many trains running west have double sided cars in 3rd position?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"role": "user"
}
] | nl2sql | {
"ground_truth": "SELECT COUNT(T.train_id) FROM (SELECT T1.train_id FROM cars AS T1 INNER JOIN trains AS T2 ON T1.train_id = T2.id WHERE T1.position = 3 AND T2.direction = 'west' AND T1.sides = 'double' GROUP BY T1.train_id)as T",
"style": "rule"
} | {
"db_id": "trains.sqlite",
"gt_sql": "SELECT COUNT(T.train_id) FROM (SELECT T1.train_id FROM cars AS T1 INNER JOIN trains AS T2 ON T1.train_id = T2.id WHERE T1.position = 3 AND T2.direction = 'west' AND T1.sides = 'double' GROUP BY T1.train_id)as T",
"index": 356,
"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 trains (\n id integer, -- example: [1, 2]\n direction text, -- example: ['west', 'east']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE cars (\n id integer, -- example: [1, 2]\n train_id integer, -- example: [1, 2]\n `position` integer, -- example: [1, 2]\n len text, -- length, example: ['short', 'long']\n sides text, -- example: ['double', 'not_double']\n roof text, -- example: ['none', 'peaked']\n wheels integer, -- example: [2, 3]\n load_shape text, -- example: ['circle', 'hexagon']\n PRIMARY KEY (id),\n CONSTRAINT fk_cars_train_id FOREIGN KEY (train_id) REFERENCES trains (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nwest is a direction; double sided cars refers to sides = 'double'; 3rd position refers to position = 3\nHow many trains running west have double sided cars in 3rd position?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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 cars (\n id integer, -- example: [1, 2]\n train_id integer, -- example: [1, 2]\n `position` integer, -- example: [1, 2]\n shape text, -- example: ['rectangle', 'bucket']\n sides text, -- example: ['not_double', 'double']\n wheels integer, -- example: [2, 3]\n PRIMARY KEY (id),\n CONSTRAINT fk_cars_train_id FOREIGN KEY (train_id) REFERENCES trains (id)\n);\n\nCREATE TABLE trains (\n id integer, -- example: [1, 2]\n direction text, -- example: ['east', 'west']\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:\neastbound refers to direction = 'east'; head cars refers to position = 1\nHow many eastbound trains have rectangular-shaped head 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 COUNT(T.train_id) FROM (SELECT T1.train_id FROM cars AS T1 INNER JOIN trains AS T2 ON T1.train_id = T2.id WHERE T1.position = 1 AND T2.direction = 'east' AND T1.shape = 'rectangle' GROUP BY T1.train_id)as T",
"style": "rule"
} | {
"db_id": "trains.sqlite",
"gt_sql": "SELECT COUNT(T.train_id) FROM (SELECT T1.train_id FROM cars AS T1 INNER JOIN trains AS T2 ON T1.train_id = T2.id WHERE T1.position = 1 AND T2.direction = 'east' AND T1.shape = 'rectangle' GROUP BY T1.train_id)as T",
"index": 357,
"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 cars (\n id integer, -- example: [1, 2]\n train_id integer, -- example: [1, 2]\n `position` integer, -- example: [1, 2]\n shape text, -- example: ['rectangle', 'bucket']\n sides text, -- example: ['not_double', 'double']\n wheels integer, -- example: [2, 3]\n PRIMARY KEY (id),\n CONSTRAINT fk_cars_train_id FOREIGN KEY (train_id) REFERENCES trains (id)\n);\n\nCREATE TABLE trains (\n id integer, -- example: [1, 2]\n direction text, -- example: ['east', 'west']\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:\neastbound refers to direction = 'east'; head cars refers to position = 1\nHow many eastbound trains have rectangular-shaped head 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 cars (\n id integer, -- example: [1, 2]\n train_id integer, -- example: [1, 2]\n PRIMARY KEY (id),\n CONSTRAINT fk_cars_train_id FOREIGN KEY (train_id) REFERENCES trains (id)\n);\n\nCREATE TABLE trains (\n id integer, -- example: [1, 2]\n direction text, -- example: ['east', 'west']\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:\n3 cars refers to carsNum = 3\nWhich direction does the majority of the trains that have 3 cars are running?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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.direction FROM trains AS T1 INNER JOIN ( SELECT train_id, COUNT(id) AS carsNum FROM cars GROUP BY train_id HAVING carsNum = 3 ) AS T2 ON T1.id = T2.train_id GROUP BY T1.direction",
"style": "rule"
} | {
"db_id": "trains.sqlite",
"gt_sql": "SELECT T1.direction FROM trains AS T1 INNER JOIN ( SELECT train_id, COUNT(id) AS carsNum FROM cars GROUP BY train_id HAVING carsNum = 3 ) AS T2 ON T1.id = T2.train_id GROUP BY T1.direction",
"index": 358,
"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 cars (\n id integer, -- example: [1, 2]\n train_id integer, -- example: [1, 2]\n PRIMARY KEY (id),\n CONSTRAINT fk_cars_train_id FOREIGN KEY (train_id) REFERENCES trains (id)\n);\n\nCREATE TABLE trains (\n id integer, -- example: [1, 2]\n direction text, -- example: ['east', 'west']\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:\n3 cars refers to carsNum = 3\nWhich direction does the majority of the trains that have 3 cars are running?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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 cars (\n id integer, -- example: [1, 2]\n train_id integer, -- example: [1, 2]\n `position` integer, -- example: [1, 2]\n shape text, -- example: ['rectangle', 'bucket']\n len text, -- length, example: ['short', 'long']\n sides text, -- example: ['not_double', 'double']\n wheels integer, -- example: [2, 3]\n load_num integer, -- load number, example: [1, 3]\n PRIMARY KEY (id),\n CONSTRAINT fk_cars_train_id FOREIGN KEY (train_id) REFERENCES trains (id)\n);\n\nCREATE TABLE trains (\n id integer, -- example: [1, 2]\n direction text, -- example: ['east', 'west']\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:\nfully loaded refers to load_num = 3; head cars refers to position = 1\nHow many trains with fully loaded head cars are running east?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"role": "user"
}
] | nl2sql | {
"ground_truth": "SELECT COUNT(DISTINCT T1.train_id) FROM cars AS T1 INNER JOIN trains AS T2 ON T1.train_id = T2.id WHERE T1.position = 1 AND T1.load_num = 3",
"style": "rule"
} | {
"db_id": "trains.sqlite",
"gt_sql": "SELECT COUNT(DISTINCT T1.train_id) FROM cars AS T1 INNER JOIN trains AS T2 ON T1.train_id = T2.id WHERE T1.position = 1 AND T1.load_num = 3",
"index": 359,
"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 cars (\n id integer, -- example: [1, 2]\n train_id integer, -- example: [1, 2]\n `position` integer, -- example: [1, 2]\n shape text, -- example: ['rectangle', 'bucket']\n len text, -- length, example: ['short', 'long']\n sides text, -- example: ['not_double', 'double']\n wheels integer, -- example: [2, 3]\n load_num integer, -- load number, example: [1, 3]\n PRIMARY KEY (id),\n CONSTRAINT fk_cars_train_id FOREIGN KEY (train_id) REFERENCES trains (id)\n);\n\nCREATE TABLE trains (\n id integer, -- example: [1, 2]\n direction text, -- example: ['east', 'west']\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:\nfully loaded refers to load_num = 3; head cars refers to position = 1\nHow many trains with fully loaded head cars are running east?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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 cars (\n id integer, -- example: [1, 2]\n train_id integer, -- example: [1, 2]\n `position` integer, -- example: [1, 2]\n shape text, -- example: ['rectangle', 'bucket']\n len text, -- length, example: ['short', 'long']\n sides text, -- example: ['not_double', 'double']\n roof text, -- example: ['none', 'peaked']\n wheels integer, -- example: [2, 3]\n load_shape text, -- example: ['diamond', 'circle', 'hexagon']\n load_num integer, -- load number, example: [1, 3]\n PRIMARY KEY (id),\n CONSTRAINT fk_cars_train_id FOREIGN KEY (train_id) REFERENCES trains (id)\n);\n\nCREATE TABLE trains (\n id integer, -- example: [1, 2]\n direction text, -- example: ['east', 'west']\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:\n2nd car refers to position = 2\nWhat is the direction of the train with a diamond-shaped load in its 2nd 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 T2.direction FROM cars AS T1 INNER JOIN trains AS T2 ON T1.train_id = T2.id WHERE T1.position = 2 AND T1.shape = 'diamond'",
"style": "rule"
} | {
"db_id": "trains.sqlite",
"gt_sql": "SELECT T2.direction FROM cars AS T1 INNER JOIN trains AS T2 ON T1.train_id = T2.id WHERE T1.position = 2 AND T1.shape = 'diamond'",
"index": 360,
"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 cars (\n id integer, -- example: [1, 2]\n train_id integer, -- example: [1, 2]\n `position` integer, -- example: [1, 2]\n shape text, -- example: ['rectangle', 'bucket']\n len text, -- length, example: ['short', 'long']\n sides text, -- example: ['not_double', 'double']\n roof text, -- example: ['none', 'peaked']\n wheels integer, -- example: [2, 3]\n load_shape text, -- example: ['diamond', 'circle', 'hexagon']\n load_num integer, -- load number, example: [1, 3]\n PRIMARY KEY (id),\n CONSTRAINT fk_cars_train_id FOREIGN KEY (train_id) REFERENCES trains (id)\n);\n\nCREATE TABLE trains (\n id integer, -- example: [1, 2]\n direction text, -- example: ['east', 'west']\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:\n2nd car refers to position = 2\nWhat is the direction of the train with a diamond-shaped load in its 2nd 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 trains (\n id integer, -- example: [1, 2]\n direction text, -- example: ['west', 'east']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE cars (\n id integer, -- example: [1, 2]\n train_id integer, -- example: [1, 2]\n `position` integer, -- example: [1, 2]\n shape text, -- example: ['rectangle', 'bucket']\n len text, -- length, example: ['short', 'long']\n sides text, -- example: ['not_double', 'double']\n roof text, -- example: ['jagged', 'none', 'peaked']\n wheels integer, -- example: [2, 3]\n load_shape text, -- example: ['circle', 'hexagon']\n PRIMARY KEY (id),\n CONSTRAINT fk_cars_train_id FOREIGN KEY (train_id) REFERENCES trains (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nwest is an direction; three-wheeled refers to wheels = 3; jagged roof refers to roof = 'jagged'\nAmong the trains running west, how many trains have three-wheeled, jagged roof 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 SUM(CASE WHEN T2.direction = 'west' THEN 1 ELSE 0 END)as count FROM cars AS T1 INNER JOIN trains AS T2 ON T1.train_id = T2.id WHERE T1.wheels = 3 AND T1.roof = 'jagged'",
"style": "rule"
} | {
"db_id": "trains.sqlite",
"gt_sql": "SELECT SUM(CASE WHEN T2.direction = 'west' THEN 1 ELSE 0 END)as count FROM cars AS T1 INNER JOIN trains AS T2 ON T1.train_id = T2.id WHERE T1.wheels = 3 AND T1.roof = 'jagged'",
"index": 361,
"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 trains (\n id integer, -- example: [1, 2]\n direction text, -- example: ['west', 'east']\n PRIMARY KEY (id)\n);\n\nCREATE TABLE cars (\n id integer, -- example: [1, 2]\n train_id integer, -- example: [1, 2]\n `position` integer, -- example: [1, 2]\n shape text, -- example: ['rectangle', 'bucket']\n len text, -- length, example: ['short', 'long']\n sides text, -- example: ['not_double', 'double']\n roof text, -- example: ['jagged', 'none', 'peaked']\n wheels integer, -- example: [2, 3]\n load_shape text, -- example: ['circle', 'hexagon']\n PRIMARY KEY (id),\n CONSTRAINT fk_cars_train_id FOREIGN KEY (train_id) REFERENCES trains (id)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nwest is an direction; three-wheeled refers to wheels = 3; jagged roof refers to roof = 'jagged'\nAmong the trains running west, how many trains have three-wheeled, jagged roof 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 movie (\n MovieID integer, -- example: [1, 2]\n Title text, -- example: [\"Look Who's Talking\", 'Driving Miss Daisy']\n `MPAA Rating` text, -- motion picture association of america rating, example: ['PG-13', 'PG']\n Budget integer, -- example: [7500000, 13000000]\n Gross integer, -- example: [296000000, 145793296]\n Genre text, -- example: ['Romance', 'Comedy']\n Runtime integer, -- example: [93, 99]\n Rating real, -- example: [5.9, 7.4]\n Summary text, -- example: ['After a single, career-minded woman is l', 'An old Jewish woman and her African-Amer']\n PRIMARY KEY (MovieID)\n);\n\nCREATE TABLE actor (\n ActorID integer, -- example: [1, 2]\n Name text, -- example: ['John Travolta', 'Kirstie Alley']\n `Date of Birth` date, -- example: ['1954-02-18', '1951-01-12']\n `Birth City` text, -- example: ['Englewood', 'Wichita']\n `Birth Country` text, -- example: ['USA', 'West Germany']\n `Height (Inches)` integer, -- height inches, example: [74, 67]\n Biography text, -- example: ['John Joseph Travolta was born in Englewo', 'Long a vital, respected lady of the clas']\n Gender text, -- example: ['Male', 'Female']\n Ethnicity text, -- example: ['White', 'African American']\n NetWorth text, -- example: ['$250,000,000.00', '$40,000,000.00']\n PRIMARY KEY (ActorID)\n);\n\nCREATE TABLE characters (\n MovieID integer, -- example: [1, 2]\n ActorID integer, -- example: [1, 2]\n `Character Name` text, -- example: ['James', 'Mollie']\n creditOrder integer, -- example: [1, 2]\n pay text, -- example: ['$5,000,000.00', '$60,000,000.00']\n screentime text, -- example: ['0:32:30', '0:32:15']\n PRIMARY KEY (MovieID, ActorID),\n CONSTRAINT fk_characters_movieid FOREIGN KEY (MovieID) REFERENCES movie (MovieID),\n CONSTRAINT fk_characters_actorid FOREIGN KEY (ActorID) REFERENCES actor (ActorID)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nmovie Look Who's Talking refers to title = 'Look Who's Talking'\nPlease list the names of the characters in the movie Look Who's Talking.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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 Name` FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID WHERE T1.Title = 'Look Who''s Talking'",
"style": "rule"
} | {
"db_id": "movie.sqlite",
"gt_sql": "SELECT T2.`Character Name` FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID WHERE T1.Title = 'Look Who''s Talking'",
"index": 362,
"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 movie (\n MovieID integer, -- example: [1, 2]\n Title text, -- example: [\"Look Who's Talking\", 'Driving Miss Daisy']\n `MPAA Rating` text, -- motion picture association of america rating, example: ['PG-13', 'PG']\n Budget integer, -- example: [7500000, 13000000]\n Gross integer, -- example: [296000000, 145793296]\n Genre text, -- example: ['Romance', 'Comedy']\n Runtime integer, -- example: [93, 99]\n Rating real, -- example: [5.9, 7.4]\n Summary text, -- example: ['After a single, career-minded woman is l', 'An old Jewish woman and her African-Amer']\n PRIMARY KEY (MovieID)\n);\n\nCREATE TABLE actor (\n ActorID integer, -- example: [1, 2]\n Name text, -- example: ['John Travolta', 'Kirstie Alley']\n `Date of Birth` date, -- example: ['1954-02-18', '1951-01-12']\n `Birth City` text, -- example: ['Englewood', 'Wichita']\n `Birth Country` text, -- example: ['USA', 'West Germany']\n `Height (Inches)` integer, -- height inches, example: [74, 67]\n Biography text, -- example: ['John Joseph Travolta was born in Englewo', 'Long a vital, respected lady of the clas']\n Gender text, -- example: ['Male', 'Female']\n Ethnicity text, -- example: ['White', 'African American']\n NetWorth text, -- example: ['$250,000,000.00', '$40,000,000.00']\n PRIMARY KEY (ActorID)\n);\n\nCREATE TABLE characters (\n MovieID integer, -- example: [1, 2]\n ActorID integer, -- example: [1, 2]\n `Character Name` text, -- example: ['James', 'Mollie']\n creditOrder integer, -- example: [1, 2]\n pay text, -- example: ['$5,000,000.00', '$60,000,000.00']\n screentime text, -- example: ['0:32:30', '0:32:15']\n PRIMARY KEY (MovieID, ActorID),\n CONSTRAINT fk_characters_movieid FOREIGN KEY (MovieID) REFERENCES movie (MovieID),\n CONSTRAINT fk_characters_actorid FOREIGN KEY (ActorID) REFERENCES actor (ActorID)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nmovie Look Who's Talking refers to title = 'Look Who's Talking'\nPlease list the names of the characters in the movie Look Who's Talking.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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 characters (\n MovieID integer, -- example: [1, 2]\n ActorID integer, -- example: [1, 2]\n PRIMARY KEY (MovieID, ActorID),\n CONSTRAINT fk_characters_movieid FOREIGN KEY (MovieID) REFERENCES movie (MovieID),\n CONSTRAINT fk_characters_actorid FOREIGN KEY (ActorID) REFERENCES actor (ActorID)\n);\n\nCREATE TABLE movie (\n MovieID integer, -- example: [1, 2]\n `MPAA Rating` text, -- motion picture association of america rating, example: ['PG', 'PG-13']\n Budget integer, -- example: [7500000, 13000000]\n Gross integer, -- example: [296000000, 145793296]\n Rating real, -- example: [5.9, 7.4]\n PRIMARY KEY (MovieID)\n);\n\nCREATE TABLE actor (\n ActorID integer, -- example: [1, 2]\n Name text, -- example: ['Morgan Freeman', 'John Travolta', 'Kirstie Alley']\n PRIMARY KEY (ActorID)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\n'suggested by parental guidance' refers to mpaa_rating = 'PG'\nHow many movies starring Morgan Freeman are suggested by parental guidance?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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 movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID INNER JOIN actor AS T3 ON T3.ActorID = T2.ActorID WHERE T3.Name = 'Morgan Freeman' AND T1.`MPAA Rating` = 'PG'",
"style": "rule"
} | {
"db_id": "movie.sqlite",
"gt_sql": "SELECT COUNT(*) FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID INNER JOIN actor AS T3 ON T3.ActorID = T2.ActorID WHERE T3.Name = 'Morgan Freeman' AND T1.`MPAA Rating` = 'PG'",
"index": 363,
"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 MovieID integer, -- example: [1, 2]\n ActorID integer, -- example: [1, 2]\n PRIMARY KEY (MovieID, ActorID),\n CONSTRAINT fk_characters_movieid FOREIGN KEY (MovieID) REFERENCES movie (MovieID),\n CONSTRAINT fk_characters_actorid FOREIGN KEY (ActorID) REFERENCES actor (ActorID)\n);\n\nCREATE TABLE movie (\n MovieID integer, -- example: [1, 2]\n `MPAA Rating` text, -- motion picture association of america rating, example: ['PG', 'PG-13']\n Budget integer, -- example: [7500000, 13000000]\n Gross integer, -- example: [296000000, 145793296]\n Rating real, -- example: [5.9, 7.4]\n PRIMARY KEY (MovieID)\n);\n\nCREATE TABLE actor (\n ActorID integer, -- example: [1, 2]\n Name text, -- example: ['Morgan Freeman', 'John Travolta', 'Kirstie Alley']\n PRIMARY KEY (ActorID)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\n'suggested by parental guidance' refers to mpaa_rating = 'PG'\nHow many movies starring Morgan Freeman are suggested by parental guidance?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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 actor (\n ActorID integer, -- example: [1, 2]\n Name text, -- example: ['Tom Cruise', 'John Travolta', 'Kirstie Alley']\n `Date of Birth` date, -- example: ['1954-02-18', '1951-01-12']\n `Height (Inches)` integer, -- height inches, example: [74, 67]\n Gender text, -- example: ['Male', 'Female']\n Ethnicity text, -- example: ['White', 'African American']\n NetWorth text, -- example: ['$250,000,000.00', '$40,000,000.00']\n PRIMARY KEY (ActorID)\n);\n\nCREATE TABLE characters (\n MovieID integer, -- example: [1, 2]\n ActorID integer, -- example: [1, 2]\n `Character Name` text, -- example: ['Tom', 'James', 'Mollie']\n pay text, -- example: ['$5,000,000.00', '$60,000,000.00']\n PRIMARY KEY (MovieID, ActorID),\n CONSTRAINT fk_characters_movieid FOREIGN KEY (MovieID) REFERENCES movie (MovieID),\n CONSTRAINT fk_characters_actorid FOREIGN KEY (ActorID) REFERENCES actor (ActorID)\n);\n\nCREATE TABLE movie (\n MovieID integer, -- example: [1, 2]\n Title text, -- example: ['Born on the Fourth of July', \"Look Who's Talking\", 'Driving Miss Daisy']\n `MPAA Rating` text, -- motion picture association of america rating, example: ['PG-13', 'PG']\n Budget integer, -- example: [7500000, 13000000]\n `Release Date` text, -- example: ['1989-10-12', '1989-12-13']\n Genre text, -- example: ['Romance', 'Comedy']\n `Rating Count` integer, -- example: [73638, 91075]\n Summary text, -- example: ['After a single, career-minded woman is l', 'An old Jewish woman and her African-Amer']\n PRIMARY KEY (MovieID)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nplayed by Tom Cruise refers to name = 'Tom Cruise'; movie Born on the Fourth of July refers to title = 'Born on the Fourth of July'\nWhat is the name of the character played by Tom Cruise in the movie Born on the Fourth of July?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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 Name` FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID INNER JOIN actor AS T3 ON T3.ActorID = T2.ActorID WHERE T3.Name = 'Tom Cruise' AND T1.Title = 'Born on the Fourth of July'",
"style": "rule"
} | {
"db_id": "movie.sqlite",
"gt_sql": "SELECT T2.`Character Name` FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID INNER JOIN actor AS T3 ON T3.ActorID = T2.ActorID WHERE T3.Name = 'Tom Cruise' AND T1.Title = 'Born on the Fourth of July'",
"index": 364,
"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 actor (\n ActorID integer, -- example: [1, 2]\n Name text, -- example: ['Tom Cruise', 'John Travolta', 'Kirstie Alley']\n `Date of Birth` date, -- example: ['1954-02-18', '1951-01-12']\n `Height (Inches)` integer, -- height inches, example: [74, 67]\n Gender text, -- example: ['Male', 'Female']\n Ethnicity text, -- example: ['White', 'African American']\n NetWorth text, -- example: ['$250,000,000.00', '$40,000,000.00']\n PRIMARY KEY (ActorID)\n);\n\nCREATE TABLE characters (\n MovieID integer, -- example: [1, 2]\n ActorID integer, -- example: [1, 2]\n `Character Name` text, -- example: ['Tom', 'James', 'Mollie']\n pay text, -- example: ['$5,000,000.00', '$60,000,000.00']\n PRIMARY KEY (MovieID, ActorID),\n CONSTRAINT fk_characters_movieid FOREIGN KEY (MovieID) REFERENCES movie (MovieID),\n CONSTRAINT fk_characters_actorid FOREIGN KEY (ActorID) REFERENCES actor (ActorID)\n);\n\nCREATE TABLE movie (\n MovieID integer, -- example: [1, 2]\n Title text, -- example: ['Born on the Fourth of July', \"Look Who's Talking\", 'Driving Miss Daisy']\n `MPAA Rating` text, -- motion picture association of america rating, example: ['PG-13', 'PG']\n Budget integer, -- example: [7500000, 13000000]\n `Release Date` text, -- example: ['1989-10-12', '1989-12-13']\n Genre text, -- example: ['Romance', 'Comedy']\n `Rating Count` integer, -- example: [73638, 91075]\n Summary text, -- example: ['After a single, career-minded woman is l', 'An old Jewish woman and her African-Amer']\n PRIMARY KEY (MovieID)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nplayed by Tom Cruise refers to name = 'Tom Cruise'; movie Born on the Fourth of July refers to title = 'Born on the Fourth of July'\nWhat is the name of the character played by Tom Cruise in the movie Born on the Fourth of July?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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 movie (\n MovieID integer, -- example: [1, 2]\n `MPAA Rating` text, -- motion picture association of america rating, example: ['PG-13', 'PG']\n Budget integer, -- example: [7500000, 13000000]\n `Release Date` text, -- example: ['1989-10-12', '1989-12-13']\n Genre text, -- example: ['Romance', 'Comedy']\n Rating real, -- example: [5.9, 7.4]\n `Rating Count` integer, -- example: [73638, 91075]\n PRIMARY KEY (MovieID)\n);\n\nCREATE TABLE actor (\n ActorID integer, -- example: [1, 2]\n Name text, -- example: ['Tom Cruise', 'John Travolta', 'Kirstie Alley']\n `Date of Birth` date, -- example: ['1954-02-18', '1951-01-12']\n `Birth City` text, -- example: ['Englewood', 'Wichita']\n Biography text, -- example: ['John Joseph Travolta was born in Englewo', 'Long a vital, respected lady of the clas']\n Gender text, -- example: ['Male', 'Female']\n Ethnicity text, -- example: ['White', 'African American']\n PRIMARY KEY (ActorID)\n);\n\nCREATE TABLE characters (\n MovieID integer, -- example: [1, 2]\n ActorID integer, -- example: [1, 2]\n `Character Name` text, -- example: ['Tom', 'James', 'Mollie']\n screentime text, -- example: ['0:32:30', '0:32:15']\n PRIMARY KEY (MovieID, ActorID),\n CONSTRAINT fk_characters_movieid FOREIGN KEY (MovieID) REFERENCES movie (MovieID),\n CONSTRAINT fk_characters_actorid FOREIGN KEY (ActorID) REFERENCES actor (ActorID)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nstarring Tom Cruise refers to name = 'Tom Cruise'; average rating = divide(sum(rating where name = 'Tom Cruise'), count(movieid where name = 'Tom Cruise'))\nWhat is the average rating of all the movies starring Tom Cruise?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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.Rating) FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID INNER JOIN actor AS T3 ON T3.ActorID = T2.ActorID WHERE T3.Name = 'Tom Cruise'",
"style": "rule"
} | {
"db_id": "movie.sqlite",
"gt_sql": "SELECT AVG(T1.Rating) FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID INNER JOIN actor AS T3 ON T3.ActorID = T2.ActorID WHERE T3.Name = 'Tom Cruise'",
"index": 365,
"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 movie (\n MovieID integer, -- example: [1, 2]\n `MPAA Rating` text, -- motion picture association of america rating, example: ['PG-13', 'PG']\n Budget integer, -- example: [7500000, 13000000]\n `Release Date` text, -- example: ['1989-10-12', '1989-12-13']\n Genre text, -- example: ['Romance', 'Comedy']\n Rating real, -- example: [5.9, 7.4]\n `Rating Count` integer, -- example: [73638, 91075]\n PRIMARY KEY (MovieID)\n);\n\nCREATE TABLE actor (\n ActorID integer, -- example: [1, 2]\n Name text, -- example: ['Tom Cruise', 'John Travolta', 'Kirstie Alley']\n `Date of Birth` date, -- example: ['1954-02-18', '1951-01-12']\n `Birth City` text, -- example: ['Englewood', 'Wichita']\n Biography text, -- example: ['John Joseph Travolta was born in Englewo', 'Long a vital, respected lady of the clas']\n Gender text, -- example: ['Male', 'Female']\n Ethnicity text, -- example: ['White', 'African American']\n PRIMARY KEY (ActorID)\n);\n\nCREATE TABLE characters (\n MovieID integer, -- example: [1, 2]\n ActorID integer, -- example: [1, 2]\n `Character Name` text, -- example: ['Tom', 'James', 'Mollie']\n screentime text, -- example: ['0:32:30', '0:32:15']\n PRIMARY KEY (MovieID, ActorID),\n CONSTRAINT fk_characters_movieid FOREIGN KEY (MovieID) REFERENCES movie (MovieID),\n CONSTRAINT fk_characters_actorid FOREIGN KEY (ActorID) REFERENCES actor (ActorID)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nstarring Tom Cruise refers to name = 'Tom Cruise'; average rating = divide(sum(rating where name = 'Tom Cruise'), count(movieid where name = 'Tom Cruise'))\nWhat is the average rating of all the movies starring Tom Cruise?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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 characters (\n MovieID integer, -- example: [1, 2]\n ActorID integer, -- example: [1, 2]\n `Character Name` text, -- example: ['Max', 'James', 'Mollie']\n screentime text, -- example: ['0:32:30', '0:32:15']\n PRIMARY KEY (MovieID, ActorID),\n CONSTRAINT fk_characters_movieid FOREIGN KEY (MovieID) REFERENCES movie (MovieID),\n CONSTRAINT fk_characters_actorid FOREIGN KEY (ActorID) REFERENCES actor (ActorID)\n);\n\nCREATE TABLE movie (\n MovieID integer, -- example: [1, 2]\n Title text, -- example: [\"Look Who's Talking\", 'Driving Miss Daisy']\n `MPAA Rating` text, -- motion picture association of america rating, example: ['PG-13', 'PG']\n Budget integer, -- example: [7500000, 13000000]\n Gross integer, -- example: [296000000, 145793296]\n Runtime integer, -- example: [93, 99]\n `Rating Count` integer, -- example: [73638, 91075]\n PRIMARY KEY (MovieID)\n);\n\nCREATE TABLE actor (\n ActorID integer, -- example: [1, 2]\n Name text, -- example: ['John Travolta', 'Kirstie Alley']\n `Date of Birth` date, -- example: ['1954-02-18', '1951-01-12']\n `Height (Inches)` integer, -- height inches, example: [74, 67]\n Gender text, -- example: ['Male', 'Female']\n NetWorth text, -- example: ['$250,000,000.00', '$40,000,000.00']\n PRIMARY KEY (ActorID)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nbiggest budget refers to max(Budget); name of the movie refers to Title\nWhich movie had the biggest budget? Give the name of the movie.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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 Title FROM movie ORDER BY Budget DESC LIMIT 1",
"style": "rule"
} | {
"db_id": "movie.sqlite",
"gt_sql": "SELECT Title FROM movie ORDER BY Budget DESC LIMIT 1",
"index": 366,
"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 MovieID integer, -- example: [1, 2]\n ActorID integer, -- example: [1, 2]\n `Character Name` text, -- example: ['Max', 'James', 'Mollie']\n screentime text, -- example: ['0:32:30', '0:32:15']\n PRIMARY KEY (MovieID, ActorID),\n CONSTRAINT fk_characters_movieid FOREIGN KEY (MovieID) REFERENCES movie (MovieID),\n CONSTRAINT fk_characters_actorid FOREIGN KEY (ActorID) REFERENCES actor (ActorID)\n);\n\nCREATE TABLE movie (\n MovieID integer, -- example: [1, 2]\n Title text, -- example: [\"Look Who's Talking\", 'Driving Miss Daisy']\n `MPAA Rating` text, -- motion picture association of america rating, example: ['PG-13', 'PG']\n Budget integer, -- example: [7500000, 13000000]\n Gross integer, -- example: [296000000, 145793296]\n Runtime integer, -- example: [93, 99]\n `Rating Count` integer, -- example: [73638, 91075]\n PRIMARY KEY (MovieID)\n);\n\nCREATE TABLE actor (\n ActorID integer, -- example: [1, 2]\n Name text, -- example: ['John Travolta', 'Kirstie Alley']\n `Date of Birth` date, -- example: ['1954-02-18', '1951-01-12']\n `Height (Inches)` integer, -- height inches, example: [74, 67]\n Gender text, -- example: ['Male', 'Female']\n NetWorth text, -- example: ['$250,000,000.00', '$40,000,000.00']\n PRIMARY KEY (ActorID)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nbiggest budget refers to max(Budget); name of the movie refers to Title\nWhich movie had the biggest budget? Give the name of the movie.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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 actor (\n ActorID integer, -- example: [1, 2]\n Name text, -- example: ['John Travolta', 'Kirstie Alley']\n `Date of Birth` date, -- example: ['1954-02-18', '1951-01-12']\n `Birth Country` text, -- example: ['USA', 'West Germany']\n Biography text, -- example: ['John Joseph Travolta was born in Englewo', 'Long a vital, respected lady of the clas']\n Gender text, -- example: ['Male', 'Female']\n Ethnicity text, -- example: ['White', 'African American']\n NetWorth text, -- example: ['$250,000,000.00', '$40,000,000.00']\n PRIMARY KEY (ActorID)\n);\n\nCREATE TABLE movie (\n MovieID integer, -- example: [1, 2]\n Title text, -- example: [\"Look Who's Talking\", 'Driving Miss Daisy']\n `MPAA Rating` text, -- motion picture association of america rating, example: ['PG', 'G', 'PG-13']\n Budget integer, -- example: [7500000, 13000000]\n `Release Date` text, -- example: ['1989-10-12', '1989-12-13']\n Genre text, -- example: ['Romance', 'Comedy']\n Runtime integer, -- example: [93, 99]\n Rating real, -- example: [5.9, 7.4]\n `Rating Count` integer, -- example: [73638, 91075]\n Summary text, -- example: ['After a single, career-minded woman is l', 'An old Jewish woman and her African-Amer']\n PRIMARY KEY (MovieID)\n);\n\nCREATE TABLE characters (\n MovieID integer, -- example: [1, 2]\n ActorID integer, -- example: [1, 2]\n `Character Name` text, -- example: ['Peter Quill', 'Peter', 'James', 'Mollie']\n pay text, -- example: ['$5,000,000.00', '$60,000,000.00']\n screentime text, -- example: ['0:32:30', '0:32:15']\n PRIMARY KEY (MovieID, ActorID),\n CONSTRAINT fk_characters_movieid FOREIGN KEY (MovieID) REFERENCES movie (MovieID),\n CONSTRAINT fk_characters_actorid FOREIGN KEY (ActorID) REFERENCES actor (ActorID)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nMPAA rating = 'G' means General audiences; MPAA rating = 'PG' means Parental guidance suggested; MPAA rating = 'R'means Restricted; MPAA rating = 'X' means No one under 17 admitted\nWhat is the MPAA rating for the movie with the character named \"Peter Quill\" in 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.`MPAA Rating` FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID WHERE T2.`Character Name` = 'Peter Quill'",
"style": "rule"
} | {
"db_id": "movie.sqlite",
"gt_sql": "SELECT T1.`MPAA Rating` FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID WHERE T2.`Character Name` = 'Peter Quill'",
"index": 367,
"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 actor (\n ActorID integer, -- example: [1, 2]\n Name text, -- example: ['John Travolta', 'Kirstie Alley']\n `Date of Birth` date, -- example: ['1954-02-18', '1951-01-12']\n `Birth Country` text, -- example: ['USA', 'West Germany']\n Biography text, -- example: ['John Joseph Travolta was born in Englewo', 'Long a vital, respected lady of the clas']\n Gender text, -- example: ['Male', 'Female']\n Ethnicity text, -- example: ['White', 'African American']\n NetWorth text, -- example: ['$250,000,000.00', '$40,000,000.00']\n PRIMARY KEY (ActorID)\n);\n\nCREATE TABLE movie (\n MovieID integer, -- example: [1, 2]\n Title text, -- example: [\"Look Who's Talking\", 'Driving Miss Daisy']\n `MPAA Rating` text, -- motion picture association of america rating, example: ['PG', 'G', 'PG-13']\n Budget integer, -- example: [7500000, 13000000]\n `Release Date` text, -- example: ['1989-10-12', '1989-12-13']\n Genre text, -- example: ['Romance', 'Comedy']\n Runtime integer, -- example: [93, 99]\n Rating real, -- example: [5.9, 7.4]\n `Rating Count` integer, -- example: [73638, 91075]\n Summary text, -- example: ['After a single, career-minded woman is l', 'An old Jewish woman and her African-Amer']\n PRIMARY KEY (MovieID)\n);\n\nCREATE TABLE characters (\n MovieID integer, -- example: [1, 2]\n ActorID integer, -- example: [1, 2]\n `Character Name` text, -- example: ['Peter Quill', 'Peter', 'James', 'Mollie']\n pay text, -- example: ['$5,000,000.00', '$60,000,000.00']\n screentime text, -- example: ['0:32:30', '0:32:15']\n PRIMARY KEY (MovieID, ActorID),\n CONSTRAINT fk_characters_movieid FOREIGN KEY (MovieID) REFERENCES movie (MovieID),\n CONSTRAINT fk_characters_actorid FOREIGN KEY (ActorID) REFERENCES actor (ActorID)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nMPAA rating = 'G' means General audiences; MPAA rating = 'PG' means Parental guidance suggested; MPAA rating = 'R'means Restricted; MPAA rating = 'X' means No one under 17 admitted\nWhat is the MPAA rating for the movie with the character named \"Peter Quill\" in 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 movie (\n MovieID integer, -- example: [1, 2]\n Genre text, -- example: ['Thriller', 'Romance', 'Comedy']\n Rating real, -- example: [5.9, 7.4]\n `Rating Count` integer, -- example: [73638, 91075]\n Summary text, -- example: ['After a single, career-minded woman is l', 'An old Jewish woman and her African-Amer']\n PRIMARY KEY (MovieID)\n);\n\nCREATE TABLE actor (\n ActorID integer, -- example: [1, 2]\n Name text, -- example: ['John Travolta', 'Kirstie Alley']\n `Height (Inches)` integer, -- height inches, example: [74, 67]\n Biography text, -- example: ['John Joseph Travolta was born in Englewo', 'Long a vital, respected lady of the clas']\n PRIMARY KEY (ActorID)\n);\n\nCREATE TABLE characters (\n MovieID integer, -- example: [1, 2]\n ActorID integer, -- example: [1, 2]\n `Character Name` text, -- example: ['Max', 'James', 'Mollie']\n creditOrder integer, -- example: [1, 2]\n pay text, -- example: ['$5,000,000.00', '$60,000,000.00']\n PRIMARY KEY (MovieID, ActorID),\n CONSTRAINT fk_characters_movieid FOREIGN KEY (MovieID) REFERENCES movie (MovieID),\n CONSTRAINT fk_characters_actorid FOREIGN KEY (ActorID) REFERENCES actor (ActorID)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nNo.1 character in the credit list refers to creditOrder = '1'; highest rating refers to max(rating); thriller movie refers to Genre = 'Thriller'\nGive the name of the No.1 character in the credit list from the highest rating thriller movie.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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 Name` FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID WHERE T2.creditOrder = '1' AND T1.Genre = 'Thriller' ORDER BY T1.Rating DESC LIMIT 1",
"style": "rule"
} | {
"db_id": "movie.sqlite",
"gt_sql": "SELECT T2.`Character Name` FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID WHERE T2.creditOrder = '1' AND T1.Genre = 'Thriller' ORDER BY T1.Rating DESC LIMIT 1",
"index": 368,
"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 movie (\n MovieID integer, -- example: [1, 2]\n Genre text, -- example: ['Thriller', 'Romance', 'Comedy']\n Rating real, -- example: [5.9, 7.4]\n `Rating Count` integer, -- example: [73638, 91075]\n Summary text, -- example: ['After a single, career-minded woman is l', 'An old Jewish woman and her African-Amer']\n PRIMARY KEY (MovieID)\n);\n\nCREATE TABLE actor (\n ActorID integer, -- example: [1, 2]\n Name text, -- example: ['John Travolta', 'Kirstie Alley']\n `Height (Inches)` integer, -- height inches, example: [74, 67]\n Biography text, -- example: ['John Joseph Travolta was born in Englewo', 'Long a vital, respected lady of the clas']\n PRIMARY KEY (ActorID)\n);\n\nCREATE TABLE characters (\n MovieID integer, -- example: [1, 2]\n ActorID integer, -- example: [1, 2]\n `Character Name` text, -- example: ['Max', 'James', 'Mollie']\n creditOrder integer, -- example: [1, 2]\n pay text, -- example: ['$5,000,000.00', '$60,000,000.00']\n PRIMARY KEY (MovieID, ActorID),\n CONSTRAINT fk_characters_movieid FOREIGN KEY (MovieID) REFERENCES movie (MovieID),\n CONSTRAINT fk_characters_actorid FOREIGN KEY (ActorID) REFERENCES actor (ActorID)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nNo.1 character in the credit list refers to creditOrder = '1'; highest rating refers to max(rating); thriller movie refers to Genre = 'Thriller'\nGive the name of the No.1 character in the credit list from the highest rating thriller movie.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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 movie (\n MovieID integer, -- example: [1, 2]\n Title text, -- example: ['Batman', \"Look Who's Talking\", 'Driving Miss Daisy']\n `MPAA Rating` text, -- motion picture association of america rating, example: ['PG-13', 'PG']\n Genre text, -- example: ['Romance', 'Comedy']\n PRIMARY KEY (MovieID)\n);\n\nCREATE TABLE actor (\n ActorID integer, -- example: [1, 2]\n Name text, -- example: ['John Travolta', 'Kirstie Alley']\n `Birth City` text, -- example: ['Englewood', 'Wichita']\n Ethnicity text, -- example: ['White', 'African American']\n PRIMARY KEY (ActorID)\n);\n\nCREATE TABLE characters (\n MovieID integer, -- example: [1, 2]\n ActorID integer, -- example: [1, 2]\n screentime text, -- example: ['0:32:30', '0:32:15']\n PRIMARY KEY (MovieID, ActorID),\n CONSTRAINT fk_characters_movieid FOREIGN KEY (MovieID) REFERENCES movie (MovieID),\n CONSTRAINT fk_characters_actorid FOREIGN KEY (ActorID) REFERENCES actor (ActorID)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nmovie \"Batman\" refers to Title = 'Batman'; longest screentime refers to max(screentime)\nWho was the actor that played in the movie \"Batman\" with the longest screentime?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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.Name FROM characters AS T1 INNER JOIN actor AS T2 ON T1.ActorID = T2.ActorID INNER JOIN movie AS T3 ON T3.MovieID = T1.MovieID WHERE T3.Title = 'Batman' ORDER BY T1.screentime DESC LIMIT 1",
"style": "rule"
} | {
"db_id": "movie.sqlite",
"gt_sql": "SELECT T2.Name FROM characters AS T1 INNER JOIN actor AS T2 ON T1.ActorID = T2.ActorID INNER JOIN movie AS T3 ON T3.MovieID = T1.MovieID WHERE T3.Title = 'Batman' ORDER BY T1.screentime DESC LIMIT 1",
"index": 369,
"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 movie (\n MovieID integer, -- example: [1, 2]\n Title text, -- example: ['Batman', \"Look Who's Talking\", 'Driving Miss Daisy']\n `MPAA Rating` text, -- motion picture association of america rating, example: ['PG-13', 'PG']\n Genre text, -- example: ['Romance', 'Comedy']\n PRIMARY KEY (MovieID)\n);\n\nCREATE TABLE actor (\n ActorID integer, -- example: [1, 2]\n Name text, -- example: ['John Travolta', 'Kirstie Alley']\n `Birth City` text, -- example: ['Englewood', 'Wichita']\n Ethnicity text, -- example: ['White', 'African American']\n PRIMARY KEY (ActorID)\n);\n\nCREATE TABLE characters (\n MovieID integer, -- example: [1, 2]\n ActorID integer, -- example: [1, 2]\n screentime text, -- example: ['0:32:30', '0:32:15']\n PRIMARY KEY (MovieID, ActorID),\n CONSTRAINT fk_characters_movieid FOREIGN KEY (MovieID) REFERENCES movie (MovieID),\n CONSTRAINT fk_characters_actorid FOREIGN KEY (ActorID) REFERENCES actor (ActorID)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nmovie \"Batman\" refers to Title = 'Batman'; longest screentime refers to max(screentime)\nWho was the actor that played in the movie \"Batman\" with the longest screentime?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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 movie (\n MovieID integer, -- example: [1, 2]\n Title text, -- example: [\"Look Who's Talking\", 'Driving Miss Daisy']\n `MPAA Rating` text, -- motion picture association of america rating, example: ['PG-13', 'PG']\n Gross integer, -- example: [296000000, 145793296]\n Genre text, -- example: ['Romance', 'Comedy']\n Runtime integer, -- example: [93, 99]\n Rating real, -- example: [5.9, 7.4]\n `Rating Count` integer, -- example: [73638, 91075]\n Summary text, -- example: ['After a single, career-minded woman is l', 'An old Jewish woman and her African-Amer']\n PRIMARY KEY (MovieID)\n);\n\nCREATE TABLE actor (\n ActorID integer, -- example: [1, 2]\n Name text, -- example: ['John Travolta', 'Kirstie Alley']\n `Date of Birth` date, -- example: ['1954-02-18', '1951-01-12']\n `Birth City` text, -- example: ['Englewood', 'Wichita']\n `Birth Country` text, -- example: ['USA', 'West Germany']\n `Height (Inches)` integer, -- height inches, example: [74, 67]\n Gender text, -- example: ['Male', 'Female']\n Ethnicity text, -- example: ['White', 'African American']\n NetWorth text, -- example: ['$250,000,000.00', '$40,000,000.00']\n PRIMARY KEY (ActorID)\n);\n\nCREATE TABLE characters (\n MovieID integer, -- example: [1, 2]\n ActorID integer, -- example: [1, 2]\n `Character Name` text, -- example: ['Max', 'James', 'Mollie']\n creditOrder integer, -- example: [1, 2]\n pay text, -- example: ['$5,000,000.00', '$60,000,000.00']\n screentime text, -- example: ['0:32:30', '0:32:15']\n PRIMARY KEY (MovieID, ActorID),\n CONSTRAINT fk_characters_movieid FOREIGN KEY (MovieID) REFERENCES movie (MovieID),\n CONSTRAINT fk_characters_actorid FOREIGN KEY (ActorID) REFERENCES actor (ActorID)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nhighest networth refers to max(networth)\nHow many movies has the highest networth actor acted 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 COUNT(*) FROM characters AS T1 INNER JOIN actor AS T2 ON T1.ActorID = T2.ActorID WHERE CAST(REPLACE(REPLACE(T2.NetWorth, ',', ''), '$', '') AS REAL) = ( SELECT MAX(CAST(REPLACE(REPLACE(NetWorth, ',', ''), '$', '') AS REAL)) FROM actor)",
"style": "rule"
} | {
"db_id": "movie.sqlite",
"gt_sql": "SELECT COUNT(*) FROM characters AS T1 INNER JOIN actor AS T2 ON T1.ActorID = T2.ActorID WHERE CAST(REPLACE(REPLACE(T2.NetWorth, ',', ''), '$', '') AS REAL) = ( SELECT MAX(CAST(REPLACE(REPLACE(NetWorth, ',', ''), '$', '') AS REAL)) FROM actor)",
"index": 370,
"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 movie (\n MovieID integer, -- example: [1, 2]\n Title text, -- example: [\"Look Who's Talking\", 'Driving Miss Daisy']\n `MPAA Rating` text, -- motion picture association of america rating, example: ['PG-13', 'PG']\n Gross integer, -- example: [296000000, 145793296]\n Genre text, -- example: ['Romance', 'Comedy']\n Runtime integer, -- example: [93, 99]\n Rating real, -- example: [5.9, 7.4]\n `Rating Count` integer, -- example: [73638, 91075]\n Summary text, -- example: ['After a single, career-minded woman is l', 'An old Jewish woman and her African-Amer']\n PRIMARY KEY (MovieID)\n);\n\nCREATE TABLE actor (\n ActorID integer, -- example: [1, 2]\n Name text, -- example: ['John Travolta', 'Kirstie Alley']\n `Date of Birth` date, -- example: ['1954-02-18', '1951-01-12']\n `Birth City` text, -- example: ['Englewood', 'Wichita']\n `Birth Country` text, -- example: ['USA', 'West Germany']\n `Height (Inches)` integer, -- height inches, example: [74, 67]\n Gender text, -- example: ['Male', 'Female']\n Ethnicity text, -- example: ['White', 'African American']\n NetWorth text, -- example: ['$250,000,000.00', '$40,000,000.00']\n PRIMARY KEY (ActorID)\n);\n\nCREATE TABLE characters (\n MovieID integer, -- example: [1, 2]\n ActorID integer, -- example: [1, 2]\n `Character Name` text, -- example: ['Max', 'James', 'Mollie']\n creditOrder integer, -- example: [1, 2]\n pay text, -- example: ['$5,000,000.00', '$60,000,000.00']\n screentime text, -- example: ['0:32:30', '0:32:15']\n PRIMARY KEY (MovieID, ActorID),\n CONSTRAINT fk_characters_movieid FOREIGN KEY (MovieID) REFERENCES movie (MovieID),\n CONSTRAINT fk_characters_actorid FOREIGN KEY (ActorID) REFERENCES actor (ActorID)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nhighest networth refers to max(networth)\nHow many movies has the highest networth actor acted 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 movie (\n MovieID integer, -- example: [1, 2]\n Genre text, -- example: ['Romance', 'Comedy']\n Rating real, -- example: [5.9, 7.4]\n `Rating Count` integer, -- example: [73638, 91075]\n Summary text, -- example: ['After a single, career-minded woman is l', 'An old Jewish woman and her African-Amer']\n PRIMARY KEY (MovieID)\n);\n\nCREATE TABLE characters (\n MovieID integer, -- example: [1, 2]\n ActorID integer, -- example: [1, 2]\n `Character Name` text, -- example: ['Chanice Kobolowski', 'James', 'Mollie']\n creditOrder integer, -- example: [1, 2]\n pay text, -- example: ['$5,000,000.00', '$60,000,000.00']\n screentime text, -- example: ['0:32:30', '0:32:15']\n PRIMARY KEY (MovieID, ActorID),\n CONSTRAINT fk_characters_movieid FOREIGN KEY (MovieID) REFERENCES movie (MovieID),\n CONSTRAINT fk_characters_actorid FOREIGN KEY (ActorID) REFERENCES actor (ActorID)\n);\n\nCREATE TABLE actor (\n ActorID integer, -- example: [1, 2]\n Name text, -- example: ['John Travolta', 'Kirstie Alley']\n `Date of Birth` date, -- example: ['1954-02-18', '1951-01-12']\n `Birth Country` text, -- example: ['USA', 'West Germany']\n Biography text, -- example: ['John Joseph Travolta was born in Englewo', 'Long a vital, respected lady of the clas']\n Gender text, -- example: ['Male', 'Female']\n Ethnicity text, -- example: ['White', 'African American']\n PRIMARY KEY (ActorID)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nWho played the character named \"Chanice Kobolowski\"?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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.Name FROM characters AS T1 INNER JOIN actor AS T2 ON T1.ActorID = T2.ActorID WHERE T1.`Character Name` = 'Chanice Kobolowski'",
"style": "rule"
} | {
"db_id": "movie.sqlite",
"gt_sql": "SELECT T2.Name FROM characters AS T1 INNER JOIN actor AS T2 ON T1.ActorID = T2.ActorID WHERE T1.`Character Name` = 'Chanice Kobolowski'",
"index": 371,
"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 movie (\n MovieID integer, -- example: [1, 2]\n Genre text, -- example: ['Romance', 'Comedy']\n Rating real, -- example: [5.9, 7.4]\n `Rating Count` integer, -- example: [73638, 91075]\n Summary text, -- example: ['After a single, career-minded woman is l', 'An old Jewish woman and her African-Amer']\n PRIMARY KEY (MovieID)\n);\n\nCREATE TABLE characters (\n MovieID integer, -- example: [1, 2]\n ActorID integer, -- example: [1, 2]\n `Character Name` text, -- example: ['Chanice Kobolowski', 'James', 'Mollie']\n creditOrder integer, -- example: [1, 2]\n pay text, -- example: ['$5,000,000.00', '$60,000,000.00']\n screentime text, -- example: ['0:32:30', '0:32:15']\n PRIMARY KEY (MovieID, ActorID),\n CONSTRAINT fk_characters_movieid FOREIGN KEY (MovieID) REFERENCES movie (MovieID),\n CONSTRAINT fk_characters_actorid FOREIGN KEY (ActorID) REFERENCES actor (ActorID)\n);\n\nCREATE TABLE actor (\n ActorID integer, -- example: [1, 2]\n Name text, -- example: ['John Travolta', 'Kirstie Alley']\n `Date of Birth` date, -- example: ['1954-02-18', '1951-01-12']\n `Birth Country` text, -- example: ['USA', 'West Germany']\n Biography text, -- example: ['John Joseph Travolta was born in Englewo', 'Long a vital, respected lady of the clas']\n Gender text, -- example: ['Male', 'Female']\n Ethnicity text, -- example: ['White', 'African American']\n PRIMARY KEY (ActorID)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nWho played the character named \"Chanice Kobolowski\"?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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 actor (\n ActorID integer, -- example: [1, 2]\n Name text, -- example: ['John Travolta', 'Kirstie Alley']\n `Date of Birth` date, -- example: ['1954-02-18', '1951-01-12']\n `Birth Country` text, -- example: ['USA', 'West Germany']\n PRIMARY KEY (ActorID)\n);\n\nCREATE TABLE characters (\n MovieID integer, -- example: [1, 2]\n ActorID integer, -- example: [1, 2]\n `Character Name` text, -- example: ['Sully', 'James', 'Mollie']\n screentime text, -- example: ['0:32:30', '0:32:15']\n PRIMARY KEY (MovieID, ActorID),\n CONSTRAINT fk_characters_movieid FOREIGN KEY (MovieID) REFERENCES movie (MovieID),\n CONSTRAINT fk_characters_actorid FOREIGN KEY (ActorID) REFERENCES actor (ActorID)\n);\n\nCREATE TABLE movie (\n MovieID integer, -- example: [1, 2]\n `Release Date` text, -- example: ['1989-10-12', '1989-12-13']\n Rating real, -- example: [5.9, 7.4]\n PRIMARY KEY (MovieID)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nbirthday refers to Date of Birth; \"Sully\" refers to Character Name = 'Sully'\nWhen is the birthday of the actor who played \"Sully\"?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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 of Birth` FROM characters AS T1 INNER JOIN actor AS T2 ON T1.ActorID = T2.ActorID WHERE T1.`Character Name` = 'Sully'",
"style": "rule"
} | {
"db_id": "movie.sqlite",
"gt_sql": "SELECT T2.`Date of Birth` FROM characters AS T1 INNER JOIN actor AS T2 ON T1.ActorID = T2.ActorID WHERE T1.`Character Name` = 'Sully'",
"index": 372,
"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 actor (\n ActorID integer, -- example: [1, 2]\n Name text, -- example: ['John Travolta', 'Kirstie Alley']\n `Date of Birth` date, -- example: ['1954-02-18', '1951-01-12']\n `Birth Country` text, -- example: ['USA', 'West Germany']\n PRIMARY KEY (ActorID)\n);\n\nCREATE TABLE characters (\n MovieID integer, -- example: [1, 2]\n ActorID integer, -- example: [1, 2]\n `Character Name` text, -- example: ['Sully', 'James', 'Mollie']\n screentime text, -- example: ['0:32:30', '0:32:15']\n PRIMARY KEY (MovieID, ActorID),\n CONSTRAINT fk_characters_movieid FOREIGN KEY (MovieID) REFERENCES movie (MovieID),\n CONSTRAINT fk_characters_actorid FOREIGN KEY (ActorID) REFERENCES actor (ActorID)\n);\n\nCREATE TABLE movie (\n MovieID integer, -- example: [1, 2]\n `Release Date` text, -- example: ['1989-10-12', '1989-12-13']\n Rating real, -- example: [5.9, 7.4]\n PRIMARY KEY (MovieID)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nbirthday refers to Date of Birth; \"Sully\" refers to Character Name = 'Sully'\nWhen is the birthday of the actor who played \"Sully\"?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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 characters (\n MovieID integer, -- example: [1, 2]\n ActorID integer, -- example: [1, 2]\n `Character Name` text, -- example: ['Gabriel Martin', 'Martin', 'James', 'Mollie']\n PRIMARY KEY (MovieID, ActorID),\n CONSTRAINT fk_characters_movieid FOREIGN KEY (MovieID) REFERENCES movie (MovieID),\n CONSTRAINT fk_characters_actorid FOREIGN KEY (ActorID) REFERENCES actor (ActorID)\n);\n\nCREATE TABLE movie (\n MovieID integer, -- example: [1, 2]\n `MPAA Rating` text, -- motion picture association of america rating, example: ['PG-13', 'PG']\n `Rating Count` integer, -- example: [73638, 91075]\n PRIMARY KEY (MovieID)\n);\n\nCREATE TABLE actor (\n ActorID integer, -- example: [1, 2]\n Name text, -- example: ['John Travolta', 'Kirstie Alley']\n `Date of Birth` date, -- example: ['1954-02-18', '1951-01-12']\n `Birth City` text, -- example: ['Englewood', 'Wichita']\n `Birth Country` text, -- example: ['USA', 'West Germany']\n PRIMARY KEY (ActorID)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\n\"Gabriel Martin\" refers to Character Name = 'Gabriel Martin'\nShow the birth city of the actor who played \"Gabriel Martin\".\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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.`Birth City` FROM characters AS T1 INNER JOIN actor AS T2 ON T1.ActorID = T2.ActorID WHERE T1.`Character Name` = 'Gabriel Martin'",
"style": "rule"
} | {
"db_id": "movie.sqlite",
"gt_sql": "SELECT T2.`Birth City` FROM characters AS T1 INNER JOIN actor AS T2 ON T1.ActorID = T2.ActorID WHERE T1.`Character Name` = 'Gabriel Martin'",
"index": 373,
"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 MovieID integer, -- example: [1, 2]\n ActorID integer, -- example: [1, 2]\n `Character Name` text, -- example: ['Gabriel Martin', 'Martin', 'James', 'Mollie']\n PRIMARY KEY (MovieID, ActorID),\n CONSTRAINT fk_characters_movieid FOREIGN KEY (MovieID) REFERENCES movie (MovieID),\n CONSTRAINT fk_characters_actorid FOREIGN KEY (ActorID) REFERENCES actor (ActorID)\n);\n\nCREATE TABLE movie (\n MovieID integer, -- example: [1, 2]\n `MPAA Rating` text, -- motion picture association of america rating, example: ['PG-13', 'PG']\n `Rating Count` integer, -- example: [73638, 91075]\n PRIMARY KEY (MovieID)\n);\n\nCREATE TABLE actor (\n ActorID integer, -- example: [1, 2]\n Name text, -- example: ['John Travolta', 'Kirstie Alley']\n `Date of Birth` date, -- example: ['1954-02-18', '1951-01-12']\n `Birth City` text, -- example: ['Englewood', 'Wichita']\n `Birth Country` text, -- example: ['USA', 'West Germany']\n PRIMARY KEY (ActorID)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\n\"Gabriel Martin\" refers to Character Name = 'Gabriel Martin'\nShow the birth city of the actor who played \"Gabriel Martin\".\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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 characters (\n MovieID integer, -- example: [1, 2]\n ActorID integer, -- example: [1, 2]\n `Character Name` text, -- example: ['Lurch', 'James', 'Mollie']\n PRIMARY KEY (MovieID, ActorID),\n CONSTRAINT fk_characters_movieid FOREIGN KEY (MovieID) REFERENCES movie (MovieID),\n CONSTRAINT fk_characters_actorid FOREIGN KEY (ActorID) REFERENCES actor (ActorID)\n);\n\nCREATE TABLE actor (\n ActorID integer, -- example: [1, 2]\n Name text, -- example: ['John Travolta', 'Kirstie Alley']\n `Birth Country` text, -- example: ['USA', 'West Germany']\n `Height (Inches)` integer, -- height inches, example: [74, 67]\n Ethnicity text, -- example: ['White', 'African American']\n NetWorth text, -- example: ['$250,000,000.00', '$40,000,000.00']\n PRIMARY KEY (ActorID)\n);\n\nCREATE TABLE movie (\n MovieID integer, -- example: [1, 2]\n `MPAA Rating` text, -- motion picture association of america rating, example: ['PG-13', 'PG']\n Genre text, -- example: ['Romance', 'Comedy']\n Runtime integer, -- example: [93, 99]\n PRIMARY KEY (MovieID)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\ntall refers to Height (Inches); \"Lurch\" refers to Character Name = 'Lurch'\nHow tall is the actor who played \"Lurch\"?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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.`Height (Inches)` FROM characters AS T1 INNER JOIN actor AS T2 ON T1.ActorID = T2.ActorID WHERE T1.`Character Name` = 'Lurch'",
"style": "rule"
} | {
"db_id": "movie.sqlite",
"gt_sql": "SELECT T2.`Height (Inches)` FROM characters AS T1 INNER JOIN actor AS T2 ON T1.ActorID = T2.ActorID WHERE T1.`Character Name` = 'Lurch'",
"index": 374,
"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 MovieID integer, -- example: [1, 2]\n ActorID integer, -- example: [1, 2]\n `Character Name` text, -- example: ['Lurch', 'James', 'Mollie']\n PRIMARY KEY (MovieID, ActorID),\n CONSTRAINT fk_characters_movieid FOREIGN KEY (MovieID) REFERENCES movie (MovieID),\n CONSTRAINT fk_characters_actorid FOREIGN KEY (ActorID) REFERENCES actor (ActorID)\n);\n\nCREATE TABLE actor (\n ActorID integer, -- example: [1, 2]\n Name text, -- example: ['John Travolta', 'Kirstie Alley']\n `Birth Country` text, -- example: ['USA', 'West Germany']\n `Height (Inches)` integer, -- height inches, example: [74, 67]\n Ethnicity text, -- example: ['White', 'African American']\n NetWorth text, -- example: ['$250,000,000.00', '$40,000,000.00']\n PRIMARY KEY (ActorID)\n);\n\nCREATE TABLE movie (\n MovieID integer, -- example: [1, 2]\n `MPAA Rating` text, -- motion picture association of america rating, example: ['PG-13', 'PG']\n Genre text, -- example: ['Romance', 'Comedy']\n Runtime integer, -- example: [93, 99]\n PRIMARY KEY (MovieID)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\ntall refers to Height (Inches); \"Lurch\" refers to Character Name = 'Lurch'\nHow tall is the actor who played \"Lurch\"?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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 movie (\n MovieID integer, -- example: [1, 2]\n Title text, -- example: ['G.I. Joe: The Rise of Cobra', \"Look Who's Talking\", 'Driving Miss Daisy']\n `MPAA Rating` text, -- motion picture association of america rating, example: ['PG-13', 'PG']\n Budget integer, -- example: [7500000, 13000000]\n PRIMARY KEY (MovieID)\n);\n\nCREATE TABLE actor (\n ActorID integer, -- example: [1, 2]\n Name text, -- example: ['John Travolta', 'Kirstie Alley']\n `Date of Birth` date, -- example: ['1954-02-18', '1951-01-12']\n `Birth Country` text, -- example: ['USA', 'West Germany']\n Ethnicity text, -- example: ['White', 'African American']\n PRIMARY KEY (ActorID)\n);\n\nCREATE TABLE characters (\n MovieID integer, -- example: [1, 2]\n ActorID integer, -- example: [1, 2]\n `Character Name` text, -- example: ['Joe', 'James', 'Mollie']\n creditOrder integer, -- example: [1, 2]\n PRIMARY KEY (MovieID, ActorID),\n CONSTRAINT fk_characters_movieid FOREIGN KEY (MovieID) REFERENCES movie (MovieID),\n CONSTRAINT fk_characters_actorid FOREIGN KEY (ActorID) REFERENCES actor (ActorID)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nNo.3 character refers to creditOrder = '3'; movie \"G.I. Joe: The Rise of Cobra\" refers to Title = 'G.I. Joe: The Rise of Cobra'\nShow the No.3 character name in the credit list of the movie \"G.I. Joe: The Rise of Cobra\".\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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 Name` FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID WHERE T1.Title = 'G.I. Joe: The Rise of Cobra' AND T2.creditOrder = '3'",
"style": "rule"
} | {
"db_id": "movie.sqlite",
"gt_sql": "SELECT T2.`Character Name` FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID WHERE T1.Title = 'G.I. Joe: The Rise of Cobra' AND T2.creditOrder = '3'",
"index": 375,
"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 movie (\n MovieID integer, -- example: [1, 2]\n Title text, -- example: ['G.I. Joe: The Rise of Cobra', \"Look Who's Talking\", 'Driving Miss Daisy']\n `MPAA Rating` text, -- motion picture association of america rating, example: ['PG-13', 'PG']\n Budget integer, -- example: [7500000, 13000000]\n PRIMARY KEY (MovieID)\n);\n\nCREATE TABLE actor (\n ActorID integer, -- example: [1, 2]\n Name text, -- example: ['John Travolta', 'Kirstie Alley']\n `Date of Birth` date, -- example: ['1954-02-18', '1951-01-12']\n `Birth Country` text, -- example: ['USA', 'West Germany']\n Ethnicity text, -- example: ['White', 'African American']\n PRIMARY KEY (ActorID)\n);\n\nCREATE TABLE characters (\n MovieID integer, -- example: [1, 2]\n ActorID integer, -- example: [1, 2]\n `Character Name` text, -- example: ['Joe', 'James', 'Mollie']\n creditOrder integer, -- example: [1, 2]\n PRIMARY KEY (MovieID, ActorID),\n CONSTRAINT fk_characters_movieid FOREIGN KEY (MovieID) REFERENCES movie (MovieID),\n CONSTRAINT fk_characters_actorid FOREIGN KEY (ActorID) REFERENCES actor (ActorID)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nNo.3 character refers to creditOrder = '3'; movie \"G.I. Joe: The Rise of Cobra\" refers to Title = 'G.I. Joe: The Rise of Cobra'\nShow the No.3 character name in the credit list of the movie \"G.I. Joe: The Rise of Cobra\".\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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 characters (\n MovieID integer, -- example: [1, 2]\n ActorID integer, -- example: [1, 2]\n creditOrder integer, -- example: [1, 2]\n PRIMARY KEY (MovieID, ActorID),\n CONSTRAINT fk_characters_movieid FOREIGN KEY (MovieID) REFERENCES movie (MovieID),\n CONSTRAINT fk_characters_actorid FOREIGN KEY (ActorID) REFERENCES actor (ActorID)\n);\n\nCREATE TABLE movie (\n MovieID integer, -- example: [1, 2]\n Title text, -- example: ['American Hustle', \"Look Who's Talking\", 'Driving Miss Daisy']\n Budget integer, -- example: [7500000, 13000000]\n PRIMARY KEY (MovieID)\n);\n\nCREATE TABLE actor (\n ActorID integer, -- example: [1, 2]\n Name text, -- example: ['John Travolta', 'Kirstie Alley']\n Ethnicity text, -- example: ['White', 'African American']\n PRIMARY KEY (ActorID)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nNo.2 character refers to creditOrder = '2'; movie \"American Hustle\" refers to Title = 'American Hustle'\nWho played the No.2 character in the credit list of the movie \"American Hustle\"?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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.Name FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID INNER JOIN actor AS T3 ON T3.ActorID = T2.ActorID WHERE T1.Title = 'American Hustle' AND T2.creditOrder = '2'",
"style": "rule"
} | {
"db_id": "movie.sqlite",
"gt_sql": "SELECT T3.Name FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID INNER JOIN actor AS T3 ON T3.ActorID = T2.ActorID WHERE T1.Title = 'American Hustle' AND T2.creditOrder = '2'",
"index": 376,
"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 MovieID integer, -- example: [1, 2]\n ActorID integer, -- example: [1, 2]\n creditOrder integer, -- example: [1, 2]\n PRIMARY KEY (MovieID, ActorID),\n CONSTRAINT fk_characters_movieid FOREIGN KEY (MovieID) REFERENCES movie (MovieID),\n CONSTRAINT fk_characters_actorid FOREIGN KEY (ActorID) REFERENCES actor (ActorID)\n);\n\nCREATE TABLE movie (\n MovieID integer, -- example: [1, 2]\n Title text, -- example: ['American Hustle', \"Look Who's Talking\", 'Driving Miss Daisy']\n Budget integer, -- example: [7500000, 13000000]\n PRIMARY KEY (MovieID)\n);\n\nCREATE TABLE actor (\n ActorID integer, -- example: [1, 2]\n Name text, -- example: ['John Travolta', 'Kirstie Alley']\n Ethnicity text, -- example: ['White', 'African American']\n PRIMARY KEY (ActorID)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nNo.2 character refers to creditOrder = '2'; movie \"American Hustle\" refers to Title = 'American Hustle'\nWho played the No.2 character in the credit list of the movie \"American Hustle\"?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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 movie (\n MovieID integer, -- example: [1, 2]\n Budget integer, -- example: [7500000, 13000000]\n Gross integer, -- example: [296000000, 145793296]\n `Release Date` text, -- example: ['2015-10-26', '1989-10-12', '1989-12-13']\n Genre text, -- example: ['Romance', 'Comedy']\n `Rating Count` integer, -- example: [73638, 91075]\n PRIMARY KEY (MovieID)\n);\n\nCREATE TABLE characters (\n MovieID integer, -- example: [1, 2]\n ActorID integer, -- example: [1, 2]\n creditOrder integer, -- example: [1, 2]\n PRIMARY KEY (MovieID, ActorID),\n CONSTRAINT fk_characters_movieid FOREIGN KEY (MovieID) REFERENCES movie (MovieID),\n CONSTRAINT fk_characters_actorid FOREIGN KEY (ActorID) REFERENCES actor (ActorID)\n);\n\nCREATE TABLE actor (\n ActorID integer, -- example: [1, 2]\n Name text, -- example: ['John Travolta', 'Kirstie Alley']\n `Date of Birth` date, -- example: ['1954-02-18', '1951-01-12']\n `Birth City` text, -- example: ['Englewood', 'Wichita']\n Biography text, -- example: ['John Joseph Travolta was born in Englewo', 'Long a vital, respected lady of the clas']\n NetWorth text, -- example: ['$250,000,000.00', '$40,000,000.00']\n PRIMARY KEY (ActorID)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nNo.1 character refers to creditOrder = '1'; released on \"2015/10/26\" refers to Release Date = '2015-10-26'\nWho played the No.1 character in the credit list of the movie which was released on \"2015/10/26\"?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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.Name FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID INNER JOIN actor AS T3 ON T3.ActorID = T2.ActorID WHERE T1.`Release Date` = '2015-10-26' AND T2.creditOrder = '1'",
"style": "rule"
} | {
"db_id": "movie.sqlite",
"gt_sql": "SELECT T3.Name FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID INNER JOIN actor AS T3 ON T3.ActorID = T2.ActorID WHERE T1.`Release Date` = '2015-10-26' AND T2.creditOrder = '1'",
"index": 377,
"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 movie (\n MovieID integer, -- example: [1, 2]\n Budget integer, -- example: [7500000, 13000000]\n Gross integer, -- example: [296000000, 145793296]\n `Release Date` text, -- example: ['2015-10-26', '1989-10-12', '1989-12-13']\n Genre text, -- example: ['Romance', 'Comedy']\n `Rating Count` integer, -- example: [73638, 91075]\n PRIMARY KEY (MovieID)\n);\n\nCREATE TABLE characters (\n MovieID integer, -- example: [1, 2]\n ActorID integer, -- example: [1, 2]\n creditOrder integer, -- example: [1, 2]\n PRIMARY KEY (MovieID, ActorID),\n CONSTRAINT fk_characters_movieid FOREIGN KEY (MovieID) REFERENCES movie (MovieID),\n CONSTRAINT fk_characters_actorid FOREIGN KEY (ActorID) REFERENCES actor (ActorID)\n);\n\nCREATE TABLE actor (\n ActorID integer, -- example: [1, 2]\n Name text, -- example: ['John Travolta', 'Kirstie Alley']\n `Date of Birth` date, -- example: ['1954-02-18', '1951-01-12']\n `Birth City` text, -- example: ['Englewood', 'Wichita']\n Biography text, -- example: ['John Joseph Travolta was born in Englewo', 'Long a vital, respected lady of the clas']\n NetWorth text, -- example: ['$250,000,000.00', '$40,000,000.00']\n PRIMARY KEY (ActorID)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nNo.1 character refers to creditOrder = '1'; released on \"2015/10/26\" refers to Release Date = '2015-10-26'\nWho played the No.1 character in the credit list of the movie which was released on \"2015/10/26\"?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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 characters (\n MovieID integer, -- example: [1, 2]\n ActorID integer, -- example: [1, 2]\n creditOrder integer, -- example: [1, 2]\n screentime text, -- example: ['0:32:30', '0:32:15']\n PRIMARY KEY (MovieID, ActorID),\n CONSTRAINT fk_characters_movieid FOREIGN KEY (MovieID) REFERENCES movie (MovieID),\n CONSTRAINT fk_characters_actorid FOREIGN KEY (ActorID) REFERENCES actor (ActorID)\n);\n\nCREATE TABLE actor (\n ActorID integer, -- example: [1, 2]\n Name text, -- example: ['John Travolta', 'Kirstie Alley']\n `Birth City` text, -- example: ['Englewood', 'Wichita']\n `Birth Country` text, -- example: ['USA', 'West Germany']\n `Height (Inches)` integer, -- height inches, example: [74, 67]\n Biography text, -- example: ['John Joseph Travolta was born in Englewo', 'Long a vital, respected lady of the clas']\n Gender text, -- example: ['Male', 'Female']\n Ethnicity text, -- example: ['White', 'African American']\n PRIMARY KEY (ActorID)\n);\n\nCREATE TABLE movie (\n MovieID integer, -- example: [1, 2]\n `MPAA Rating` text, -- motion picture association of america rating, example: ['PG', 'PG-13']\n Budget integer, -- example: [7500000, 13000000]\n `Release Date` text, -- example: ['1990-06-01', '1990-06-08', '1989-10-12', '1989-12-13']\n Genre text, -- example: ['Romance', 'Comedy']\n Runtime integer, -- example: [93, 99]\n Rating real, -- example: [5.9, 7.4]\n `Rating Count` integer, -- example: [73638, 91075]\n Summary text, -- example: ['After a single, career-minded woman is l', 'An old Jewish woman and her African-Amer']\n PRIMARY KEY (MovieID)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nrated PG refers to MPAA Rating = 'PG'; released in June 1990 refers to Release Date BETWEEN '1990-06-01' and '1990-06-30'\nIn rated PG movies, how many of them released in June 1990?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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 movie WHERE `MPAA Rating` = 'PG' AND `Release Date` LIKE '1990-06%'",
"style": "rule"
} | {
"db_id": "movie.sqlite",
"gt_sql": "SELECT COUNT(*) FROM movie WHERE `MPAA Rating` = 'PG' AND `Release Date` LIKE '1990-06%'",
"index": 378,
"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 MovieID integer, -- example: [1, 2]\n ActorID integer, -- example: [1, 2]\n creditOrder integer, -- example: [1, 2]\n screentime text, -- example: ['0:32:30', '0:32:15']\n PRIMARY KEY (MovieID, ActorID),\n CONSTRAINT fk_characters_movieid FOREIGN KEY (MovieID) REFERENCES movie (MovieID),\n CONSTRAINT fk_characters_actorid FOREIGN KEY (ActorID) REFERENCES actor (ActorID)\n);\n\nCREATE TABLE actor (\n ActorID integer, -- example: [1, 2]\n Name text, -- example: ['John Travolta', 'Kirstie Alley']\n `Birth City` text, -- example: ['Englewood', 'Wichita']\n `Birth Country` text, -- example: ['USA', 'West Germany']\n `Height (Inches)` integer, -- height inches, example: [74, 67]\n Biography text, -- example: ['John Joseph Travolta was born in Englewo', 'Long a vital, respected lady of the clas']\n Gender text, -- example: ['Male', 'Female']\n Ethnicity text, -- example: ['White', 'African American']\n PRIMARY KEY (ActorID)\n);\n\nCREATE TABLE movie (\n MovieID integer, -- example: [1, 2]\n `MPAA Rating` text, -- motion picture association of america rating, example: ['PG', 'PG-13']\n Budget integer, -- example: [7500000, 13000000]\n `Release Date` text, -- example: ['1990-06-01', '1990-06-08', '1989-10-12', '1989-12-13']\n Genre text, -- example: ['Romance', 'Comedy']\n Runtime integer, -- example: [93, 99]\n Rating real, -- example: [5.9, 7.4]\n `Rating Count` integer, -- example: [73638, 91075]\n Summary text, -- example: ['After a single, career-minded woman is l', 'An old Jewish woman and her African-Amer']\n PRIMARY KEY (MovieID)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nrated PG refers to MPAA Rating = 'PG'; released in June 1990 refers to Release Date BETWEEN '1990-06-01' and '1990-06-30'\nIn rated PG movies, how many of them released in June 1990?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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 actor (\n ActorID integer, -- example: [1, 2]\n Name text, -- example: ['John Travolta', 'Kirstie Alley']\n `Birth City` text, -- example: ['Englewood', 'Wichita']\n `Birth Country` text, -- example: ['USA', 'West Germany']\n `Height (Inches)` integer, -- height inches, example: [74, 67]\n Gender text, -- example: ['Male', 'Female']\n Ethnicity text, -- example: ['White', 'African American']\n NetWorth text, -- example: ['$250,000,000.00', '$40,000,000.00']\n PRIMARY KEY (ActorID)\n);\n\nCREATE TABLE characters (\n MovieID integer, -- example: [1, 2]\n ActorID integer, -- example: [1, 2]\n `Character Name` text, -- example: ['Max', 'James', 'Mollie']\n creditOrder integer, -- example: [1, 2]\n pay text, -- example: ['$5,000,000.00', '$60,000,000.00']\n screentime text, -- example: ['0:32:30', '0:32:15']\n PRIMARY KEY (MovieID, ActorID),\n CONSTRAINT fk_characters_movieid FOREIGN KEY (MovieID) REFERENCES movie (MovieID),\n CONSTRAINT fk_characters_actorid FOREIGN KEY (ActorID) REFERENCES actor (ActorID)\n);\n\nCREATE TABLE movie (\n MovieID integer, -- example: [1, 2]\n Title text, -- example: [\"Look Who's Talking\", 'Driving Miss Daisy']\n `MPAA Rating` text, -- motion picture association of america rating, example: ['PG', 'PG-13']\n Budget integer, -- example: [7500000, 13000000]\n Gross integer, -- example: [296000000, 145793296]\n `Release Date` text, -- example: ['1989-10-12', '1989-12-13']\n Genre text, -- example: ['Romance', 'Comedy']\n Runtime integer, -- example: [93, 99]\n Rating real, -- example: [5.9, 7.4]\n `Rating Count` integer, -- example: [73638, 91075]\n Summary text, -- example: ['After a single, career-minded woman is l', 'An old Jewish woman and her African-Amer']\n PRIMARY KEY (MovieID)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nPG rated refers to MPAA Rating = 'PG'; highest net worth refers to max(NetWorth)\nWhat is the genre of PG rated movie starred by the actor with highest net worth?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\n```sql\n-- Your SQL query\n```\n\nTake a deep breath and think step by step to find the correct SQL query.\n",
"role": "user"
}
] | nl2sql | {
"ground_truth": "SELECT T1.Genre FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID INNER JOIN actor AS T3 ON T3.ActorID = T2.ActorID WHERE T1.`MPAA Rating` = 'PG' ORDER BY CAST(REPLACE(REPLACE(T3.NetWorth, ',', ''), '$', '') AS REAL) DESC LIMIT 1",
"style": "rule"
} | {
"db_id": "movie.sqlite",
"gt_sql": "SELECT T1.Genre FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID INNER JOIN actor AS T3 ON T3.ActorID = T2.ActorID WHERE T1.`MPAA Rating` = 'PG' ORDER BY CAST(REPLACE(REPLACE(T3.NetWorth, ',', ''), '$', '') AS REAL) DESC LIMIT 1",
"index": 379,
"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 actor (\n ActorID integer, -- example: [1, 2]\n Name text, -- example: ['John Travolta', 'Kirstie Alley']\n `Birth City` text, -- example: ['Englewood', 'Wichita']\n `Birth Country` text, -- example: ['USA', 'West Germany']\n `Height (Inches)` integer, -- height inches, example: [74, 67]\n Gender text, -- example: ['Male', 'Female']\n Ethnicity text, -- example: ['White', 'African American']\n NetWorth text, -- example: ['$250,000,000.00', '$40,000,000.00']\n PRIMARY KEY (ActorID)\n);\n\nCREATE TABLE characters (\n MovieID integer, -- example: [1, 2]\n ActorID integer, -- example: [1, 2]\n `Character Name` text, -- example: ['Max', 'James', 'Mollie']\n creditOrder integer, -- example: [1, 2]\n pay text, -- example: ['$5,000,000.00', '$60,000,000.00']\n screentime text, -- example: ['0:32:30', '0:32:15']\n PRIMARY KEY (MovieID, ActorID),\n CONSTRAINT fk_characters_movieid FOREIGN KEY (MovieID) REFERENCES movie (MovieID),\n CONSTRAINT fk_characters_actorid FOREIGN KEY (ActorID) REFERENCES actor (ActorID)\n);\n\nCREATE TABLE movie (\n MovieID integer, -- example: [1, 2]\n Title text, -- example: [\"Look Who's Talking\", 'Driving Miss Daisy']\n `MPAA Rating` text, -- motion picture association of america rating, example: ['PG', 'PG-13']\n Budget integer, -- example: [7500000, 13000000]\n Gross integer, -- example: [296000000, 145793296]\n `Release Date` text, -- example: ['1989-10-12', '1989-12-13']\n Genre text, -- example: ['Romance', 'Comedy']\n Runtime integer, -- example: [93, 99]\n Rating real, -- example: [5.9, 7.4]\n `Rating Count` integer, -- example: [73638, 91075]\n Summary text, -- example: ['After a single, career-minded woman is l', 'An old Jewish woman and her African-Amer']\n PRIMARY KEY (MovieID)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nPG rated refers to MPAA Rating = 'PG'; highest net worth refers to max(NetWorth)\nWhat is the genre of PG rated movie starred by the actor with highest net worth?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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 movie (\n MovieID integer, -- example: [1, 2]\n Title text, -- example: ['Misery', \"Look Who's Talking\", 'Driving Miss Daisy']\n `MPAA Rating` text, -- motion picture association of america rating, example: ['PG-13', 'PG']\n PRIMARY KEY (MovieID)\n);\n\nCREATE TABLE characters (\n MovieID integer, -- example: [1, 2]\n ActorID integer, -- example: [1, 2]\n `Character Name` text, -- example: ['James', 'Mollie']\n PRIMARY KEY (MovieID, ActorID),\n CONSTRAINT fk_characters_movieid FOREIGN KEY (MovieID) REFERENCES movie (MovieID),\n CONSTRAINT fk_characters_actorid FOREIGN KEY (ActorID) REFERENCES actor (ActorID)\n);\n\nCREATE TABLE actor (\n ActorID integer, -- example: [1, 2]\n `Height (Inches)` integer, -- height inches, example: [74, 67]\n NetWorth text, -- example: ['$250,000,000.00', '$40,000,000.00']\n PRIMARY KEY (ActorID)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nMisery refers to Title = 'Misery'; height ranging from 60 to 70 inches refers to Height (Inches) BETWEEN 60 and 70\nWhat is the net worth of the actor starred in Misery who has a height ranging from 60 to 70 inches tall?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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.NetWorth FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID INNER JOIN actor AS T3 ON T3.ActorID = T2.ActorID WHERE T1.Title = 'Misery' AND T3.`Height (Inches)` BETWEEN 60 AND 70 AND T3.Gender = 'Male'",
"style": "rule"
} | {
"db_id": "movie.sqlite",
"gt_sql": "SELECT T3.NetWorth FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID INNER JOIN actor AS T3 ON T3.ActorID = T2.ActorID WHERE T1.Title = 'Misery' AND T3.`Height (Inches)` BETWEEN 60 AND 70 AND T3.Gender = 'Male'",
"index": 380,
"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 movie (\n MovieID integer, -- example: [1, 2]\n Title text, -- example: ['Misery', \"Look Who's Talking\", 'Driving Miss Daisy']\n `MPAA Rating` text, -- motion picture association of america rating, example: ['PG-13', 'PG']\n PRIMARY KEY (MovieID)\n);\n\nCREATE TABLE characters (\n MovieID integer, -- example: [1, 2]\n ActorID integer, -- example: [1, 2]\n `Character Name` text, -- example: ['James', 'Mollie']\n PRIMARY KEY (MovieID, ActorID),\n CONSTRAINT fk_characters_movieid FOREIGN KEY (MovieID) REFERENCES movie (MovieID),\n CONSTRAINT fk_characters_actorid FOREIGN KEY (ActorID) REFERENCES actor (ActorID)\n);\n\nCREATE TABLE actor (\n ActorID integer, -- example: [1, 2]\n `Height (Inches)` integer, -- height inches, example: [74, 67]\n NetWorth text, -- example: ['$250,000,000.00', '$40,000,000.00']\n PRIMARY KEY (ActorID)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nMisery refers to Title = 'Misery'; height ranging from 60 to 70 inches refers to Height (Inches) BETWEEN 60 and 70\nWhat is the net worth of the actor starred in Misery who has a height ranging from 60 to 70 inches tall?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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 actor (\n ActorID integer, -- example: [1, 2]\n Name text, -- example: ['John Travolta', 'Kirstie Alley']\n `Date of Birth` date, -- example: ['1954-02-18', '1951-01-12']\n `Birth City` text, -- example: ['USA', 'Englewood', 'Wichita']\n `Birth Country` text, -- example: ['USA', 'West Germany']\n `Height (Inches)` integer, -- height inches, example: [74, 67]\n Biography text, -- example: ['John Joseph Travolta was born in Englewo', 'Long a vital, respected lady of the clas']\n Gender text, -- example: ['Male', 'Female']\n Ethnicity text, -- example: ['White', 'African American']\n NetWorth text, -- example: ['$250,000,000.00', '$40,000,000.00']\n PRIMARY KEY (ActorID)\n);\n\nCREATE TABLE characters (\n MovieID integer, -- example: [1, 2]\n ActorID integer, -- example: [1, 2]\n `Character Name` text, -- example: ['James', 'Mollie']\n creditOrder integer, -- example: [1, 2]\n pay text, -- example: ['$5,000,000.00', '$60,000,000.00']\n screentime text, -- example: ['0:32:30', '0:32:15']\n PRIMARY KEY (MovieID, ActorID),\n CONSTRAINT fk_characters_movieid FOREIGN KEY (MovieID) REFERENCES movie (MovieID),\n CONSTRAINT fk_characters_actorid FOREIGN KEY (ActorID) REFERENCES actor (ActorID)\n);\n\nCREATE TABLE movie (\n MovieID integer, -- example: [1, 2]\n Title text, -- example: ['Ghost', \"Look Who's Talking\", 'Driving Miss Daisy']\n `MPAA Rating` text, -- motion picture association of america rating, example: ['PG-13', 'PG']\n Budget integer, -- example: [7500000, 13000000]\n Gross integer, -- example: [296000000, 145793296]\n `Release Date` text, -- example: ['1989-10-12', '1989-12-13']\n Genre text, -- example: ['Romance', 'Comedy']\n Runtime integer, -- example: [93, 99]\n Rating real, -- example: [5.9, 7.4]\n `Rating Count` integer, -- example: [73638, 91075]\n Summary text, -- example: ['After a single, career-minded woman is l', 'An old Jewish woman and her African-Amer']\n PRIMARY KEY (MovieID)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nmale refers to Gender = 'Male'; born in USA refers to Birth Country = 'USA'; Ghost refers to Title = 'Ghost'\nCount the male actors born in USA that starred in Ghost.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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 movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID INNER JOIN actor AS T3 ON T3.ActorID = T2.ActorID WHERE T1.Title = 'Ghost' AND T3.Gender = 'Male' AND T3.`Birth Country` = 'USA'",
"style": "rule"
} | {
"db_id": "movie.sqlite",
"gt_sql": "SELECT COUNT(*) FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID INNER JOIN actor AS T3 ON T3.ActorID = T2.ActorID WHERE T1.Title = 'Ghost' AND T3.Gender = 'Male' AND T3.`Birth Country` = 'USA'",
"index": 381,
"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 actor (\n ActorID integer, -- example: [1, 2]\n Name text, -- example: ['John Travolta', 'Kirstie Alley']\n `Date of Birth` date, -- example: ['1954-02-18', '1951-01-12']\n `Birth City` text, -- example: ['USA', 'Englewood', 'Wichita']\n `Birth Country` text, -- example: ['USA', 'West Germany']\n `Height (Inches)` integer, -- height inches, example: [74, 67]\n Biography text, -- example: ['John Joseph Travolta was born in Englewo', 'Long a vital, respected lady of the clas']\n Gender text, -- example: ['Male', 'Female']\n Ethnicity text, -- example: ['White', 'African American']\n NetWorth text, -- example: ['$250,000,000.00', '$40,000,000.00']\n PRIMARY KEY (ActorID)\n);\n\nCREATE TABLE characters (\n MovieID integer, -- example: [1, 2]\n ActorID integer, -- example: [1, 2]\n `Character Name` text, -- example: ['James', 'Mollie']\n creditOrder integer, -- example: [1, 2]\n pay text, -- example: ['$5,000,000.00', '$60,000,000.00']\n screentime text, -- example: ['0:32:30', '0:32:15']\n PRIMARY KEY (MovieID, ActorID),\n CONSTRAINT fk_characters_movieid FOREIGN KEY (MovieID) REFERENCES movie (MovieID),\n CONSTRAINT fk_characters_actorid FOREIGN KEY (ActorID) REFERENCES actor (ActorID)\n);\n\nCREATE TABLE movie (\n MovieID integer, -- example: [1, 2]\n Title text, -- example: ['Ghost', \"Look Who's Talking\", 'Driving Miss Daisy']\n `MPAA Rating` text, -- motion picture association of america rating, example: ['PG-13', 'PG']\n Budget integer, -- example: [7500000, 13000000]\n Gross integer, -- example: [296000000, 145793296]\n `Release Date` text, -- example: ['1989-10-12', '1989-12-13']\n Genre text, -- example: ['Romance', 'Comedy']\n Runtime integer, -- example: [93, 99]\n Rating real, -- example: [5.9, 7.4]\n `Rating Count` integer, -- example: [73638, 91075]\n Summary text, -- example: ['After a single, career-minded woman is l', 'An old Jewish woman and her African-Amer']\n PRIMARY KEY (MovieID)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nmale refers to Gender = 'Male'; born in USA refers to Birth Country = 'USA'; Ghost refers to Title = 'Ghost'\nCount the male actors born in USA that starred in Ghost.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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 actor (\n ActorID integer, -- example: [1, 2]\n `Date of Birth` date, -- example: ['1954-12-28', '1954-12-22', '1954-02-18', '1951-01-12']\n Ethnicity text, -- example: ['African American', 'White']\n PRIMARY KEY (ActorID)\n);\n\nCREATE TABLE movie (\n MovieID integer, -- example: [1, 2]\n Runtime integer, -- example: [93, 99]\n PRIMARY KEY (MovieID)\n);\n\nCREATE TABLE characters (\n MovieID integer, -- example: [1, 2]\n ActorID integer, -- example: [1, 2]\n `Character Name` text, -- example: ['James', 'Mollie']\n creditOrder integer, -- example: [1, 2]\n PRIMARY KEY (MovieID, ActorID),\n CONSTRAINT fk_characters_movieid FOREIGN KEY (MovieID) REFERENCES movie (MovieID),\n CONSTRAINT fk_characters_actorid FOREIGN KEY (ActorID) REFERENCES actor (ActorID)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nAfrican-American refers to Ethnicity = 'African American'; born on December 28 1954 refers to Date of Birth = '1954-12-28'\nList the runtime of movies starred by an African-American actor born on December 28, 1954.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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.Runtime FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID INNER JOIN actor AS T3 ON T3.ActorID = T2.ActorID WHERE T3.Ethnicity = 'African American' AND T3.`Date of Birth` = '1954-12-28'",
"style": "rule"
} | {
"db_id": "movie.sqlite",
"gt_sql": "SELECT T1.Runtime FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID INNER JOIN actor AS T3 ON T3.ActorID = T2.ActorID WHERE T3.Ethnicity = 'African American' AND T3.`Date of Birth` = '1954-12-28'",
"index": 382,
"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 actor (\n ActorID integer, -- example: [1, 2]\n `Date of Birth` date, -- example: ['1954-12-28', '1954-12-22', '1954-02-18', '1951-01-12']\n Ethnicity text, -- example: ['African American', 'White']\n PRIMARY KEY (ActorID)\n);\n\nCREATE TABLE movie (\n MovieID integer, -- example: [1, 2]\n Runtime integer, -- example: [93, 99]\n PRIMARY KEY (MovieID)\n);\n\nCREATE TABLE characters (\n MovieID integer, -- example: [1, 2]\n ActorID integer, -- example: [1, 2]\n `Character Name` text, -- example: ['James', 'Mollie']\n creditOrder integer, -- example: [1, 2]\n PRIMARY KEY (MovieID, ActorID),\n CONSTRAINT fk_characters_movieid FOREIGN KEY (MovieID) REFERENCES movie (MovieID),\n CONSTRAINT fk_characters_actorid FOREIGN KEY (ActorID) REFERENCES actor (ActorID)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nAfrican-American refers to Ethnicity = 'African American'; born on December 28 1954 refers to Date of Birth = '1954-12-28'\nList the runtime of movies starred by an African-American actor born on December 28, 1954.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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 movie (\n MovieID integer, -- example: [1, 2]\n Title text, -- example: [\"Look Who's Talking\", 'Driving Miss Daisy']\n `MPAA Rating` text, -- motion picture association of america rating, example: ['PG-13', 'PG']\n Budget integer, -- example: [7500000, 13000000]\n Gross integer, -- example: [296000000, 145793296]\n `Release Date` text, -- example: ['1989-10-12', '1989-12-13']\n Genre text, -- example: ['Drama', 'Romance', 'Comedy']\n Runtime integer, -- example: [93, 99]\n `Rating Count` integer, -- example: [73638, 91075]\n Summary text, -- example: ['After a single, career-minded woman is l', 'An old Jewish woman and her African-Amer']\n PRIMARY KEY (MovieID)\n);\n\nCREATE TABLE actor (\n ActorID integer, -- example: [1, 2]\n Name text, -- example: ['John Travolta', 'Kirstie Alley']\n `Date of Birth` date, -- example: ['1954-02-18', '1951-01-12']\n `Birth City` text, -- example: ['Englewood', 'Wichita']\n `Height (Inches)` integer, -- height inches, example: [74, 67]\n Biography text, -- example: ['John Joseph Travolta was born in Englewo', 'Long a vital, respected lady of the clas']\n Gender text, -- example: ['Male', 'Female']\n NetWorth text, -- example: ['$250,000,000.00', '$40,000,000.00']\n PRIMARY KEY (ActorID)\n);\n\nCREATE TABLE characters (\n MovieID integer, -- example: [1, 2]\n ActorID integer, -- example: [1, 2]\n `Character Name` text, -- example: ['Don Altobello', 'Don', 'James', 'Mollie']\n creditOrder integer, -- example: [1, 2]\n pay text, -- example: ['$5,000,000.00', '$60,000,000.00']\n PRIMARY KEY (MovieID, ActorID),\n CONSTRAINT fk_characters_movieid FOREIGN KEY (MovieID) REFERENCES movie (MovieID),\n CONSTRAINT fk_characters_actorid FOREIGN KEY (ActorID) REFERENCES actor (ActorID)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nactor's name refers to Name; as Don Altobello refers to Character Name = 'Don Altobello'; drama movie refers to Genre = 'Drama'\nFind the actor's name that played as Don Altobello in a drama movie that has a gross of 136766062.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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.Name FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID INNER JOIN actor AS T3 ON T3.ActorID = T2.ActorID WHERE T1.Gross = 136766062 AND T2.`Character Name` = 'Don Altobello' AND T1.Genre = 'Drama'",
"style": "rule"
} | {
"db_id": "movie.sqlite",
"gt_sql": "SELECT T3.Name FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID INNER JOIN actor AS T3 ON T3.ActorID = T2.ActorID WHERE T1.Gross = 136766062 AND T2.`Character Name` = 'Don Altobello' AND T1.Genre = 'Drama'",
"index": 383,
"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 movie (\n MovieID integer, -- example: [1, 2]\n Title text, -- example: [\"Look Who's Talking\", 'Driving Miss Daisy']\n `MPAA Rating` text, -- motion picture association of america rating, example: ['PG-13', 'PG']\n Budget integer, -- example: [7500000, 13000000]\n Gross integer, -- example: [296000000, 145793296]\n `Release Date` text, -- example: ['1989-10-12', '1989-12-13']\n Genre text, -- example: ['Drama', 'Romance', 'Comedy']\n Runtime integer, -- example: [93, 99]\n `Rating Count` integer, -- example: [73638, 91075]\n Summary text, -- example: ['After a single, career-minded woman is l', 'An old Jewish woman and her African-Amer']\n PRIMARY KEY (MovieID)\n);\n\nCREATE TABLE actor (\n ActorID integer, -- example: [1, 2]\n Name text, -- example: ['John Travolta', 'Kirstie Alley']\n `Date of Birth` date, -- example: ['1954-02-18', '1951-01-12']\n `Birth City` text, -- example: ['Englewood', 'Wichita']\n `Height (Inches)` integer, -- height inches, example: [74, 67]\n Biography text, -- example: ['John Joseph Travolta was born in Englewo', 'Long a vital, respected lady of the clas']\n Gender text, -- example: ['Male', 'Female']\n NetWorth text, -- example: ['$250,000,000.00', '$40,000,000.00']\n PRIMARY KEY (ActorID)\n);\n\nCREATE TABLE characters (\n MovieID integer, -- example: [1, 2]\n ActorID integer, -- example: [1, 2]\n `Character Name` text, -- example: ['Don Altobello', 'Don', 'James', 'Mollie']\n creditOrder integer, -- example: [1, 2]\n pay text, -- example: ['$5,000,000.00', '$60,000,000.00']\n PRIMARY KEY (MovieID, ActorID),\n CONSTRAINT fk_characters_movieid FOREIGN KEY (MovieID) REFERENCES movie (MovieID),\n CONSTRAINT fk_characters_actorid FOREIGN KEY (ActorID) REFERENCES actor (ActorID)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nactor's name refers to Name; as Don Altobello refers to Character Name = 'Don Altobello'; drama movie refers to Genre = 'Drama'\nFind the actor's name that played as Don Altobello in a drama movie that has a gross of 136766062.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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 movie (\n MovieID integer, -- example: [1, 2]\n Title text, -- example: [\"Look Who's Talking\", 'Driving Miss Daisy']\n `MPAA Rating` text, -- motion picture association of america rating, example: ['PG-13', 'PG']\n Budget integer, -- example: [7500000, 13000000]\n Gross integer, -- example: [296000000, 145793296]\n `Release Date` text, -- example: ['1989-10-12', '1989-12-13']\n Genre text, -- example: ['Romance', 'Comedy']\n Runtime integer, -- example: [93, 99]\n Rating real, -- example: [5.9, 7.4]\n `Rating Count` integer, -- example: [73638, 91075]\n Summary text, -- example: ['After a single, career-minded woman is l', 'An old Jewish woman and her African-Amer']\n PRIMARY KEY (MovieID)\n);\n\nCREATE TABLE characters (\n MovieID integer, -- example: [1, 2]\n ActorID integer, -- example: [1, 2]\n `Character Name` text, -- example: ['Jackie', 'James', 'Mollie']\n creditOrder integer, -- example: [1, 2]\n pay text, -- example: ['$5,000,000.00', '$60,000,000.00']\n screentime text, -- example: ['0:32:30', '0:32:15']\n PRIMARY KEY (MovieID, ActorID),\n CONSTRAINT fk_characters_movieid FOREIGN KEY (MovieID) REFERENCES movie (MovieID),\n CONSTRAINT fk_characters_actorid FOREIGN KEY (ActorID) REFERENCES actor (ActorID)\n);\n\nCREATE TABLE actor (\n ActorID integer, -- example: [1, 2]\n Name text, -- example: ['Jackie Chan', 'John Travolta', 'Kirstie Alley']\n `Date of Birth` date, -- example: ['1954-02-18', '1951-01-12']\n `Birth City` text, -- example: ['Englewood', 'Wichita']\n `Birth Country` text, -- example: ['USA', 'West Germany']\n `Height (Inches)` integer, -- height inches, example: [74, 67]\n Biography text, -- example: ['John Joseph Travolta was born in Englewo', 'Long a vital, respected lady of the clas']\n Gender text, -- example: ['Male', 'Female']\n Ethnicity text, -- example: ['White', 'African American']\n NetWorth text, -- example: ['$250,000,000.00', '$40,000,000.00']\n PRIMARY KEY (ActorID)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nstarred by Jackie Chan refers to Name = 'Jackie Chan'; rating greater than 7 refers to Rating > 7\nWhat is the runtime of the movie starred by Jackie Chan with a rating greater than 7?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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.Runtime FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID INNER JOIN actor AS T3 ON T3.ActorID = T2.ActorID WHERE T3.Name = 'Jackie Chan' AND T1.Rating > 7",
"style": "rule"
} | {
"db_id": "movie.sqlite",
"gt_sql": "SELECT T1.Runtime FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID INNER JOIN actor AS T3 ON T3.ActorID = T2.ActorID WHERE T3.Name = 'Jackie Chan' AND T1.Rating > 7",
"index": 384,
"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 movie (\n MovieID integer, -- example: [1, 2]\n Title text, -- example: [\"Look Who's Talking\", 'Driving Miss Daisy']\n `MPAA Rating` text, -- motion picture association of america rating, example: ['PG-13', 'PG']\n Budget integer, -- example: [7500000, 13000000]\n Gross integer, -- example: [296000000, 145793296]\n `Release Date` text, -- example: ['1989-10-12', '1989-12-13']\n Genre text, -- example: ['Romance', 'Comedy']\n Runtime integer, -- example: [93, 99]\n Rating real, -- example: [5.9, 7.4]\n `Rating Count` integer, -- example: [73638, 91075]\n Summary text, -- example: ['After a single, career-minded woman is l', 'An old Jewish woman and her African-Amer']\n PRIMARY KEY (MovieID)\n);\n\nCREATE TABLE characters (\n MovieID integer, -- example: [1, 2]\n ActorID integer, -- example: [1, 2]\n `Character Name` text, -- example: ['Jackie', 'James', 'Mollie']\n creditOrder integer, -- example: [1, 2]\n pay text, -- example: ['$5,000,000.00', '$60,000,000.00']\n screentime text, -- example: ['0:32:30', '0:32:15']\n PRIMARY KEY (MovieID, ActorID),\n CONSTRAINT fk_characters_movieid FOREIGN KEY (MovieID) REFERENCES movie (MovieID),\n CONSTRAINT fk_characters_actorid FOREIGN KEY (ActorID) REFERENCES actor (ActorID)\n);\n\nCREATE TABLE actor (\n ActorID integer, -- example: [1, 2]\n Name text, -- example: ['Jackie Chan', 'John Travolta', 'Kirstie Alley']\n `Date of Birth` date, -- example: ['1954-02-18', '1951-01-12']\n `Birth City` text, -- example: ['Englewood', 'Wichita']\n `Birth Country` text, -- example: ['USA', 'West Germany']\n `Height (Inches)` integer, -- height inches, example: [74, 67]\n Biography text, -- example: ['John Joseph Travolta was born in Englewo', 'Long a vital, respected lady of the clas']\n Gender text, -- example: ['Male', 'Female']\n Ethnicity text, -- example: ['White', 'African American']\n NetWorth text, -- example: ['$250,000,000.00', '$40,000,000.00']\n PRIMARY KEY (ActorID)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nstarred by Jackie Chan refers to Name = 'Jackie Chan'; rating greater than 7 refers to Rating > 7\nWhat is the runtime of the movie starred by Jackie Chan with a rating greater than 7?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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 characters (\n MovieID integer, -- example: [1, 2]\n ActorID integer, -- example: [1, 2]\n `Character Name` text, -- example: ['James', 'Mollie']\n PRIMARY KEY (MovieID, ActorID),\n CONSTRAINT fk_characters_movieid FOREIGN KEY (MovieID) REFERENCES movie (MovieID),\n CONSTRAINT fk_characters_actorid FOREIGN KEY (ActorID) REFERENCES actor (ActorID)\n);\n\nCREATE TABLE movie (\n MovieID integer, -- example: [1, 2]\n Title text, -- example: ['Bruce Almighty', \"Look Who's Talking\", 'Driving Miss Daisy']\n PRIMARY KEY (MovieID)\n);\n\nCREATE TABLE actor (\n ActorID integer, -- example: [1, 2]\n Name text, -- example: ['John Travolta', 'Kirstie Alley']\n `Birth City` text, -- example: ['Sherman Oaks', 'Englewood', 'Wichita']\n `Height (Inches)` integer, -- height inches, example: [74, 67]\n Biography text, -- example: ['John Joseph Travolta was born in Englewo', 'Long a vital, respected lady of the clas']\n Gender text, -- example: ['Female', 'Male']\n PRIMARY KEY (ActorID)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nactress refers to Gender = 'Female'; born in Sherman Oaks refers to Birth City = 'Sherman Oaks'; movie Bruce Almighty refers to Title = 'Bruce Almighty'; height greater than the 50% of average height refers to Height (Inches) > multiply(avg(Height (Inches)), 0.5)\nList the character's name of actress born in Sherman Oaks and starred in the movie Bruce Almighty with height greater than the 50% of average height of all actors 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 T3.Name FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID INNER JOIN actor AS T3 ON T3.ActorID = T2.ActorID WHERE T3.Gender = 'Female' AND T1.Title = 'Godzilla' AND T3.`Birth City` = 'Sherman Oaks' AND T3.`Height (Inches)` * 100 > ( SELECT AVG(`Height (Inches)`) FROM actor ) * 50",
"style": "rule"
} | {
"db_id": "movie.sqlite",
"gt_sql": "SELECT T3.Name FROM movie AS T1 INNER JOIN characters AS T2 ON T1.MovieID = T2.MovieID INNER JOIN actor AS T3 ON T3.ActorID = T2.ActorID WHERE T3.Gender = 'Female' AND T1.Title = 'Godzilla' AND T3.`Birth City` = 'Sherman Oaks' AND T3.`Height (Inches)` * 100 > ( SELECT AVG(`Height (Inches)`) FROM actor ) * 50",
"index": 385,
"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 MovieID integer, -- example: [1, 2]\n ActorID integer, -- example: [1, 2]\n `Character Name` text, -- example: ['James', 'Mollie']\n PRIMARY KEY (MovieID, ActorID),\n CONSTRAINT fk_characters_movieid FOREIGN KEY (MovieID) REFERENCES movie (MovieID),\n CONSTRAINT fk_characters_actorid FOREIGN KEY (ActorID) REFERENCES actor (ActorID)\n);\n\nCREATE TABLE movie (\n MovieID integer, -- example: [1, 2]\n Title text, -- example: ['Bruce Almighty', \"Look Who's Talking\", 'Driving Miss Daisy']\n PRIMARY KEY (MovieID)\n);\n\nCREATE TABLE actor (\n ActorID integer, -- example: [1, 2]\n Name text, -- example: ['John Travolta', 'Kirstie Alley']\n `Birth City` text, -- example: ['Sherman Oaks', 'Englewood', 'Wichita']\n `Height (Inches)` integer, -- height inches, example: [74, 67]\n Biography text, -- example: ['John Joseph Travolta was born in Englewo', 'Long a vital, respected lady of the clas']\n Gender text, -- example: ['Female', 'Male']\n PRIMARY KEY (ActorID)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nactress refers to Gender = 'Female'; born in Sherman Oaks refers to Birth City = 'Sherman Oaks'; movie Bruce Almighty refers to Title = 'Bruce Almighty'; height greater than the 50% of average height refers to Height (Inches) > multiply(avg(Height (Inches)), 0.5)\nList the character's name of actress born in Sherman Oaks and starred in the movie Bruce Almighty with height greater than the 50% of average height of all actors 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 location (\n LocationID integer, -- example: [1, 2]\n Country text, -- example: ['Albania', 'Algeria']\n State text, -- example: ['Elbasan', 'Tirane']\n StateCode text, -- example: ['AL', 'DZ']\n City text, -- example: ['Elbasan', 'Tirana']\n PRIMARY KEY (LocationID)\n);\n\nCREATE TABLE `user` (\n UserID text, -- example: ['\\x1anknow531394', 'tw-10000632']\n Gender text, -- example: ['Unknown', 'Male']\n PRIMARY KEY (UserID)\n);\n\nCREATE TABLE twitter (\n TweetID text, -- example: ['tw-682712873332805633', 'tw-682713045357998080']\n Weekday text, -- example: ['Thursday', 'Friday']\n `Day` integer, -- example: [31, 1]\n Lang text, -- language, example: ['en', '_u']\n IsReshare text, -- example: ['FALSE', 'TRUE']\n Reach integer, -- example: [44, 1810]\n RetweetCount integer, -- example: [0, 5]\n Likes integer, -- example: [0, 131]\n Sentiment real, -- example: [0.0, 2.0]\n text text, -- example: ['We are hiring: Senior Software Engineer ', 'RT @CodeMineStatus: This is true Amazon ']\n LocationID integer, -- example: [3751, 3989]\n UserID text, -- example: ['tw-40932430', 'tw-3179389829']\n PRIMARY KEY (TweetID),\n CONSTRAINT fk_twitter_locationid FOREIGN KEY (LocationID) REFERENCES location (LocationID),\n CONSTRAINT fk_twitter_userid FOREIGN KEY (UserID) REFERENCES `user` (UserID)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\npositive sentiment refers to Sentiment > 0; posted on Thursday refers to Weekday = 'Thursday'\nAmong all the tweets that have a positive sentiment, how many of them are posted on Thursday?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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(TweetID) AS tweet_number FROM twitter WHERE Sentiment > 0 AND Weekday = 'Thursday'",
"style": "rule"
} | {
"db_id": "social_media.sqlite",
"gt_sql": "SELECT COUNT(TweetID) AS tweet_number FROM twitter WHERE Sentiment > 0 AND Weekday = 'Thursday'",
"index": 386,
"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 location (\n LocationID integer, -- example: [1, 2]\n Country text, -- example: ['Albania', 'Algeria']\n State text, -- example: ['Elbasan', 'Tirane']\n StateCode text, -- example: ['AL', 'DZ']\n City text, -- example: ['Elbasan', 'Tirana']\n PRIMARY KEY (LocationID)\n);\n\nCREATE TABLE `user` (\n UserID text, -- example: ['\\x1anknow531394', 'tw-10000632']\n Gender text, -- example: ['Unknown', 'Male']\n PRIMARY KEY (UserID)\n);\n\nCREATE TABLE twitter (\n TweetID text, -- example: ['tw-682712873332805633', 'tw-682713045357998080']\n Weekday text, -- example: ['Thursday', 'Friday']\n `Day` integer, -- example: [31, 1]\n Lang text, -- language, example: ['en', '_u']\n IsReshare text, -- example: ['FALSE', 'TRUE']\n Reach integer, -- example: [44, 1810]\n RetweetCount integer, -- example: [0, 5]\n Likes integer, -- example: [0, 131]\n Sentiment real, -- example: [0.0, 2.0]\n text text, -- example: ['We are hiring: Senior Software Engineer ', 'RT @CodeMineStatus: This is true Amazon ']\n LocationID integer, -- example: [3751, 3989]\n UserID text, -- example: ['tw-40932430', 'tw-3179389829']\n PRIMARY KEY (TweetID),\n CONSTRAINT fk_twitter_locationid FOREIGN KEY (LocationID) REFERENCES location (LocationID),\n CONSTRAINT fk_twitter_userid FOREIGN KEY (UserID) REFERENCES `user` (UserID)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\npositive sentiment refers to Sentiment > 0; posted on Thursday refers to Weekday = 'Thursday'\nAmong all the tweets that have a positive sentiment, how many of them are posted on Thursday?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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 `user` (\n UserID text, -- example: ['\\x1anknow531394', 'tw-10000632']\n PRIMARY KEY (UserID)\n);\n\nCREATE TABLE twitter (\n TweetID text, -- example: ['tw-682712873332805633', 'tw-682713045357998080']\n Lang text, -- language, example: ['en', '_u']\n LocationID integer, -- example: [3751, 3989]\n UserID text, -- example: ['tw-40932430', 'tw-3179389829']\n PRIMARY KEY (TweetID),\n CONSTRAINT fk_twitter_locationid FOREIGN KEY (LocationID) REFERENCES location (LocationID),\n CONSTRAINT fk_twitter_userid FOREIGN KEY (UserID) REFERENCES `user` (UserID)\n);\n\nCREATE TABLE location (\n LocationID integer, -- example: [1, 2]\n Country text, -- example: ['Argentina', 'Albania', 'Algeria']\n State text, -- example: ['Elbasan', 'Tirane']\n StateCode text, -- example: ['AL', 'DZ']\n City text, -- example: ['Elbasan', 'Tirana']\n PRIMARY KEY (LocationID)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\n\"Argentina\" is the Country; post the most tweets refers to Max(Count(TweetID))\nUsers in which city of Argentina post the most tweets?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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.City FROM twitter AS T1 INNER JOIN location AS T2 ON T2.LocationID = T1.LocationID WHERE T2.Country = 'Argentina' GROUP BY T2.City ORDER BY COUNT(T1.TweetID) DESC LIMIT 1",
"style": "rule"
} | {
"db_id": "social_media.sqlite",
"gt_sql": "SELECT T2.City FROM twitter AS T1 INNER JOIN location AS T2 ON T2.LocationID = T1.LocationID WHERE T2.Country = 'Argentina' GROUP BY T2.City ORDER BY COUNT(T1.TweetID) DESC LIMIT 1",
"index": 387,
"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 `user` (\n UserID text, -- example: ['\\x1anknow531394', 'tw-10000632']\n PRIMARY KEY (UserID)\n);\n\nCREATE TABLE twitter (\n TweetID text, -- example: ['tw-682712873332805633', 'tw-682713045357998080']\n Lang text, -- language, example: ['en', '_u']\n LocationID integer, -- example: [3751, 3989]\n UserID text, -- example: ['tw-40932430', 'tw-3179389829']\n PRIMARY KEY (TweetID),\n CONSTRAINT fk_twitter_locationid FOREIGN KEY (LocationID) REFERENCES location (LocationID),\n CONSTRAINT fk_twitter_userid FOREIGN KEY (UserID) REFERENCES `user` (UserID)\n);\n\nCREATE TABLE location (\n LocationID integer, -- example: [1, 2]\n Country text, -- example: ['Argentina', 'Albania', 'Algeria']\n State text, -- example: ['Elbasan', 'Tirane']\n StateCode text, -- example: ['AL', 'DZ']\n City text, -- example: ['Elbasan', 'Tirana']\n PRIMARY KEY (LocationID)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\n\"Argentina\" is the Country; post the most tweets refers to Max(Count(TweetID))\nUsers in which city of Argentina post the most tweets?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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 twitter (\n TweetID text, -- example: ['tw-682712873332805633', 'tw-682713045357998080']\n Lang text, -- language, example: ['en', '_u']\n IsReshare text, -- example: ['FALSE', 'TRUE']\n Sentiment real, -- example: [0.0, 2.0]\n LocationID integer, -- example: [3751, 3989]\n UserID text, -- example: ['tw-40932430', 'tw-3179389829']\n PRIMARY KEY (TweetID),\n CONSTRAINT fk_twitter_locationid FOREIGN KEY (LocationID) REFERENCES location (LocationID),\n CONSTRAINT fk_twitter_userid FOREIGN KEY (UserID) REFERENCES `user` (UserID)\n);\n\nCREATE TABLE `user` (\n UserID text, -- example: ['\\x1anknow531394', 'tw-10000632']\n PRIMARY KEY (UserID)\n);\n\nCREATE TABLE location (\n LocationID integer, -- example: [1, 2]\n Country text, -- example: ['Australia', 'Argentina', 'Albania', 'Algeria']\n PRIMARY KEY (LocationID)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\n\"Argentina\" and \"Australia\" are both Country; positive tweets refers to Sentiment > 0; Country posted more number of tweets refers to Country where Max(Count(TweetID))\nUsers in which country has posted more numbers of positive tweets, Argentina or Australia?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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.Country FROM twitter AS T1 INNER JOIN location AS T2 ON T2.LocationID = T1.LocationID WHERE T2.Country IN ('Argentina', 'Australia') AND T1.Sentiment > 0 GROUP BY T2.Country ORDER BY COUNT(T1.TweetID) DESC LIMIT 1",
"style": "rule"
} | {
"db_id": "social_media.sqlite",
"gt_sql": "SELECT T2.Country FROM twitter AS T1 INNER JOIN location AS T2 ON T2.LocationID = T1.LocationID WHERE T2.Country IN ('Argentina', 'Australia') AND T1.Sentiment > 0 GROUP BY T2.Country ORDER BY COUNT(T1.TweetID) DESC LIMIT 1",
"index": 388,
"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 twitter (\n TweetID text, -- example: ['tw-682712873332805633', 'tw-682713045357998080']\n Lang text, -- language, example: ['en', '_u']\n IsReshare text, -- example: ['FALSE', 'TRUE']\n Sentiment real, -- example: [0.0, 2.0]\n LocationID integer, -- example: [3751, 3989]\n UserID text, -- example: ['tw-40932430', 'tw-3179389829']\n PRIMARY KEY (TweetID),\n CONSTRAINT fk_twitter_locationid FOREIGN KEY (LocationID) REFERENCES location (LocationID),\n CONSTRAINT fk_twitter_userid FOREIGN KEY (UserID) REFERENCES `user` (UserID)\n);\n\nCREATE TABLE `user` (\n UserID text, -- example: ['\\x1anknow531394', 'tw-10000632']\n PRIMARY KEY (UserID)\n);\n\nCREATE TABLE location (\n LocationID integer, -- example: [1, 2]\n Country text, -- example: ['Australia', 'Argentina', 'Albania', 'Algeria']\n PRIMARY KEY (LocationID)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\n\"Argentina\" and \"Australia\" are both Country; positive tweets refers to Sentiment > 0; Country posted more number of tweets refers to Country where Max(Count(TweetID))\nUsers in which country has posted more numbers of positive tweets, Argentina or Australia?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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 location (\n LocationID integer, -- example: [1, 2]\n Country text, -- example: ['Albania', 'Algeria']\n State text, -- example: ['Buenos Aires', 'Elbasan', 'Tirane']\n StateCode text, -- example: ['AL', 'DZ']\n City text, -- example: ['Buenos Aires', 'Elbasan', 'Tirana']\n PRIMARY KEY (LocationID)\n);\n\nCREATE TABLE `user` (\n UserID text, -- example: ['\\x1anknow531394', 'tw-10000632']\n Gender text, -- example: ['Unknown', 'Male']\n PRIMARY KEY (UserID)\n);\n\nCREATE TABLE twitter (\n TweetID text, -- example: ['tw-682712873332805633', 'tw-682713045357998080']\n Weekday text, -- example: ['Thursday', 'Friday']\n `Day` integer, -- example: [31, 1]\n Lang text, -- language, example: ['en', '_u']\n IsReshare text, -- example: ['FALSE', 'TRUE']\n RetweetCount integer, -- example: [0, 5]\n LocationID integer, -- example: [3751, 3989]\n UserID text, -- example: ['tw-40932430', 'tw-3179389829']\n PRIMARY KEY (TweetID),\n CONSTRAINT fk_twitter_locationid FOREIGN KEY (LocationID) REFERENCES location (LocationID),\n CONSTRAINT fk_twitter_userid FOREIGN KEY (UserID) REFERENCES `user` (UserID)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\n\"Buenos Aires\" is the City; posted on Thursday refers to Weekday = 'Thursday'\nAmong all the tweets posted from Buenos Aires, how many of them were posted on Thursdays?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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.TweetID) FROM twitter AS T1 INNER JOIN location AS T2 ON T2.LocationID = T1.LocationID WHERE T2.City = 'Buenos Aires' AND T1.Weekday = 'Thursday'",
"style": "rule"
} | {
"db_id": "social_media.sqlite",
"gt_sql": "SELECT COUNT(T1.TweetID) FROM twitter AS T1 INNER JOIN location AS T2 ON T2.LocationID = T1.LocationID WHERE T2.City = 'Buenos Aires' AND T1.Weekday = 'Thursday'",
"index": 389,
"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 location (\n LocationID integer, -- example: [1, 2]\n Country text, -- example: ['Albania', 'Algeria']\n State text, -- example: ['Buenos Aires', 'Elbasan', 'Tirane']\n StateCode text, -- example: ['AL', 'DZ']\n City text, -- example: ['Buenos Aires', 'Elbasan', 'Tirana']\n PRIMARY KEY (LocationID)\n);\n\nCREATE TABLE `user` (\n UserID text, -- example: ['\\x1anknow531394', 'tw-10000632']\n Gender text, -- example: ['Unknown', 'Male']\n PRIMARY KEY (UserID)\n);\n\nCREATE TABLE twitter (\n TweetID text, -- example: ['tw-682712873332805633', 'tw-682713045357998080']\n Weekday text, -- example: ['Thursday', 'Friday']\n `Day` integer, -- example: [31, 1]\n Lang text, -- language, example: ['en', '_u']\n IsReshare text, -- example: ['FALSE', 'TRUE']\n RetweetCount integer, -- example: [0, 5]\n LocationID integer, -- example: [3751, 3989]\n UserID text, -- example: ['tw-40932430', 'tw-3179389829']\n PRIMARY KEY (TweetID),\n CONSTRAINT fk_twitter_locationid FOREIGN KEY (LocationID) REFERENCES location (LocationID),\n CONSTRAINT fk_twitter_userid FOREIGN KEY (UserID) REFERENCES `user` (UserID)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\n\"Buenos Aires\" is the City; posted on Thursday refers to Weekday = 'Thursday'\nAmong all the tweets posted from Buenos Aires, how many of them were posted on Thursdays?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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 twitter (\n TweetID text, -- example: ['tw-682712873332805633', 'tw-682713045357998080']\n `Hour` integer, -- example: [17, 18]\n Lang text, -- language, example: ['en', '_u']\n IsReshare text, -- example: ['FALSE', 'TRUE']\n RetweetCount integer, -- example: [0, 5]\n Likes integer, -- example: [0, 131]\n Sentiment real, -- example: [0.0, 2.0]\n text text, -- example: ['We are hiring: Senior Software Engineer ', 'RT @CodeMineStatus: This is true Amazon ']\n LocationID integer, -- example: [3751, 3989]\n UserID text, -- example: ['tw-40932430', 'tw-3179389829']\n PRIMARY KEY (TweetID),\n CONSTRAINT fk_twitter_locationid FOREIGN KEY (LocationID) REFERENCES location (LocationID),\n CONSTRAINT fk_twitter_userid FOREIGN KEY (UserID) REFERENCES `user` (UserID)\n);\n\nCREATE TABLE location (\n LocationID integer, -- example: [1, 2]\n Country text, -- example: ['Albania', 'Algeria']\n State text, -- example: ['Elbasan', 'Tirane']\n StateCode text, -- example: ['AL', 'DZ']\n City text, -- example: ['Elbasan', 'Tirana']\n PRIMARY KEY (LocationID)\n);\n\nCREATE TABLE `user` (\n UserID text, -- example: ['\\x1anknow531394', 'tw-10000632']\n Gender text, -- example: ['Male', 'Unknown']\n PRIMARY KEY (UserID)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nover 1000 likes refers to Likes > 1000; 'Male' is the Gender of user\nAmong all the users that have posted a tweet with over 1000 likes, how many of them are male?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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.TweetID) FROM twitter AS T1 INNER JOIN user AS T2 ON T1.UserID = T2.UserID WHERE T1.Likes > 10 AND T2.Gender = 'Male'",
"style": "rule"
} | {
"db_id": "social_media.sqlite",
"gt_sql": "SELECT COUNT(T1.TweetID) FROM twitter AS T1 INNER JOIN user AS T2 ON T1.UserID = T2.UserID WHERE T1.Likes > 10 AND T2.Gender = 'Male'",
"index": 390,
"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 twitter (\n TweetID text, -- example: ['tw-682712873332805633', 'tw-682713045357998080']\n `Hour` integer, -- example: [17, 18]\n Lang text, -- language, example: ['en', '_u']\n IsReshare text, -- example: ['FALSE', 'TRUE']\n RetweetCount integer, -- example: [0, 5]\n Likes integer, -- example: [0, 131]\n Sentiment real, -- example: [0.0, 2.0]\n text text, -- example: ['We are hiring: Senior Software Engineer ', 'RT @CodeMineStatus: This is true Amazon ']\n LocationID integer, -- example: [3751, 3989]\n UserID text, -- example: ['tw-40932430', 'tw-3179389829']\n PRIMARY KEY (TweetID),\n CONSTRAINT fk_twitter_locationid FOREIGN KEY (LocationID) REFERENCES location (LocationID),\n CONSTRAINT fk_twitter_userid FOREIGN KEY (UserID) REFERENCES `user` (UserID)\n);\n\nCREATE TABLE location (\n LocationID integer, -- example: [1, 2]\n Country text, -- example: ['Albania', 'Algeria']\n State text, -- example: ['Elbasan', 'Tirane']\n StateCode text, -- example: ['AL', 'DZ']\n City text, -- example: ['Elbasan', 'Tirana']\n PRIMARY KEY (LocationID)\n);\n\nCREATE TABLE `user` (\n UserID text, -- example: ['\\x1anknow531394', 'tw-10000632']\n Gender text, -- example: ['Male', 'Unknown']\n PRIMARY KEY (UserID)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nover 1000 likes refers to Likes > 1000; 'Male' is the Gender of user\nAmong all the users that have posted a tweet with over 1000 likes, how many of them are male?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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 location (\n LocationID integer, -- example: [1, 2]\n Country text, -- example: ['Albania', 'Algeria']\n State text, -- example: ['Buenos Aires', 'Elbasan', 'Tirane']\n StateCode text, -- example: ['AL', 'DZ']\n City text, -- example: ['Buenos Aires', 'Elbasan', 'Tirana']\n PRIMARY KEY (LocationID)\n);\n\nCREATE TABLE `user` (\n UserID text, -- example: ['\\x1anknow531394', 'tw-10000632']\n Gender text, -- example: ['Male', 'Unknown']\n PRIMARY KEY (UserID)\n);\n\nCREATE TABLE twitter (\n TweetID text, -- example: ['tw-682712873332805633', 'tw-682713045357998080']\n Weekday text, -- example: ['Thursday', 'Friday']\n `Hour` integer, -- example: [17, 18]\n `Day` integer, -- example: [31, 1]\n Lang text, -- language, example: ['en', '_u']\n IsReshare text, -- example: ['FALSE', 'TRUE']\n Reach integer, -- example: [44, 1810]\n RetweetCount integer, -- example: [0, 5]\n Likes integer, -- example: [0, 131]\n Klout integer, -- example: [35, 53]\n Sentiment real, -- example: [0.0, 2.0]\n text text, -- example: ['We are hiring: Senior Software Engineer ', 'RT @CodeMineStatus: This is true Amazon ']\n LocationID integer, -- example: [3751, 3989]\n UserID text, -- example: ['tw-40932430', 'tw-3179389829']\n PRIMARY KEY (TweetID),\n CONSTRAINT fk_twitter_locationid FOREIGN KEY (LocationID) REFERENCES location (LocationID),\n CONSTRAINT fk_twitter_userid FOREIGN KEY (UserID) REFERENCES `user` (UserID)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\n\"Buenos Aires\" is the City; male user refers to Gender = 'Male'\nPlease list the texts of all the tweets posted by male users from Buenos Aires.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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.text FROM twitter AS T1 INNER JOIN location AS T2 ON T2.LocationID = T1.LocationID INNER JOIN user AS T2 ON T2.UserID = T1.UserID INNER JOIN user AS T3 ON T1.UserID = T3.UserID WHERE T2.City = 'Buenos Aires' AND T3.Gender = 'Male'",
"style": "rule"
} | {
"db_id": "social_media.sqlite",
"gt_sql": "SELECT T1.text FROM twitter AS T1 INNER JOIN location AS T2 ON T2.LocationID = T1.LocationID INNER JOIN user AS T2 ON T2.UserID = T1.UserID INNER JOIN user AS T3 ON T1.UserID = T3.UserID WHERE T2.City = 'Buenos Aires' AND T3.Gender = 'Male'",
"index": 391,
"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 location (\n LocationID integer, -- example: [1, 2]\n Country text, -- example: ['Albania', 'Algeria']\n State text, -- example: ['Buenos Aires', 'Elbasan', 'Tirane']\n StateCode text, -- example: ['AL', 'DZ']\n City text, -- example: ['Buenos Aires', 'Elbasan', 'Tirana']\n PRIMARY KEY (LocationID)\n);\n\nCREATE TABLE `user` (\n UserID text, -- example: ['\\x1anknow531394', 'tw-10000632']\n Gender text, -- example: ['Male', 'Unknown']\n PRIMARY KEY (UserID)\n);\n\nCREATE TABLE twitter (\n TweetID text, -- example: ['tw-682712873332805633', 'tw-682713045357998080']\n Weekday text, -- example: ['Thursday', 'Friday']\n `Hour` integer, -- example: [17, 18]\n `Day` integer, -- example: [31, 1]\n Lang text, -- language, example: ['en', '_u']\n IsReshare text, -- example: ['FALSE', 'TRUE']\n Reach integer, -- example: [44, 1810]\n RetweetCount integer, -- example: [0, 5]\n Likes integer, -- example: [0, 131]\n Klout integer, -- example: [35, 53]\n Sentiment real, -- example: [0.0, 2.0]\n text text, -- example: ['We are hiring: Senior Software Engineer ', 'RT @CodeMineStatus: This is true Amazon ']\n LocationID integer, -- example: [3751, 3989]\n UserID text, -- example: ['tw-40932430', 'tw-3179389829']\n PRIMARY KEY (TweetID),\n CONSTRAINT fk_twitter_locationid FOREIGN KEY (LocationID) REFERENCES location (LocationID),\n CONSTRAINT fk_twitter_userid FOREIGN KEY (UserID) REFERENCES `user` (UserID)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\n\"Buenos Aires\" is the City; male user refers to Gender = 'Male'\nPlease list the texts of all the tweets posted by male users from Buenos Aires.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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 location (\n LocationID integer, -- example: [1, 2]\n Country text, -- example: ['Argentina', 'Albania', 'Algeria']\n City text, -- example: ['Elbasan', 'Tirana']\n PRIMARY KEY (LocationID)\n);\n\nCREATE TABLE twitter (\n TweetID text, -- example: ['tw-682712873332805633', 'tw-682713045357998080']\n Weekday text, -- example: ['Thursday', 'Friday']\n `Hour` integer, -- example: [17, 18]\n `Day` integer, -- example: [31, 1]\n Lang text, -- language, example: ['en', '_u']\n IsReshare text, -- example: ['FALSE', 'TRUE']\n Sentiment real, -- example: [0.0, 2.0]\n text text, -- example: ['We are hiring: Senior Software Engineer ', 'RT @CodeMineStatus: This is true Amazon ']\n LocationID integer, -- example: [3751, 3989]\n UserID text, -- example: ['tw-40932430', 'tw-3179389829']\n PRIMARY KEY (TweetID),\n CONSTRAINT fk_twitter_locationid FOREIGN KEY (LocationID) REFERENCES location (LocationID),\n CONSTRAINT fk_twitter_userid FOREIGN KEY (UserID) REFERENCES `user` (UserID)\n);\n\nCREATE TABLE `user` (\n UserID text, -- example: ['\\x1anknow531394', 'tw-10000632']\n Gender text, -- example: ['Unknown', 'Male']\n PRIMARY KEY (UserID)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\n\"Argentina\" is the Country; average number of tweets in a city = Divide (Count(TweetID where Country = 'Argentina'), Count (City))\nWhat is the average number of tweets posted by the users in a city in Argentina?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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.City = 'Buenos Aires' THEN 1.0 ELSE 0 END) / COUNT(T1.TweetID) AS avg FROM twitter AS T1 INNER JOIN location AS T2 ON T2.LocationID = T1.LocationID WHERE T2.Country = 'Argentina'",
"style": "rule"
} | {
"db_id": "social_media.sqlite",
"gt_sql": "SELECT SUM(CASE WHEN T2.City = 'Buenos Aires' THEN 1.0 ELSE 0 END) / COUNT(T1.TweetID) AS avg FROM twitter AS T1 INNER JOIN location AS T2 ON T2.LocationID = T1.LocationID WHERE T2.Country = 'Argentina'",
"index": 392,
"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 location (\n LocationID integer, -- example: [1, 2]\n Country text, -- example: ['Argentina', 'Albania', 'Algeria']\n City text, -- example: ['Elbasan', 'Tirana']\n PRIMARY KEY (LocationID)\n);\n\nCREATE TABLE twitter (\n TweetID text, -- example: ['tw-682712873332805633', 'tw-682713045357998080']\n Weekday text, -- example: ['Thursday', 'Friday']\n `Hour` integer, -- example: [17, 18]\n `Day` integer, -- example: [31, 1]\n Lang text, -- language, example: ['en', '_u']\n IsReshare text, -- example: ['FALSE', 'TRUE']\n Sentiment real, -- example: [0.0, 2.0]\n text text, -- example: ['We are hiring: Senior Software Engineer ', 'RT @CodeMineStatus: This is true Amazon ']\n LocationID integer, -- example: [3751, 3989]\n UserID text, -- example: ['tw-40932430', 'tw-3179389829']\n PRIMARY KEY (TweetID),\n CONSTRAINT fk_twitter_locationid FOREIGN KEY (LocationID) REFERENCES location (LocationID),\n CONSTRAINT fk_twitter_userid FOREIGN KEY (UserID) REFERENCES `user` (UserID)\n);\n\nCREATE TABLE `user` (\n UserID text, -- example: ['\\x1anknow531394', 'tw-10000632']\n Gender text, -- example: ['Unknown', 'Male']\n PRIMARY KEY (UserID)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\n\"Argentina\" is the Country; average number of tweets in a city = Divide (Count(TweetID where Country = 'Argentina'), Count (City))\nWhat is the average number of tweets posted by the users in a city in Argentina?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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 twitter (\n TweetID text, -- example: ['tw-682712873332805633', 'tw-682713045357998080']\n Weekday text, -- example: ['Thursday', 'Friday']\n Lang text, -- language, example: ['en', '_u']\n Reach integer, -- example: [44, 1810]\n RetweetCount integer, -- example: [0, 5]\n Likes integer, -- example: [0, 131]\n Sentiment real, -- example: [0.0, 2.0]\n text text, -- example: ['We are hiring: Senior Software Engineer ', 'RT @CodeMineStatus: This is true Amazon ']\n LocationID integer, -- example: [3751, 3989]\n UserID text, -- example: ['tw-40932430', 'tw-3179389829']\n PRIMARY KEY (TweetID),\n CONSTRAINT fk_twitter_locationid FOREIGN KEY (LocationID) REFERENCES location (LocationID),\n CONSTRAINT fk_twitter_userid FOREIGN KEY (UserID) REFERENCES `user` (UserID)\n);\n\nCREATE TABLE `user` (\n UserID text, -- example: ['\\x1anknow531394', 'tw-10000632']\n Gender text, -- example: ['Male', 'Unknown']\n PRIMARY KEY (UserID)\n);\n\nCREATE TABLE location (\n LocationID integer, -- example: [1, 2]\n Country text, -- example: ['Albania', 'Algeria']\n State text, -- example: ['Elbasan', 'Tirane']\n StateCode text, -- example: ['AL', 'DZ']\n City text, -- example: ['Elbasan', 'Tirana']\n PRIMARY KEY (LocationID)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\npositive sentiment refers to Sentiment > 0; male user refers to Gender = 'Male'; percentage = Divide (Count(TweetID where Gender = 'Male'), Count (TweetID)) * 100\nAmong all the tweets with a positive sentiment, what is the percentage of those posted by a male user?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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.Gender = 'Male' THEN 1.0 ELSE 0 END) / COUNT(T1.TweetID) AS per FROM twitter AS T1 INNER JOIN user AS T2 ON T1.UserID = T2.UserID WHERE T1.Sentiment > 0",
"style": "rule"
} | {
"db_id": "social_media.sqlite",
"gt_sql": "SELECT SUM(CASE WHEN T2.Gender = 'Male' THEN 1.0 ELSE 0 END) / COUNT(T1.TweetID) AS per FROM twitter AS T1 INNER JOIN user AS T2 ON T1.UserID = T2.UserID WHERE T1.Sentiment > 0",
"index": 393,
"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 twitter (\n TweetID text, -- example: ['tw-682712873332805633', 'tw-682713045357998080']\n Weekday text, -- example: ['Thursday', 'Friday']\n Lang text, -- language, example: ['en', '_u']\n Reach integer, -- example: [44, 1810]\n RetweetCount integer, -- example: [0, 5]\n Likes integer, -- example: [0, 131]\n Sentiment real, -- example: [0.0, 2.0]\n text text, -- example: ['We are hiring: Senior Software Engineer ', 'RT @CodeMineStatus: This is true Amazon ']\n LocationID integer, -- example: [3751, 3989]\n UserID text, -- example: ['tw-40932430', 'tw-3179389829']\n PRIMARY KEY (TweetID),\n CONSTRAINT fk_twitter_locationid FOREIGN KEY (LocationID) REFERENCES location (LocationID),\n CONSTRAINT fk_twitter_userid FOREIGN KEY (UserID) REFERENCES `user` (UserID)\n);\n\nCREATE TABLE `user` (\n UserID text, -- example: ['\\x1anknow531394', 'tw-10000632']\n Gender text, -- example: ['Male', 'Unknown']\n PRIMARY KEY (UserID)\n);\n\nCREATE TABLE location (\n LocationID integer, -- example: [1, 2]\n Country text, -- example: ['Albania', 'Algeria']\n State text, -- example: ['Elbasan', 'Tirane']\n StateCode text, -- example: ['AL', 'DZ']\n City text, -- example: ['Elbasan', 'Tirana']\n PRIMARY KEY (LocationID)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\npositive sentiment refers to Sentiment > 0; male user refers to Gender = 'Male'; percentage = Divide (Count(TweetID where Gender = 'Male'), Count (TweetID)) * 100\nAmong all the tweets with a positive sentiment, what is the percentage of those posted by a male user?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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 `user` (\n UserID text, -- example: ['\\x1anknow531394', 'tw-10000632']\n PRIMARY KEY (UserID)\n);\n\nCREATE TABLE twitter (\n TweetID text, -- example: ['tw-682712873332805633', 'tw-682713045357998080']\n Weekday text, -- example: ['Thursday', 'Friday']\n `Hour` integer, -- example: [17, 18]\n `Day` integer, -- example: [31, 1]\n RetweetCount integer, -- example: [0, 5]\n Likes integer, -- example: [0, 131]\n LocationID integer, -- example: [3751, 3989]\n UserID text, -- example: ['tw-40932430', 'tw-3179389829']\n PRIMARY KEY (TweetID),\n CONSTRAINT fk_twitter_locationid FOREIGN KEY (LocationID) REFERENCES location (LocationID),\n CONSTRAINT fk_twitter_userid FOREIGN KEY (UserID) REFERENCES `user` (UserID)\n);\n\nCREATE TABLE location (\n LocationID integer, -- example: [1, 2]\n State text, -- example: ['Gwynedd', 'Elbasan', 'Tirane']\n StateCode text, -- example: ['AL', 'DZ']\n PRIMARY KEY (LocationID)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\ncode refers to StateCode\nWhat is the code of Gwynedd State?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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 StateCode FROM location WHERE State = 'Gwynedd'",
"style": "rule"
} | {
"db_id": "social_media.sqlite",
"gt_sql": "SELECT DISTINCT StateCode FROM location WHERE State = 'Gwynedd'",
"index": 394,
"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 `user` (\n UserID text, -- example: ['\\x1anknow531394', 'tw-10000632']\n PRIMARY KEY (UserID)\n);\n\nCREATE TABLE twitter (\n TweetID text, -- example: ['tw-682712873332805633', 'tw-682713045357998080']\n Weekday text, -- example: ['Thursday', 'Friday']\n `Hour` integer, -- example: [17, 18]\n `Day` integer, -- example: [31, 1]\n RetweetCount integer, -- example: [0, 5]\n Likes integer, -- example: [0, 131]\n LocationID integer, -- example: [3751, 3989]\n UserID text, -- example: ['tw-40932430', 'tw-3179389829']\n PRIMARY KEY (TweetID),\n CONSTRAINT fk_twitter_locationid FOREIGN KEY (LocationID) REFERENCES location (LocationID),\n CONSTRAINT fk_twitter_userid FOREIGN KEY (UserID) REFERENCES `user` (UserID)\n);\n\nCREATE TABLE location (\n LocationID integer, -- example: [1, 2]\n State text, -- example: ['Gwynedd', 'Elbasan', 'Tirane']\n StateCode text, -- example: ['AL', 'DZ']\n PRIMARY KEY (LocationID)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\ncode refers to StateCode\nWhat is the code of Gwynedd State?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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 twitter (\n TweetID text, -- example: ['tw-682712873332805633', 'tw-682713045357998080']\n `Day` integer, -- example: [31, 1]\n Reach integer, -- example: [44, 1810]\n Sentiment real, -- example: [0.0, 2.0]\n text text, -- example: ['We are hiring: Senior Software Engineer ', 'RT @CodeMineStatus: This is true Amazon ']\n LocationID integer, -- example: [3751, 3989]\n UserID text, -- example: ['tw-40932430', 'tw-3179389829']\n PRIMARY KEY (TweetID),\n CONSTRAINT fk_twitter_locationid FOREIGN KEY (LocationID) REFERENCES location (LocationID),\n CONSTRAINT fk_twitter_userid FOREIGN KEY (UserID) REFERENCES `user` (UserID)\n);\n\nCREATE TABLE location (\n LocationID integer, -- example: [1, 2]\n Country text, -- example: ['Albania', 'Algeria']\n State text, -- example: ['Elbasan', 'Tirane']\n StateCode text, -- example: ['AL', 'DZ']\n PRIMARY KEY (LocationID)\n);\n\nCREATE TABLE `user` (\n UserID text, -- example: ['\\x1anknow531394', 'tw-10000632']\n PRIMARY KEY (UserID)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nreach number of 547851 refers to Reach = 547851\nFor the tweet which got a reach number of 547851, which country did it come from?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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.Country FROM twitter AS T1 INNER JOIN location AS T2 ON T2.LocationID = T1.LocationID WHERE T1.Reach = 547851",
"style": "rule"
} | {
"db_id": "social_media.sqlite",
"gt_sql": "SELECT T2.Country FROM twitter AS T1 INNER JOIN location AS T2 ON T2.LocationID = T1.LocationID WHERE T1.Reach = 547851",
"index": 395,
"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 twitter (\n TweetID text, -- example: ['tw-682712873332805633', 'tw-682713045357998080']\n `Day` integer, -- example: [31, 1]\n Reach integer, -- example: [44, 1810]\n Sentiment real, -- example: [0.0, 2.0]\n text text, -- example: ['We are hiring: Senior Software Engineer ', 'RT @CodeMineStatus: This is true Amazon ']\n LocationID integer, -- example: [3751, 3989]\n UserID text, -- example: ['tw-40932430', 'tw-3179389829']\n PRIMARY KEY (TweetID),\n CONSTRAINT fk_twitter_locationid FOREIGN KEY (LocationID) REFERENCES location (LocationID),\n CONSTRAINT fk_twitter_userid FOREIGN KEY (UserID) REFERENCES `user` (UserID)\n);\n\nCREATE TABLE location (\n LocationID integer, -- example: [1, 2]\n Country text, -- example: ['Albania', 'Algeria']\n State text, -- example: ['Elbasan', 'Tirane']\n StateCode text, -- example: ['AL', 'DZ']\n PRIMARY KEY (LocationID)\n);\n\nCREATE TABLE `user` (\n UserID text, -- example: ['\\x1anknow531394', 'tw-10000632']\n PRIMARY KEY (UserID)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nreach number of 547851 refers to Reach = 547851\nFor the tweet which got a reach number of 547851, which country did it come from?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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 `user` (\n UserID text, -- example: ['\\x1anknow531394', 'tw-10000632']\n PRIMARY KEY (UserID)\n);\n\nCREATE TABLE twitter (\n TweetID text, -- example: ['tw-682712873332805633', 'tw-682713045357998080']\n Lang text, -- language, example: ['en', '_u']\n IsReshare text, -- example: ['FALSE', 'TRUE']\n Reach integer, -- example: [44, 1810]\n RetweetCount integer, -- example: [0, 5]\n Klout integer, -- example: [35, 53]\n text text, -- example: ['We are hiring: Senior Software Engineer ', 'RT @CodeMineStatus: This is true Amazon ']\n LocationID integer, -- example: [3751, 3989]\n UserID text, -- example: ['tw-40932430', 'tw-3179389829']\n PRIMARY KEY (TweetID),\n CONSTRAINT fk_twitter_locationid FOREIGN KEY (LocationID) REFERENCES location (LocationID),\n CONSTRAINT fk_twitter_userid FOREIGN KEY (UserID) REFERENCES `user` (UserID)\n);\n\nCREATE TABLE location (\n LocationID integer, -- example: [1, 2]\n State text, -- example: ['Connecticut', 'Elbasan', 'Tirane']\n StateCode text, -- example: ['AL', 'DZ']\n PRIMARY KEY (LocationID)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nhighest klout refers to Max(Klout); 'Connecticut' is the State\nShow the text of the tweet with the highest klout from Connecticut.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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.text FROM twitter AS T1 INNER JOIN location AS T2 ON T2.LocationID = T1.LocationID WHERE T2.State = 'Connecticut' ORDER BY T1.Klout DESC LIMIT 1",
"style": "rule"
} | {
"db_id": "social_media.sqlite",
"gt_sql": "SELECT T1.text FROM twitter AS T1 INNER JOIN location AS T2 ON T2.LocationID = T1.LocationID WHERE T2.State = 'Connecticut' ORDER BY T1.Klout DESC LIMIT 1",
"index": 396,
"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 `user` (\n UserID text, -- example: ['\\x1anknow531394', 'tw-10000632']\n PRIMARY KEY (UserID)\n);\n\nCREATE TABLE twitter (\n TweetID text, -- example: ['tw-682712873332805633', 'tw-682713045357998080']\n Lang text, -- language, example: ['en', '_u']\n IsReshare text, -- example: ['FALSE', 'TRUE']\n Reach integer, -- example: [44, 1810]\n RetweetCount integer, -- example: [0, 5]\n Klout integer, -- example: [35, 53]\n text text, -- example: ['We are hiring: Senior Software Engineer ', 'RT @CodeMineStatus: This is true Amazon ']\n LocationID integer, -- example: [3751, 3989]\n UserID text, -- example: ['tw-40932430', 'tw-3179389829']\n PRIMARY KEY (TweetID),\n CONSTRAINT fk_twitter_locationid FOREIGN KEY (LocationID) REFERENCES location (LocationID),\n CONSTRAINT fk_twitter_userid FOREIGN KEY (UserID) REFERENCES `user` (UserID)\n);\n\nCREATE TABLE location (\n LocationID integer, -- example: [1, 2]\n State text, -- example: ['Connecticut', 'Elbasan', 'Tirane']\n StateCode text, -- example: ['AL', 'DZ']\n PRIMARY KEY (LocationID)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nhighest klout refers to Max(Klout); 'Connecticut' is the State\nShow the text of the tweet with the highest klout from Connecticut.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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 twitter (\n TweetID text, -- example: ['tw-682712873332805633', 'tw-682713045357998080']\n Weekday text, -- example: ['Thursday', 'Friday']\n `Hour` integer, -- example: [17, 18]\n `Day` integer, -- example: [31, 1]\n Lang text, -- language, example: ['en', '_u']\n IsReshare text, -- example: ['FALSE', 'TRUE']\n Reach integer, -- example: [44, 1810]\n RetweetCount integer, -- example: [0, 5]\n Likes integer, -- example: [0, 131]\n Klout integer, -- example: [35, 53]\n Sentiment real, -- example: [0.0, 2.0]\n text text, -- example: ['We are hiring: Senior Software Engineer ', 'RT @CodeMineStatus: This is true Amazon ']\n LocationID integer, -- example: [3751, 3989]\n UserID text, -- example: ['tw-40932430', 'tw-3179389829']\n PRIMARY KEY (TweetID),\n CONSTRAINT fk_twitter_locationid FOREIGN KEY (LocationID) REFERENCES location (LocationID),\n CONSTRAINT fk_twitter_userid FOREIGN KEY (UserID) REFERENCES `user` (UserID)\n);\n\nCREATE TABLE location (\n LocationID integer, -- example: [1, 2]\n Country text, -- example: ['Albania', 'Algeria']\n State text, -- example: ['Elbasan', 'Tirane']\n StateCode text, -- example: ['AL', 'DZ']\n City text, -- example: ['Elbasan', 'Tirana']\n PRIMARY KEY (LocationID)\n);\n\nCREATE TABLE `user` (\n UserID text, -- example: ['\\x1anknow531394', 'tw-10000632']\n Gender text, -- example: ['Unknown', 'Male']\n PRIMARY KEY (UserID)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\ntweet got 535 retweets refers to RetweetCount = 535\nWhat is the gender of the user whose tweet got 535 retweets?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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.Gender FROM twitter AS T1 INNER JOIN user AS T2 ON T1.UserID = T2.UserID WHERE T1.RetweetCount = 535",
"style": "rule"
} | {
"db_id": "social_media.sqlite",
"gt_sql": "SELECT T2.Gender FROM twitter AS T1 INNER JOIN user AS T2 ON T1.UserID = T2.UserID WHERE T1.RetweetCount = 535",
"index": 397,
"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 twitter (\n TweetID text, -- example: ['tw-682712873332805633', 'tw-682713045357998080']\n Weekday text, -- example: ['Thursday', 'Friday']\n `Hour` integer, -- example: [17, 18]\n `Day` integer, -- example: [31, 1]\n Lang text, -- language, example: ['en', '_u']\n IsReshare text, -- example: ['FALSE', 'TRUE']\n Reach integer, -- example: [44, 1810]\n RetweetCount integer, -- example: [0, 5]\n Likes integer, -- example: [0, 131]\n Klout integer, -- example: [35, 53]\n Sentiment real, -- example: [0.0, 2.0]\n text text, -- example: ['We are hiring: Senior Software Engineer ', 'RT @CodeMineStatus: This is true Amazon ']\n LocationID integer, -- example: [3751, 3989]\n UserID text, -- example: ['tw-40932430', 'tw-3179389829']\n PRIMARY KEY (TweetID),\n CONSTRAINT fk_twitter_locationid FOREIGN KEY (LocationID) REFERENCES location (LocationID),\n CONSTRAINT fk_twitter_userid FOREIGN KEY (UserID) REFERENCES `user` (UserID)\n);\n\nCREATE TABLE location (\n LocationID integer, -- example: [1, 2]\n Country text, -- example: ['Albania', 'Algeria']\n State text, -- example: ['Elbasan', 'Tirane']\n StateCode text, -- example: ['AL', 'DZ']\n City text, -- example: ['Elbasan', 'Tirana']\n PRIMARY KEY (LocationID)\n);\n\nCREATE TABLE `user` (\n UserID text, -- example: ['\\x1anknow531394', 'tw-10000632']\n Gender text, -- example: ['Unknown', 'Male']\n PRIMARY KEY (UserID)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\ntweet got 535 retweets refers to RetweetCount = 535\nWhat is the gender of the user whose tweet got 535 retweets?\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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 `user` (\n UserID text, -- example: ['\\x1anknow531394', 'tw-10000632']\n Gender text, -- example: ['Unknown', 'Male']\n PRIMARY KEY (UserID)\n);\n\nCREATE TABLE location (\n LocationID integer, -- example: [1, 2]\n Country text, -- example: ['Albania', 'Algeria']\n State text, -- example: ['Elbasan', 'Tirane']\n StateCode text, -- example: ['AL', 'DZ']\n PRIMARY KEY (LocationID)\n);\n\nCREATE TABLE twitter (\n TweetID text, -- example: ['tw-682712873332805633', 'tw-682713045357998080']\n Weekday text, -- example: ['Wednesday', 'Thursday', 'Friday']\n `Hour` integer, -- example: [17, 18]\n `Day` integer, -- example: [31, 1]\n Reach integer, -- example: [44, 1810]\n RetweetCount integer, -- example: [0, 5]\n Likes integer, -- example: [0, 131]\n Klout integer, -- example: [35, 53]\n LocationID integer, -- example: [3751, 3989]\n UserID text, -- example: ['tw-40932430', 'tw-3179389829']\n PRIMARY KEY (TweetID),\n CONSTRAINT fk_twitter_locationid FOREIGN KEY (LocationID) REFERENCES location (LocationID),\n CONSTRAINT fk_twitter_userid FOREIGN KEY (UserID) REFERENCES `user` (UserID)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nhighest klout refers to Max(Klout); 'Wednesday' is the Weekday\nGive the gender of the user who made the highest klout tweet on Wednesdays.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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.Gender FROM twitter AS T1 INNER JOIN user AS T2 ON T1.UserID = T2.UserID WHERE T1.Weekday = 'Wednesday' ORDER BY T1.Klout DESC LIMIT 1",
"style": "rule"
} | {
"db_id": "social_media.sqlite",
"gt_sql": "SELECT T2.Gender FROM twitter AS T1 INNER JOIN user AS T2 ON T1.UserID = T2.UserID WHERE T1.Weekday = 'Wednesday' ORDER BY T1.Klout DESC LIMIT 1",
"index": 398,
"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 `user` (\n UserID text, -- example: ['\\x1anknow531394', 'tw-10000632']\n Gender text, -- example: ['Unknown', 'Male']\n PRIMARY KEY (UserID)\n);\n\nCREATE TABLE location (\n LocationID integer, -- example: [1, 2]\n Country text, -- example: ['Albania', 'Algeria']\n State text, -- example: ['Elbasan', 'Tirane']\n StateCode text, -- example: ['AL', 'DZ']\n PRIMARY KEY (LocationID)\n);\n\nCREATE TABLE twitter (\n TweetID text, -- example: ['tw-682712873332805633', 'tw-682713045357998080']\n Weekday text, -- example: ['Wednesday', 'Thursday', 'Friday']\n `Hour` integer, -- example: [17, 18]\n `Day` integer, -- example: [31, 1]\n Reach integer, -- example: [44, 1810]\n RetweetCount integer, -- example: [0, 5]\n Likes integer, -- example: [0, 131]\n Klout integer, -- example: [35, 53]\n LocationID integer, -- example: [3751, 3989]\n UserID text, -- example: ['tw-40932430', 'tw-3179389829']\n PRIMARY KEY (TweetID),\n CONSTRAINT fk_twitter_locationid FOREIGN KEY (LocationID) REFERENCES location (LocationID),\n CONSTRAINT fk_twitter_userid FOREIGN KEY (UserID) REFERENCES `user` (UserID)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nhighest klout refers to Max(Klout); 'Wednesday' is the Weekday\nGive the gender of the user who made the highest klout tweet on Wednesdays.\n\nInstructions:\n- Make sure you only output the information that is asked in the question. If the question asks for a specific column, make sure to only include that column in the SELECT clause, nothing more.\n- The generated query should return all of the information asked in the question without any missing or extra information.\n- Before generating the final SQL query, please think through the steps of how to write the query.\n\nOutput Format:\nIn your answer, please enclose the generated SQL query in a code block:\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 twitter (\n TweetID text, -- example: ['tw-682712873332805633', 'tw-682713045357998080']\n `Hour` integer, -- example: [17, 18]\n `Day` integer, -- example: [31, 1]\n Lang text, -- language, example: ['en', '_u']\n IsReshare text, -- example: ['FALSE', 'TRUE']\n Reach integer, -- example: [44, 1810]\n RetweetCount integer, -- example: [0, 5]\n Likes integer, -- example: [0, 131]\n Klout integer, -- example: [35, 53]\n Sentiment real, -- example: [0.0, 2.0]\n LocationID integer, -- example: [3751, 3989]\n UserID text, -- example: ['tw-40932430', 'tw-3179389829']\n PRIMARY KEY (TweetID),\n CONSTRAINT fk_twitter_locationid FOREIGN KEY (LocationID) REFERENCES location (LocationID),\n CONSTRAINT fk_twitter_userid FOREIGN KEY (UserID) REFERENCES `user` (UserID)\n);\n\nCREATE TABLE `user` (\n UserID text, -- example: ['\\x1anknow531394', 'tw-10000632']\n Gender text, -- example: ['Unknown', 'Male']\n PRIMARY KEY (UserID)\n);\n\nCREATE TABLE location (\n LocationID integer, -- example: [1, 2]\n Country text, -- example: ['Albania', 'Algeria']\n StateCode text, -- example: ['AL', 'DZ']\n City text, -- example: ['Elbasan', 'Tirana']\n PRIMARY KEY (LocationID)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nmost likes refers to Max(Likes)\nFor the tweet which got the most likes, state the gender of the user who tweeted 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 T2.Gender FROM twitter AS T1 INNER JOIN user AS T2 ON T1.UserID = T2.UserID ORDER BY T1.Likes DESC LIMIT 1",
"style": "rule"
} | {
"db_id": "social_media.sqlite",
"gt_sql": "SELECT T2.Gender FROM twitter AS T1 INNER JOIN user AS T2 ON T1.UserID = T2.UserID ORDER BY T1.Likes DESC LIMIT 1",
"index": 399,
"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 twitter (\n TweetID text, -- example: ['tw-682712873332805633', 'tw-682713045357998080']\n `Hour` integer, -- example: [17, 18]\n `Day` integer, -- example: [31, 1]\n Lang text, -- language, example: ['en', '_u']\n IsReshare text, -- example: ['FALSE', 'TRUE']\n Reach integer, -- example: [44, 1810]\n RetweetCount integer, -- example: [0, 5]\n Likes integer, -- example: [0, 131]\n Klout integer, -- example: [35, 53]\n Sentiment real, -- example: [0.0, 2.0]\n LocationID integer, -- example: [3751, 3989]\n UserID text, -- example: ['tw-40932430', 'tw-3179389829']\n PRIMARY KEY (TweetID),\n CONSTRAINT fk_twitter_locationid FOREIGN KEY (LocationID) REFERENCES location (LocationID),\n CONSTRAINT fk_twitter_userid FOREIGN KEY (UserID) REFERENCES `user` (UserID)\n);\n\nCREATE TABLE `user` (\n UserID text, -- example: ['\\x1anknow531394', 'tw-10000632']\n Gender text, -- example: ['Unknown', 'Male']\n PRIMARY KEY (UserID)\n);\n\nCREATE TABLE location (\n LocationID integer, -- example: [1, 2]\n Country text, -- example: ['Albania', 'Algeria']\n StateCode text, -- example: ['AL', 'DZ']\n City text, -- example: ['Elbasan', 'Tirana']\n PRIMARY KEY (LocationID)\n);\nThis schema describes the database's structure, including tables, columns, primary keys, foreign keys, and any relevant relationships or constraints.\n\nQuestion:\nmost likes refers to Max(Likes)\nFor the tweet which got the most likes, state the gender of the user who tweeted 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"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.