id
string | db_id
string | question
string | qpl
list | qd
list | conversations
list |
|---|---|---|---|---|---|
5d3ffd892ca09f6dffd55923294e8e0c5257cdff0216417e84943542451374b9_0
|
department_management
|
How many heads of the departments are older than 56 ?
|
[
"#1 = Scan Table [ head ] Predicate [ age > 56.0 ] Output [ 1 AS One ]",
"#2 = Aggregate [ #1 ] Output [ countstar AS Count_Star ]"
] |
[
"List 1 for each head of the departments that older than 56.",
"How many heads of the departments are older than 56 ?"
] |
[
{
"content": "You are a question decomposition expert. You are given a database schema and a complex database input question in natural language, and your task is to break down the complex database input question into simpler sub-questions in a recursive way, like a tree. In each step you will be given a question to decompose, so that your answer will be the input for the next steps.\n\nInput Question:\nHow many heads of the departments are older than 56 ?\n\nDatabase Name:\ndepartment_management\n\nDatabase Schema:\nCREATE TABLE department (\n\tDepartment_ID number,\n\tName text,\n\tCreation text,\n\tRanking number,\n\tBudget_in_Billions number,\n\tNum_Employees number,\n\tprimary key ( Department_ID )\n)\n\nCREATE TABLE head (\n\thead_ID number,\n\tname text,\n\tborn_state text,\n\tage number,\n\tprimary key ( head_ID )\n)\n\nCREATE TABLE management (\n\tdepartment_ID number,\n\thead_ID number,\n\ttemporary_acting text,\n\tprimary key ( department_ID , head_ID ),\n\tforeign key ( department_ID ) references department ( Department_ID ),\n\tforeign key ( head_ID ) references head ( head_ID )\n)\n\nValid Operators:\nThe following operators are available for query decomposition:\n- Scan: Direct table access with no sub-questions\n- Filter: Selection based on conditions\n- Aggregate: Group and compute aggregations\n- Sort: Order results\n- Topsort: Sort and limit results\n- Top: Limit results\n- Join: Combine two sub-queries\n- Except: Set difference between two sub-queries\n- Intersect: Set intersection between two sub-queries\n- Union: Set union of two sub-queries\n\nOperator Rules:\n1. Each decomposition MUST specify exactly one operator from the above list\n2. Operator constraints:\n - Scan: Cannot have sub-questions\n - Filter/Aggregate/Sort/Top/Topsort: Can have 1 sub-question\n - Join/Union/Intersect/Except: Must have exactly 2 sub-questions\n\nTask Description:\n1. You will receive a complex database question that needs to be decomposed\n2. For each question, you should:\n - First, determine the appropriate operator from the valid list\n - Then break it down into sub-questions according to the operator's rules\n - Explain how these sub-questions relate to the original question\n - Indicate the order in which these sub-questions should be answered\n\nResponse Format:\nFor each decomposition step, respond with this exact JSON format without any other text:\n{\n \"type\": \"object\",\n \"properties\": {\n \"index\": {\n \"type\": [\n \"integer\",\n \"null\"\n ]\n },\n \"question\": {\n \"type\": \"string\"\n },\n \"operator\": {\n \"type\": [\n \"string\",\n \"null\"\n ],\n \"enum\": [\n \"Scan\",\n \"Filter\",\n \"Aggregate\",\n \"Sort\",\n \"Top\",\n \"Join\",\n \"Union\",\n \"Intersect\",\n \"Except\",\n null\n ]\n },\n \"sub_questions\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#\"\n }\n }\n },\n \"required\": [\n \"index\",\n \"question\",\n \"operator\"\n ]\n}\n\nConversation Flow:\n1. User will provide the initial complex question\n2. You will:\n a. Choose an appropriate operator\n b. Decompose into sub-questions according to operator rules\n3. User will ask you to decompose one of the sub-questions if needed\n4. This process continues until we reach simple, directly answerable questions (Scan operations)\n\nImportant Rules:\n- Each decomposition MUST use exactly one operator from the valid list\n- Operator choice must be justified and appropriate for the question\n- Sub-questions must comply with the operator's requirements\n- Each sub-question should be simpler than the original question\n- Sub-questions should be clear and self-contained\n- Maintain context between decomposition steps\n- Use only tables and columns that exist in the provided schema\n",
"role": "system"
},
{
"content": "decompose the following question: How many heads of the departments are older than 56 ?",
"role": "user"
},
{
"content": "{\"index\":1,\"question\":\"How many heads of the departments are older than 56 ?\",\"operator\":\"Aggregate\",\"sub_questions\":[{\"index\":2,\"question\":\"List 1 for each head of the departments that older than 56.\",\"operator\":null,\"sub_questions\":[]}]}",
"role": "assistant"
},
{
"content": "given the decomposition: {\"index\":1,\"question\":\"How many heads of the departments are older than 56 ?\",\"operator\":\"Aggregate\",\"sub_questions\":[{\"index\":2,\"question\":\"List 1 for each head of the departments that older than 56.\",\"operator\":null,\"sub_questions\":[]}]}\ndecompose the following question with index 2: List 1 for each head of the departments that older than 56.",
"role": "user"
},
{
"content": "{\"index\":2,\"question\":\"List 1 for each head of the departments that older than 56.\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
}
] |
5d3ffd892ca09f6dffd55923294e8e0c5257cdff0216417e84943542451374b9_1
|
department_management
|
List 1 for each head of the departments that older than 56.
|
[
"#1 = Scan Table [ head ] Predicate [ age > 56.0 ] Output [ 1 AS One ]"
] |
[
"List 1 for each head of the departments that older than 56."
] |
[
{
"content": "You are a question decomposition expert. You are given a database schema and a complex database input question in natural language, and your task is to break down the complex database input question into simpler sub-questions in a recursive way, like a tree. In each step you will be given a question to decompose, so that your answer will be the input for the next steps.\n\nInput Question:\nHow many heads of the departments are older than 56 ?\n\nDatabase Name:\ndepartment_management\n\nDatabase Schema:\nCREATE TABLE department (\n\tDepartment_ID number,\n\tName text,\n\tCreation text,\n\tRanking number,\n\tBudget_in_Billions number,\n\tNum_Employees number,\n\tprimary key ( Department_ID )\n)\n\nCREATE TABLE head (\n\thead_ID number,\n\tname text,\n\tborn_state text,\n\tage number,\n\tprimary key ( head_ID )\n)\n\nCREATE TABLE management (\n\tdepartment_ID number,\n\thead_ID number,\n\ttemporary_acting text,\n\tprimary key ( department_ID , head_ID ),\n\tforeign key ( department_ID ) references department ( Department_ID ),\n\tforeign key ( head_ID ) references head ( head_ID )\n)\n\nValid Operators:\nThe following operators are available for query decomposition:\n- Scan: Direct table access with no sub-questions\n- Filter: Selection based on conditions\n- Aggregate: Group and compute aggregations\n- Sort: Order results\n- Topsort: Sort and limit results\n- Top: Limit results\n- Join: Combine two sub-queries\n- Except: Set difference between two sub-queries\n- Intersect: Set intersection between two sub-queries\n- Union: Set union of two sub-queries\n\nOperator Rules:\n1. Each decomposition MUST specify exactly one operator from the above list\n2. Operator constraints:\n - Scan: Cannot have sub-questions\n - Filter/Aggregate/Sort/Top/Topsort: Can have 1 sub-question\n - Join/Union/Intersect/Except: Must have exactly 2 sub-questions\n\nTask Description:\n1. You will receive a complex database question that needs to be decomposed\n2. For each question, you should:\n - First, determine the appropriate operator from the valid list\n - Then break it down into sub-questions according to the operator's rules\n - Explain how these sub-questions relate to the original question\n - Indicate the order in which these sub-questions should be answered\n\nResponse Format:\nFor each decomposition step, respond with this exact JSON format without any other text:\n{\n \"type\": \"object\",\n \"properties\": {\n \"index\": {\n \"type\": [\n \"integer\",\n \"null\"\n ]\n },\n \"question\": {\n \"type\": \"string\"\n },\n \"operator\": {\n \"type\": [\n \"string\",\n \"null\"\n ],\n \"enum\": [\n \"Scan\",\n \"Filter\",\n \"Aggregate\",\n \"Sort\",\n \"Top\",\n \"Join\",\n \"Union\",\n \"Intersect\",\n \"Except\",\n null\n ]\n },\n \"sub_questions\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#\"\n }\n }\n },\n \"required\": [\n \"index\",\n \"question\",\n \"operator\"\n ]\n}\n\nConversation Flow:\n1. User will provide the initial complex question\n2. You will:\n a. Choose an appropriate operator\n b. Decompose into sub-questions according to operator rules\n3. User will ask you to decompose one of the sub-questions if needed\n4. This process continues until we reach simple, directly answerable questions (Scan operations)\n\nImportant Rules:\n- Each decomposition MUST use exactly one operator from the valid list\n- Operator choice must be justified and appropriate for the question\n- Sub-questions must comply with the operator's requirements\n- Each sub-question should be simpler than the original question\n- Sub-questions should be clear and self-contained\n- Maintain context between decomposition steps\n- Use only tables and columns that exist in the provided schema\n",
"role": "system"
},
{
"content": "decompose the following question: List 1 for each head of the departments that older than 56.",
"role": "user"
},
{
"content": "{\"index\":1,\"question\":\"List 1 for each head of the departments that older than 56.\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
}
] |
40759deacb76f6ccac4d7f87c0662f90e2fa90da89b041172fb95e18d35b44ca_0
|
department_management
|
List the name, born state and age of the heads of departments ordered by age.
|
[
"#1 = Scan Table [ head ] Output [ name , born_state , age ]",
"#2 = Sort [ #1 ] OrderBy [ age ASC ] Output [ name , born_state , age ]"
] |
[
"List the name, born state and age of the heads of departments.",
"List the name, born state and age of the heads of departments ordered by age."
] |
[
{
"content": "You are a question decomposition expert. You are given a database schema and a complex database input question in natural language, and your task is to break down the complex database input question into simpler sub-questions in a recursive way, like a tree. In each step you will be given a question to decompose, so that your answer will be the input for the next steps.\n\nInput Question:\nList the name, born state and age of the heads of departments ordered by age.\n\nDatabase Name:\ndepartment_management\n\nDatabase Schema:\nCREATE TABLE department (\n\tDepartment_ID number,\n\tName text,\n\tCreation text,\n\tRanking number,\n\tBudget_in_Billions number,\n\tNum_Employees number,\n\tprimary key ( Department_ID )\n)\n\nCREATE TABLE head (\n\thead_ID number,\n\tname text,\n\tborn_state text,\n\tage number,\n\tprimary key ( head_ID )\n)\n\nCREATE TABLE management (\n\tdepartment_ID number,\n\thead_ID number,\n\ttemporary_acting text,\n\tprimary key ( department_ID , head_ID ),\n\tforeign key ( department_ID ) references department ( Department_ID ),\n\tforeign key ( head_ID ) references head ( head_ID )\n)\n\nValid Operators:\nThe following operators are available for query decomposition:\n- Scan: Direct table access with no sub-questions\n- Filter: Selection based on conditions\n- Aggregate: Group and compute aggregations\n- Sort: Order results\n- Topsort: Sort and limit results\n- Top: Limit results\n- Join: Combine two sub-queries\n- Except: Set difference between two sub-queries\n- Intersect: Set intersection between two sub-queries\n- Union: Set union of two sub-queries\n\nOperator Rules:\n1. Each decomposition MUST specify exactly one operator from the above list\n2. Operator constraints:\n - Scan: Cannot have sub-questions\n - Filter/Aggregate/Sort/Top/Topsort: Can have 1 sub-question\n - Join/Union/Intersect/Except: Must have exactly 2 sub-questions\n\nTask Description:\n1. You will receive a complex database question that needs to be decomposed\n2. For each question, you should:\n - First, determine the appropriate operator from the valid list\n - Then break it down into sub-questions according to the operator's rules\n - Explain how these sub-questions relate to the original question\n - Indicate the order in which these sub-questions should be answered\n\nResponse Format:\nFor each decomposition step, respond with this exact JSON format without any other text:\n{\n \"type\": \"object\",\n \"properties\": {\n \"index\": {\n \"type\": [\n \"integer\",\n \"null\"\n ]\n },\n \"question\": {\n \"type\": \"string\"\n },\n \"operator\": {\n \"type\": [\n \"string\",\n \"null\"\n ],\n \"enum\": [\n \"Scan\",\n \"Filter\",\n \"Aggregate\",\n \"Sort\",\n \"Top\",\n \"Join\",\n \"Union\",\n \"Intersect\",\n \"Except\",\n null\n ]\n },\n \"sub_questions\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#\"\n }\n }\n },\n \"required\": [\n \"index\",\n \"question\",\n \"operator\"\n ]\n}\n\nConversation Flow:\n1. User will provide the initial complex question\n2. You will:\n a. Choose an appropriate operator\n b. Decompose into sub-questions according to operator rules\n3. User will ask you to decompose one of the sub-questions if needed\n4. This process continues until we reach simple, directly answerable questions (Scan operations)\n\nImportant Rules:\n- Each decomposition MUST use exactly one operator from the valid list\n- Operator choice must be justified and appropriate for the question\n- Sub-questions must comply with the operator's requirements\n- Each sub-question should be simpler than the original question\n- Sub-questions should be clear and self-contained\n- Maintain context between decomposition steps\n- Use only tables and columns that exist in the provided schema\n",
"role": "system"
},
{
"content": "decompose the following question: List the name, born state and age of the heads of departments ordered by age.",
"role": "user"
},
{
"content": "{\"index\":1,\"question\":\"List the name, born state and age of the heads of departments ordered by age.\",\"operator\":\"Sort\",\"sub_questions\":[{\"index\":2,\"question\":\"List the name, born state and age of the heads of departments.\",\"operator\":null,\"sub_questions\":[]}]}",
"role": "assistant"
},
{
"content": "given the decomposition: {\"index\":1,\"question\":\"List the name, born state and age of the heads of departments ordered by age.\",\"operator\":\"Sort\",\"sub_questions\":[{\"index\":2,\"question\":\"List the name, born state and age of the heads of departments.\",\"operator\":null,\"sub_questions\":[]}]}\ndecompose the following question with index 2: List the name, born state and age of the heads of departments.",
"role": "user"
},
{
"content": "{\"index\":2,\"question\":\"List the name, born state and age of the heads of departments.\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
}
] |
40759deacb76f6ccac4d7f87c0662f90e2fa90da89b041172fb95e18d35b44ca_1
|
department_management
|
List the name, born state and age of the heads of departments.
|
[
"#1 = Scan Table [ head ] Output [ name , born_state , age ]"
] |
[
"List the name, born state and age of the heads of departments."
] |
[
{
"content": "You are a question decomposition expert. You are given a database schema and a complex database input question in natural language, and your task is to break down the complex database input question into simpler sub-questions in a recursive way, like a tree. In each step you will be given a question to decompose, so that your answer will be the input for the next steps.\n\nInput Question:\nList the name, born state and age of the heads of departments ordered by age.\n\nDatabase Name:\ndepartment_management\n\nDatabase Schema:\nCREATE TABLE department (\n\tDepartment_ID number,\n\tName text,\n\tCreation text,\n\tRanking number,\n\tBudget_in_Billions number,\n\tNum_Employees number,\n\tprimary key ( Department_ID )\n)\n\nCREATE TABLE head (\n\thead_ID number,\n\tname text,\n\tborn_state text,\n\tage number,\n\tprimary key ( head_ID )\n)\n\nCREATE TABLE management (\n\tdepartment_ID number,\n\thead_ID number,\n\ttemporary_acting text,\n\tprimary key ( department_ID , head_ID ),\n\tforeign key ( department_ID ) references department ( Department_ID ),\n\tforeign key ( head_ID ) references head ( head_ID )\n)\n\nValid Operators:\nThe following operators are available for query decomposition:\n- Scan: Direct table access with no sub-questions\n- Filter: Selection based on conditions\n- Aggregate: Group and compute aggregations\n- Sort: Order results\n- Topsort: Sort and limit results\n- Top: Limit results\n- Join: Combine two sub-queries\n- Except: Set difference between two sub-queries\n- Intersect: Set intersection between two sub-queries\n- Union: Set union of two sub-queries\n\nOperator Rules:\n1. Each decomposition MUST specify exactly one operator from the above list\n2. Operator constraints:\n - Scan: Cannot have sub-questions\n - Filter/Aggregate/Sort/Top/Topsort: Can have 1 sub-question\n - Join/Union/Intersect/Except: Must have exactly 2 sub-questions\n\nTask Description:\n1. You will receive a complex database question that needs to be decomposed\n2. For each question, you should:\n - First, determine the appropriate operator from the valid list\n - Then break it down into sub-questions according to the operator's rules\n - Explain how these sub-questions relate to the original question\n - Indicate the order in which these sub-questions should be answered\n\nResponse Format:\nFor each decomposition step, respond with this exact JSON format without any other text:\n{\n \"type\": \"object\",\n \"properties\": {\n \"index\": {\n \"type\": [\n \"integer\",\n \"null\"\n ]\n },\n \"question\": {\n \"type\": \"string\"\n },\n \"operator\": {\n \"type\": [\n \"string\",\n \"null\"\n ],\n \"enum\": [\n \"Scan\",\n \"Filter\",\n \"Aggregate\",\n \"Sort\",\n \"Top\",\n \"Join\",\n \"Union\",\n \"Intersect\",\n \"Except\",\n null\n ]\n },\n \"sub_questions\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#\"\n }\n }\n },\n \"required\": [\n \"index\",\n \"question\",\n \"operator\"\n ]\n}\n\nConversation Flow:\n1. User will provide the initial complex question\n2. You will:\n a. Choose an appropriate operator\n b. Decompose into sub-questions according to operator rules\n3. User will ask you to decompose one of the sub-questions if needed\n4. This process continues until we reach simple, directly answerable questions (Scan operations)\n\nImportant Rules:\n- Each decomposition MUST use exactly one operator from the valid list\n- Operator choice must be justified and appropriate for the question\n- Sub-questions must comply with the operator's requirements\n- Each sub-question should be simpler than the original question\n- Sub-questions should be clear and self-contained\n- Maintain context between decomposition steps\n- Use only tables and columns that exist in the provided schema\n",
"role": "system"
},
{
"content": "decompose the following question: List the name, born state and age of the heads of departments.",
"role": "user"
},
{
"content": "{\"index\":1,\"question\":\"List the name, born state and age of the heads of departments.\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
}
] |
aa79da355ec7c1a64f7e402cf1e797ab030ee709acad0ddf456d9e11bc5debf7_0
|
department_management
|
List the creation year, name and budget of each department.
|
[
"#1 = Scan Table [ department ] Output [ Creation , Name , Budget_in_Billions ]"
] |
[
"List the creation year, name and budget of each department."
] |
[
{
"content": "You are a question decomposition expert. You are given a database schema and a complex database input question in natural language, and your task is to break down the complex database input question into simpler sub-questions in a recursive way, like a tree. In each step you will be given a question to decompose, so that your answer will be the input for the next steps.\n\nInput Question:\nList the creation year, name and budget of each department.\n\nDatabase Name:\ndepartment_management\n\nDatabase Schema:\nCREATE TABLE department (\n\tDepartment_ID number,\n\tName text,\n\tCreation text,\n\tRanking number,\n\tBudget_in_Billions number,\n\tNum_Employees number,\n\tprimary key ( Department_ID )\n)\n\nCREATE TABLE head (\n\thead_ID number,\n\tname text,\n\tborn_state text,\n\tage number,\n\tprimary key ( head_ID )\n)\n\nCREATE TABLE management (\n\tdepartment_ID number,\n\thead_ID number,\n\ttemporary_acting text,\n\tprimary key ( department_ID , head_ID ),\n\tforeign key ( department_ID ) references department ( Department_ID ),\n\tforeign key ( head_ID ) references head ( head_ID )\n)\n\nValid Operators:\nThe following operators are available for query decomposition:\n- Scan: Direct table access with no sub-questions\n- Filter: Selection based on conditions\n- Aggregate: Group and compute aggregations\n- Sort: Order results\n- Topsort: Sort and limit results\n- Top: Limit results\n- Join: Combine two sub-queries\n- Except: Set difference between two sub-queries\n- Intersect: Set intersection between two sub-queries\n- Union: Set union of two sub-queries\n\nOperator Rules:\n1. Each decomposition MUST specify exactly one operator from the above list\n2. Operator constraints:\n - Scan: Cannot have sub-questions\n - Filter/Aggregate/Sort/Top/Topsort: Can have 1 sub-question\n - Join/Union/Intersect/Except: Must have exactly 2 sub-questions\n\nTask Description:\n1. You will receive a complex database question that needs to be decomposed\n2. For each question, you should:\n - First, determine the appropriate operator from the valid list\n - Then break it down into sub-questions according to the operator's rules\n - Explain how these sub-questions relate to the original question\n - Indicate the order in which these sub-questions should be answered\n\nResponse Format:\nFor each decomposition step, respond with this exact JSON format without any other text:\n{\n \"type\": \"object\",\n \"properties\": {\n \"index\": {\n \"type\": [\n \"integer\",\n \"null\"\n ]\n },\n \"question\": {\n \"type\": \"string\"\n },\n \"operator\": {\n \"type\": [\n \"string\",\n \"null\"\n ],\n \"enum\": [\n \"Scan\",\n \"Filter\",\n \"Aggregate\",\n \"Sort\",\n \"Top\",\n \"Join\",\n \"Union\",\n \"Intersect\",\n \"Except\",\n null\n ]\n },\n \"sub_questions\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#\"\n }\n }\n },\n \"required\": [\n \"index\",\n \"question\",\n \"operator\"\n ]\n}\n\nConversation Flow:\n1. User will provide the initial complex question\n2. You will:\n a. Choose an appropriate operator\n b. Decompose into sub-questions according to operator rules\n3. User will ask you to decompose one of the sub-questions if needed\n4. This process continues until we reach simple, directly answerable questions (Scan operations)\n\nImportant Rules:\n- Each decomposition MUST use exactly one operator from the valid list\n- Operator choice must be justified and appropriate for the question\n- Sub-questions must comply with the operator's requirements\n- Each sub-question should be simpler than the original question\n- Sub-questions should be clear and self-contained\n- Maintain context between decomposition steps\n- Use only tables and columns that exist in the provided schema\n",
"role": "system"
},
{
"content": "decompose the following question: List the creation year, name and budget of each department.",
"role": "user"
},
{
"content": "{\"index\":1,\"question\":\"List the creation year, name and budget of each department.\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
}
] |
e40de77e53eb4bcf9d81bf07d121c135264dbd62cdca7e88f5cebda7b73fafa4_0
|
department_management
|
What are the maximum and minimum budget of the departments?
|
[
"#1 = Scan Table [ department ] Output [ Budget_in_Billions ]",
"#2 = Aggregate [ #1 ] Output [ MIN(Budget_in_Billions) AS Min_Budget_in_Billions , MAX(Budget_in_Billions) AS Max_Budget_in_Billions ]"
] |
[
"What are the budgets of the departments?",
"What are the maximum and minimum budget of the departments?"
] |
[
{
"content": "You are a question decomposition expert. You are given a database schema and a complex database input question in natural language, and your task is to break down the complex database input question into simpler sub-questions in a recursive way, like a tree. In each step you will be given a question to decompose, so that your answer will be the input for the next steps.\n\nInput Question:\nWhat are the maximum and minimum budget of the departments?\n\nDatabase Name:\ndepartment_management\n\nDatabase Schema:\nCREATE TABLE department (\n\tDepartment_ID number,\n\tName text,\n\tCreation text,\n\tRanking number,\n\tBudget_in_Billions number,\n\tNum_Employees number,\n\tprimary key ( Department_ID )\n)\n\nCREATE TABLE head (\n\thead_ID number,\n\tname text,\n\tborn_state text,\n\tage number,\n\tprimary key ( head_ID )\n)\n\nCREATE TABLE management (\n\tdepartment_ID number,\n\thead_ID number,\n\ttemporary_acting text,\n\tprimary key ( department_ID , head_ID ),\n\tforeign key ( department_ID ) references department ( Department_ID ),\n\tforeign key ( head_ID ) references head ( head_ID )\n)\n\nValid Operators:\nThe following operators are available for query decomposition:\n- Scan: Direct table access with no sub-questions\n- Filter: Selection based on conditions\n- Aggregate: Group and compute aggregations\n- Sort: Order results\n- Topsort: Sort and limit results\n- Top: Limit results\n- Join: Combine two sub-queries\n- Except: Set difference between two sub-queries\n- Intersect: Set intersection between two sub-queries\n- Union: Set union of two sub-queries\n\nOperator Rules:\n1. Each decomposition MUST specify exactly one operator from the above list\n2. Operator constraints:\n - Scan: Cannot have sub-questions\n - Filter/Aggregate/Sort/Top/Topsort: Can have 1 sub-question\n - Join/Union/Intersect/Except: Must have exactly 2 sub-questions\n\nTask Description:\n1. You will receive a complex database question that needs to be decomposed\n2. For each question, you should:\n - First, determine the appropriate operator from the valid list\n - Then break it down into sub-questions according to the operator's rules\n - Explain how these sub-questions relate to the original question\n - Indicate the order in which these sub-questions should be answered\n\nResponse Format:\nFor each decomposition step, respond with this exact JSON format without any other text:\n{\n \"type\": \"object\",\n \"properties\": {\n \"index\": {\n \"type\": [\n \"integer\",\n \"null\"\n ]\n },\n \"question\": {\n \"type\": \"string\"\n },\n \"operator\": {\n \"type\": [\n \"string\",\n \"null\"\n ],\n \"enum\": [\n \"Scan\",\n \"Filter\",\n \"Aggregate\",\n \"Sort\",\n \"Top\",\n \"Join\",\n \"Union\",\n \"Intersect\",\n \"Except\",\n null\n ]\n },\n \"sub_questions\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#\"\n }\n }\n },\n \"required\": [\n \"index\",\n \"question\",\n \"operator\"\n ]\n}\n\nConversation Flow:\n1. User will provide the initial complex question\n2. You will:\n a. Choose an appropriate operator\n b. Decompose into sub-questions according to operator rules\n3. User will ask you to decompose one of the sub-questions if needed\n4. This process continues until we reach simple, directly answerable questions (Scan operations)\n\nImportant Rules:\n- Each decomposition MUST use exactly one operator from the valid list\n- Operator choice must be justified and appropriate for the question\n- Sub-questions must comply with the operator's requirements\n- Each sub-question should be simpler than the original question\n- Sub-questions should be clear and self-contained\n- Maintain context between decomposition steps\n- Use only tables and columns that exist in the provided schema\n",
"role": "system"
},
{
"content": "decompose the following question: What are the maximum and minimum budget of the departments?",
"role": "user"
},
{
"content": "{\"index\":1,\"question\":\"What are the maximum and minimum budget of the departments?\",\"operator\":\"Aggregate\",\"sub_questions\":[{\"index\":2,\"question\":\"What are the budgets of the departments?\",\"operator\":null,\"sub_questions\":[]}]}",
"role": "assistant"
},
{
"content": "given the decomposition: {\"index\":1,\"question\":\"What are the maximum and minimum budget of the departments?\",\"operator\":\"Aggregate\",\"sub_questions\":[{\"index\":2,\"question\":\"What are the budgets of the departments?\",\"operator\":null,\"sub_questions\":[]}]}\ndecompose the following question with index 2: What are the budgets of the departments?",
"role": "user"
},
{
"content": "{\"index\":2,\"question\":\"What are the budgets of the departments?\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
}
] |
e40de77e53eb4bcf9d81bf07d121c135264dbd62cdca7e88f5cebda7b73fafa4_1
|
department_management
|
What are the budgets of the departments?
|
[
"#1 = Scan Table [ department ] Output [ Budget_in_Billions ]"
] |
[
"What are the budgets of the departments?"
] |
[
{
"content": "You are a question decomposition expert. You are given a database schema and a complex database input question in natural language, and your task is to break down the complex database input question into simpler sub-questions in a recursive way, like a tree. In each step you will be given a question to decompose, so that your answer will be the input for the next steps.\n\nInput Question:\nWhat are the maximum and minimum budget of the departments?\n\nDatabase Name:\ndepartment_management\n\nDatabase Schema:\nCREATE TABLE department (\n\tDepartment_ID number,\n\tName text,\n\tCreation text,\n\tRanking number,\n\tBudget_in_Billions number,\n\tNum_Employees number,\n\tprimary key ( Department_ID )\n)\n\nCREATE TABLE head (\n\thead_ID number,\n\tname text,\n\tborn_state text,\n\tage number,\n\tprimary key ( head_ID )\n)\n\nCREATE TABLE management (\n\tdepartment_ID number,\n\thead_ID number,\n\ttemporary_acting text,\n\tprimary key ( department_ID , head_ID ),\n\tforeign key ( department_ID ) references department ( Department_ID ),\n\tforeign key ( head_ID ) references head ( head_ID )\n)\n\nValid Operators:\nThe following operators are available for query decomposition:\n- Scan: Direct table access with no sub-questions\n- Filter: Selection based on conditions\n- Aggregate: Group and compute aggregations\n- Sort: Order results\n- Topsort: Sort and limit results\n- Top: Limit results\n- Join: Combine two sub-queries\n- Except: Set difference between two sub-queries\n- Intersect: Set intersection between two sub-queries\n- Union: Set union of two sub-queries\n\nOperator Rules:\n1. Each decomposition MUST specify exactly one operator from the above list\n2. Operator constraints:\n - Scan: Cannot have sub-questions\n - Filter/Aggregate/Sort/Top/Topsort: Can have 1 sub-question\n - Join/Union/Intersect/Except: Must have exactly 2 sub-questions\n\nTask Description:\n1. You will receive a complex database question that needs to be decomposed\n2. For each question, you should:\n - First, determine the appropriate operator from the valid list\n - Then break it down into sub-questions according to the operator's rules\n - Explain how these sub-questions relate to the original question\n - Indicate the order in which these sub-questions should be answered\n\nResponse Format:\nFor each decomposition step, respond with this exact JSON format without any other text:\n{\n \"type\": \"object\",\n \"properties\": {\n \"index\": {\n \"type\": [\n \"integer\",\n \"null\"\n ]\n },\n \"question\": {\n \"type\": \"string\"\n },\n \"operator\": {\n \"type\": [\n \"string\",\n \"null\"\n ],\n \"enum\": [\n \"Scan\",\n \"Filter\",\n \"Aggregate\",\n \"Sort\",\n \"Top\",\n \"Join\",\n \"Union\",\n \"Intersect\",\n \"Except\",\n null\n ]\n },\n \"sub_questions\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#\"\n }\n }\n },\n \"required\": [\n \"index\",\n \"question\",\n \"operator\"\n ]\n}\n\nConversation Flow:\n1. User will provide the initial complex question\n2. You will:\n a. Choose an appropriate operator\n b. Decompose into sub-questions according to operator rules\n3. User will ask you to decompose one of the sub-questions if needed\n4. This process continues until we reach simple, directly answerable questions (Scan operations)\n\nImportant Rules:\n- Each decomposition MUST use exactly one operator from the valid list\n- Operator choice must be justified and appropriate for the question\n- Sub-questions must comply with the operator's requirements\n- Each sub-question should be simpler than the original question\n- Sub-questions should be clear and self-contained\n- Maintain context between decomposition steps\n- Use only tables and columns that exist in the provided schema\n",
"role": "system"
},
{
"content": "decompose the following question: What are the budgets of the departments?",
"role": "user"
},
{
"content": "{\"index\":1,\"question\":\"What are the budgets of the departments?\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
}
] |
47f00f939411fff3d9dd81cdab4b7937fb837492b042f78ebf58dcb092a6f3a8_0
|
department_management
|
What is the average number of employees of the departments whose rank is between 10 and 15?
|
[
"#1 = Scan Table [ department ] Predicate [ Ranking >= 10 AND Ranking <= 15 ] Output [ Ranking , Num_Employees ]",
"#2 = Aggregate [ #1 ] Output [ AVG(Num_Employees) AS Avg_Num_Employees ]"
] |
[
"What are the number of employees of the departments whose rank is between 10 and 15?",
"What is the average number of employees of the departments whose rank is between 10 and 15?"
] |
[
{
"content": "You are a question decomposition expert. You are given a database schema and a complex database input question in natural language, and your task is to break down the complex database input question into simpler sub-questions in a recursive way, like a tree. In each step you will be given a question to decompose, so that your answer will be the input for the next steps.\n\nInput Question:\nWhat is the average number of employees of the departments whose rank is between 10 and 15?\n\nDatabase Name:\ndepartment_management\n\nDatabase Schema:\nCREATE TABLE department (\n\tDepartment_ID number,\n\tName text,\n\tCreation text,\n\tRanking number,\n\tBudget_in_Billions number,\n\tNum_Employees number,\n\tprimary key ( Department_ID )\n)\n\nCREATE TABLE head (\n\thead_ID number,\n\tname text,\n\tborn_state text,\n\tage number,\n\tprimary key ( head_ID )\n)\n\nCREATE TABLE management (\n\tdepartment_ID number,\n\thead_ID number,\n\ttemporary_acting text,\n\tprimary key ( department_ID , head_ID ),\n\tforeign key ( department_ID ) references department ( Department_ID ),\n\tforeign key ( head_ID ) references head ( head_ID )\n)\n\nValid Operators:\nThe following operators are available for query decomposition:\n- Scan: Direct table access with no sub-questions\n- Filter: Selection based on conditions\n- Aggregate: Group and compute aggregations\n- Sort: Order results\n- Topsort: Sort and limit results\n- Top: Limit results\n- Join: Combine two sub-queries\n- Except: Set difference between two sub-queries\n- Intersect: Set intersection between two sub-queries\n- Union: Set union of two sub-queries\n\nOperator Rules:\n1. Each decomposition MUST specify exactly one operator from the above list\n2. Operator constraints:\n - Scan: Cannot have sub-questions\n - Filter/Aggregate/Sort/Top/Topsort: Can have 1 sub-question\n - Join/Union/Intersect/Except: Must have exactly 2 sub-questions\n\nTask Description:\n1. You will receive a complex database question that needs to be decomposed\n2. For each question, you should:\n - First, determine the appropriate operator from the valid list\n - Then break it down into sub-questions according to the operator's rules\n - Explain how these sub-questions relate to the original question\n - Indicate the order in which these sub-questions should be answered\n\nResponse Format:\nFor each decomposition step, respond with this exact JSON format without any other text:\n{\n \"type\": \"object\",\n \"properties\": {\n \"index\": {\n \"type\": [\n \"integer\",\n \"null\"\n ]\n },\n \"question\": {\n \"type\": \"string\"\n },\n \"operator\": {\n \"type\": [\n \"string\",\n \"null\"\n ],\n \"enum\": [\n \"Scan\",\n \"Filter\",\n \"Aggregate\",\n \"Sort\",\n \"Top\",\n \"Join\",\n \"Union\",\n \"Intersect\",\n \"Except\",\n null\n ]\n },\n \"sub_questions\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#\"\n }\n }\n },\n \"required\": [\n \"index\",\n \"question\",\n \"operator\"\n ]\n}\n\nConversation Flow:\n1. User will provide the initial complex question\n2. You will:\n a. Choose an appropriate operator\n b. Decompose into sub-questions according to operator rules\n3. User will ask you to decompose one of the sub-questions if needed\n4. This process continues until we reach simple, directly answerable questions (Scan operations)\n\nImportant Rules:\n- Each decomposition MUST use exactly one operator from the valid list\n- Operator choice must be justified and appropriate for the question\n- Sub-questions must comply with the operator's requirements\n- Each sub-question should be simpler than the original question\n- Sub-questions should be clear and self-contained\n- Maintain context between decomposition steps\n- Use only tables and columns that exist in the provided schema\n",
"role": "system"
},
{
"content": "decompose the following question: What is the average number of employees of the departments whose rank is between 10 and 15?",
"role": "user"
},
{
"content": "{\"index\":1,\"question\":\"What is the average number of employees of the departments whose rank is between 10 and 15?\",\"operator\":\"Aggregate\",\"sub_questions\":[{\"index\":2,\"question\":\"What are the number of employees of the departments whose rank is between 10 and 15?\",\"operator\":null,\"sub_questions\":[]}]}",
"role": "assistant"
},
{
"content": "given the decomposition: {\"index\":1,\"question\":\"What is the average number of employees of the departments whose rank is between 10 and 15?\",\"operator\":\"Aggregate\",\"sub_questions\":[{\"index\":2,\"question\":\"What are the number of employees of the departments whose rank is between 10 and 15?\",\"operator\":null,\"sub_questions\":[]}]}\ndecompose the following question with index 2: What are the number of employees of the departments whose rank is between 10 and 15?",
"role": "user"
},
{
"content": "{\"index\":2,\"question\":\"What are the number of employees of the departments whose rank is between 10 and 15?\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
}
] |
47f00f939411fff3d9dd81cdab4b7937fb837492b042f78ebf58dcb092a6f3a8_1
|
department_management
|
What are the number of employees of the departments whose rank is between 10 and 15?
|
[
"#1 = Scan Table [ department ] Predicate [ Ranking >= 10 AND Ranking <= 15 ] Output [ Ranking , Num_Employees ]"
] |
[
"What are the number of employees of the departments whose rank is between 10 and 15?"
] |
[
{
"content": "You are a question decomposition expert. You are given a database schema and a complex database input question in natural language, and your task is to break down the complex database input question into simpler sub-questions in a recursive way, like a tree. In each step you will be given a question to decompose, so that your answer will be the input for the next steps.\n\nInput Question:\nWhat is the average number of employees of the departments whose rank is between 10 and 15?\n\nDatabase Name:\ndepartment_management\n\nDatabase Schema:\nCREATE TABLE department (\n\tDepartment_ID number,\n\tName text,\n\tCreation text,\n\tRanking number,\n\tBudget_in_Billions number,\n\tNum_Employees number,\n\tprimary key ( Department_ID )\n)\n\nCREATE TABLE head (\n\thead_ID number,\n\tname text,\n\tborn_state text,\n\tage number,\n\tprimary key ( head_ID )\n)\n\nCREATE TABLE management (\n\tdepartment_ID number,\n\thead_ID number,\n\ttemporary_acting text,\n\tprimary key ( department_ID , head_ID ),\n\tforeign key ( department_ID ) references department ( Department_ID ),\n\tforeign key ( head_ID ) references head ( head_ID )\n)\n\nValid Operators:\nThe following operators are available for query decomposition:\n- Scan: Direct table access with no sub-questions\n- Filter: Selection based on conditions\n- Aggregate: Group and compute aggregations\n- Sort: Order results\n- Topsort: Sort and limit results\n- Top: Limit results\n- Join: Combine two sub-queries\n- Except: Set difference between two sub-queries\n- Intersect: Set intersection between two sub-queries\n- Union: Set union of two sub-queries\n\nOperator Rules:\n1. Each decomposition MUST specify exactly one operator from the above list\n2. Operator constraints:\n - Scan: Cannot have sub-questions\n - Filter/Aggregate/Sort/Top/Topsort: Can have 1 sub-question\n - Join/Union/Intersect/Except: Must have exactly 2 sub-questions\n\nTask Description:\n1. You will receive a complex database question that needs to be decomposed\n2. For each question, you should:\n - First, determine the appropriate operator from the valid list\n - Then break it down into sub-questions according to the operator's rules\n - Explain how these sub-questions relate to the original question\n - Indicate the order in which these sub-questions should be answered\n\nResponse Format:\nFor each decomposition step, respond with this exact JSON format without any other text:\n{\n \"type\": \"object\",\n \"properties\": {\n \"index\": {\n \"type\": [\n \"integer\",\n \"null\"\n ]\n },\n \"question\": {\n \"type\": \"string\"\n },\n \"operator\": {\n \"type\": [\n \"string\",\n \"null\"\n ],\n \"enum\": [\n \"Scan\",\n \"Filter\",\n \"Aggregate\",\n \"Sort\",\n \"Top\",\n \"Join\",\n \"Union\",\n \"Intersect\",\n \"Except\",\n null\n ]\n },\n \"sub_questions\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#\"\n }\n }\n },\n \"required\": [\n \"index\",\n \"question\",\n \"operator\"\n ]\n}\n\nConversation Flow:\n1. User will provide the initial complex question\n2. You will:\n a. Choose an appropriate operator\n b. Decompose into sub-questions according to operator rules\n3. User will ask you to decompose one of the sub-questions if needed\n4. This process continues until we reach simple, directly answerable questions (Scan operations)\n\nImportant Rules:\n- Each decomposition MUST use exactly one operator from the valid list\n- Operator choice must be justified and appropriate for the question\n- Sub-questions must comply with the operator's requirements\n- Each sub-question should be simpler than the original question\n- Sub-questions should be clear and self-contained\n- Maintain context between decomposition steps\n- Use only tables and columns that exist in the provided schema\n",
"role": "system"
},
{
"content": "decompose the following question: What are the number of employees of the departments whose rank is between 10 and 15?",
"role": "user"
},
{
"content": "{\"index\":1,\"question\":\"What are the number of employees of the departments whose rank is between 10 and 15?\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
}
] |
39ae01b638dcdce3997751511c9c44e3ad8c5f2e705f8ab9598bfd75006f30ef_0
|
department_management
|
What are the names of the heads who are born outside the California state?
|
[
"#1 = Scan Table [ head ] Predicate [ born_state <> 'California' ] Output [ name , born_state ]"
] |
[
"What are the names of the heads who are born outside the California state?"
] |
[
{
"content": "You are a question decomposition expert. You are given a database schema and a complex database input question in natural language, and your task is to break down the complex database input question into simpler sub-questions in a recursive way, like a tree. In each step you will be given a question to decompose, so that your answer will be the input for the next steps.\n\nInput Question:\nWhat are the names of the heads who are born outside the California state?\n\nDatabase Name:\ndepartment_management\n\nDatabase Schema:\nCREATE TABLE department (\n\tDepartment_ID number,\n\tName text,\n\tCreation text,\n\tRanking number,\n\tBudget_in_Billions number,\n\tNum_Employees number,\n\tprimary key ( Department_ID )\n)\n\nCREATE TABLE head (\n\thead_ID number,\n\tname text,\n\tborn_state text,\n\tage number,\n\tprimary key ( head_ID )\n)\n\nCREATE TABLE management (\n\tdepartment_ID number,\n\thead_ID number,\n\ttemporary_acting text,\n\tprimary key ( department_ID , head_ID ),\n\tforeign key ( department_ID ) references department ( Department_ID ),\n\tforeign key ( head_ID ) references head ( head_ID )\n)\n\nValid Operators:\nThe following operators are available for query decomposition:\n- Scan: Direct table access with no sub-questions\n- Filter: Selection based on conditions\n- Aggregate: Group and compute aggregations\n- Sort: Order results\n- Topsort: Sort and limit results\n- Top: Limit results\n- Join: Combine two sub-queries\n- Except: Set difference between two sub-queries\n- Intersect: Set intersection between two sub-queries\n- Union: Set union of two sub-queries\n\nOperator Rules:\n1. Each decomposition MUST specify exactly one operator from the above list\n2. Operator constraints:\n - Scan: Cannot have sub-questions\n - Filter/Aggregate/Sort/Top/Topsort: Can have 1 sub-question\n - Join/Union/Intersect/Except: Must have exactly 2 sub-questions\n\nTask Description:\n1. You will receive a complex database question that needs to be decomposed\n2. For each question, you should:\n - First, determine the appropriate operator from the valid list\n - Then break it down into sub-questions according to the operator's rules\n - Explain how these sub-questions relate to the original question\n - Indicate the order in which these sub-questions should be answered\n\nResponse Format:\nFor each decomposition step, respond with this exact JSON format without any other text:\n{\n \"type\": \"object\",\n \"properties\": {\n \"index\": {\n \"type\": [\n \"integer\",\n \"null\"\n ]\n },\n \"question\": {\n \"type\": \"string\"\n },\n \"operator\": {\n \"type\": [\n \"string\",\n \"null\"\n ],\n \"enum\": [\n \"Scan\",\n \"Filter\",\n \"Aggregate\",\n \"Sort\",\n \"Top\",\n \"Join\",\n \"Union\",\n \"Intersect\",\n \"Except\",\n null\n ]\n },\n \"sub_questions\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#\"\n }\n }\n },\n \"required\": [\n \"index\",\n \"question\",\n \"operator\"\n ]\n}\n\nConversation Flow:\n1. User will provide the initial complex question\n2. You will:\n a. Choose an appropriate operator\n b. Decompose into sub-questions according to operator rules\n3. User will ask you to decompose one of the sub-questions if needed\n4. This process continues until we reach simple, directly answerable questions (Scan operations)\n\nImportant Rules:\n- Each decomposition MUST use exactly one operator from the valid list\n- Operator choice must be justified and appropriate for the question\n- Sub-questions must comply with the operator's requirements\n- Each sub-question should be simpler than the original question\n- Sub-questions should be clear and self-contained\n- Maintain context between decomposition steps\n- Use only tables and columns that exist in the provided schema\n",
"role": "system"
},
{
"content": "decompose the following question: What are the names of the heads who are born outside the California state?",
"role": "user"
},
{
"content": "{\"index\":1,\"question\":\"What are the names of the heads who are born outside the California state?\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
}
] |
3f36f679138a1b0cbb597bd04bf833870f757d27d1f867576d45d426577fcfe5_0
|
department_management
|
What are the distinct creation years of the departments managed by a secretary born in state 'Alabama'?
|
[
"#1 = Scan Table [ head ] Predicate [ born_state = 'Alabama' ] Output [ head_ID , born_state ]",
"#2 = Scan Table [ management ] Output [ head_ID , department_ID ]",
"#3 = Join [ #1 , #2 ] Predicate [ #1.head_ID = #2.head_ID ] Output [ #2.department_ID ]",
"#4 = Scan Table [ department ] Output [ Creation , Department_ID ]",
"#5 = Join [ #3 , #4 ] Predicate [ #3.department_ID = #4.Department_ID ] Distinct [ true ] Output [ #4.Creation ]"
] |
[
"What are the ids of secretaries that born in state 'Alabama'?",
"What are the secretary ids and department ids of all management.",
"What are the ids of the departments managed by a secretary born in state 'Alabama'?",
"What are the ids and creation years of all department?",
"What are the distinct creation years of the departments managed by a secretary born in state 'Alabama'?"
] |
[
{
"content": "You are a question decomposition expert. You are given a database schema and a complex database input question in natural language, and your task is to break down the complex database input question into simpler sub-questions in a recursive way, like a tree. In each step you will be given a question to decompose, so that your answer will be the input for the next steps.\n\nInput Question:\nWhat are the distinct creation years of the departments managed by a secretary born in state 'Alabama'?\n\nDatabase Name:\ndepartment_management\n\nDatabase Schema:\nCREATE TABLE department (\n\tDepartment_ID number,\n\tName text,\n\tCreation text,\n\tRanking number,\n\tBudget_in_Billions number,\n\tNum_Employees number,\n\tprimary key ( Department_ID )\n)\n\nCREATE TABLE head (\n\thead_ID number,\n\tname text,\n\tborn_state text,\n\tage number,\n\tprimary key ( head_ID )\n)\n\nCREATE TABLE management (\n\tdepartment_ID number,\n\thead_ID number,\n\ttemporary_acting text,\n\tprimary key ( department_ID , head_ID ),\n\tforeign key ( department_ID ) references department ( Department_ID ),\n\tforeign key ( head_ID ) references head ( head_ID )\n)\n\nValid Operators:\nThe following operators are available for query decomposition:\n- Scan: Direct table access with no sub-questions\n- Filter: Selection based on conditions\n- Aggregate: Group and compute aggregations\n- Sort: Order results\n- Topsort: Sort and limit results\n- Top: Limit results\n- Join: Combine two sub-queries\n- Except: Set difference between two sub-queries\n- Intersect: Set intersection between two sub-queries\n- Union: Set union of two sub-queries\n\nOperator Rules:\n1. Each decomposition MUST specify exactly one operator from the above list\n2. Operator constraints:\n - Scan: Cannot have sub-questions\n - Filter/Aggregate/Sort/Top/Topsort: Can have 1 sub-question\n - Join/Union/Intersect/Except: Must have exactly 2 sub-questions\n\nTask Description:\n1. You will receive a complex database question that needs to be decomposed\n2. For each question, you should:\n - First, determine the appropriate operator from the valid list\n - Then break it down into sub-questions according to the operator's rules\n - Explain how these sub-questions relate to the original question\n - Indicate the order in which these sub-questions should be answered\n\nResponse Format:\nFor each decomposition step, respond with this exact JSON format without any other text:\n{\n \"type\": \"object\",\n \"properties\": {\n \"index\": {\n \"type\": [\n \"integer\",\n \"null\"\n ]\n },\n \"question\": {\n \"type\": \"string\"\n },\n \"operator\": {\n \"type\": [\n \"string\",\n \"null\"\n ],\n \"enum\": [\n \"Scan\",\n \"Filter\",\n \"Aggregate\",\n \"Sort\",\n \"Top\",\n \"Join\",\n \"Union\",\n \"Intersect\",\n \"Except\",\n null\n ]\n },\n \"sub_questions\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#\"\n }\n }\n },\n \"required\": [\n \"index\",\n \"question\",\n \"operator\"\n ]\n}\n\nConversation Flow:\n1. User will provide the initial complex question\n2. You will:\n a. Choose an appropriate operator\n b. Decompose into sub-questions according to operator rules\n3. User will ask you to decompose one of the sub-questions if needed\n4. This process continues until we reach simple, directly answerable questions (Scan operations)\n\nImportant Rules:\n- Each decomposition MUST use exactly one operator from the valid list\n- Operator choice must be justified and appropriate for the question\n- Sub-questions must comply with the operator's requirements\n- Each sub-question should be simpler than the original question\n- Sub-questions should be clear and self-contained\n- Maintain context between decomposition steps\n- Use only tables and columns that exist in the provided schema\n",
"role": "system"
},
{
"content": "decompose the following question: What are the distinct creation years of the departments managed by a secretary born in state 'Alabama'?",
"role": "user"
},
{
"content": "{\"index\":1,\"question\":\"What are the distinct creation years of the departments managed by a secretary born in state 'Alabama'?\",\"operator\":\"Join\",\"sub_questions\":[{\"index\":2,\"question\":\"What are the ids of the departments managed by a secretary born in state 'Alabama'?\",\"operator\":null,\"sub_questions\":[]},{\"index\":3,\"question\":\"What are the ids and creation years of all department?\",\"operator\":null,\"sub_questions\":[]}]}",
"role": "assistant"
},
{
"content": "given the decomposition: {\"index\":1,\"question\":\"What are the distinct creation years of the departments managed by a secretary born in state 'Alabama'?\",\"operator\":\"Join\",\"sub_questions\":[{\"index\":2,\"question\":\"What are the ids of the departments managed by a secretary born in state 'Alabama'?\",\"operator\":null,\"sub_questions\":[]},{\"index\":3,\"question\":\"What are the ids and creation years of all department?\",\"operator\":null,\"sub_questions\":[]}]}\ndecompose the following question with index 2: What are the ids of the departments managed by a secretary born in state 'Alabama'?",
"role": "user"
},
{
"content": "{\"index\":2,\"question\":\"What are the ids of the departments managed by a secretary born in state 'Alabama'?\",\"operator\":\"Join\",\"sub_questions\":[{\"index\":4,\"question\":\"What are the ids of secretaries that born in state 'Alabama'?\",\"operator\":null,\"sub_questions\":[]},{\"index\":5,\"question\":\"What are the secretary ids and department ids of all management.\",\"operator\":null,\"sub_questions\":[]}]}",
"role": "assistant"
},
{
"content": "given the decomposition: {\"index\":1,\"question\":\"What are the distinct creation years of the departments managed by a secretary born in state 'Alabama'?\",\"operator\":\"Join\",\"sub_questions\":[{\"index\":2,\"question\":\"What are the ids of the departments managed by a secretary born in state 'Alabama'?\",\"operator\":\"Join\",\"sub_questions\":[{\"index\":4,\"question\":\"What are the ids of secretaries that born in state 'Alabama'?\",\"operator\":null,\"sub_questions\":[]},{\"index\":5,\"question\":\"What are the secretary ids and department ids of all management.\",\"operator\":null,\"sub_questions\":[]}]},{\"index\":3,\"question\":\"What are the ids and creation years of all department?\",\"operator\":null,\"sub_questions\":[]}]}\ndecompose the following question with index 3: What are the ids and creation years of all department?",
"role": "user"
},
{
"content": "{\"index\":3,\"question\":\"What are the ids and creation years of all department?\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
},
{
"content": "given the decomposition: {\"index\":1,\"question\":\"What are the distinct creation years of the departments managed by a secretary born in state 'Alabama'?\",\"operator\":\"Join\",\"sub_questions\":[{\"index\":2,\"question\":\"What are the ids of the departments managed by a secretary born in state 'Alabama'?\",\"operator\":\"Join\",\"sub_questions\":[{\"index\":4,\"question\":\"What are the ids of secretaries that born in state 'Alabama'?\",\"operator\":null,\"sub_questions\":[]},{\"index\":5,\"question\":\"What are the secretary ids and department ids of all management.\",\"operator\":null,\"sub_questions\":[]}]},{\"index\":3,\"question\":\"What are the ids and creation years of all department?\",\"operator\":\"Scan\",\"sub_questions\":[]}]}\ndecompose the following question with index 4: What are the ids of secretaries that born in state 'Alabama'?",
"role": "user"
},
{
"content": "{\"index\":4,\"question\":\"What are the ids of secretaries that born in state 'Alabama'?\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
},
{
"content": "given the decomposition: {\"index\":1,\"question\":\"What are the distinct creation years of the departments managed by a secretary born in state 'Alabama'?\",\"operator\":\"Join\",\"sub_questions\":[{\"index\":2,\"question\":\"What are the ids of the departments managed by a secretary born in state 'Alabama'?\",\"operator\":\"Join\",\"sub_questions\":[{\"index\":4,\"question\":\"What are the ids of secretaries that born in state 'Alabama'?\",\"operator\":\"Scan\",\"sub_questions\":[]},{\"index\":5,\"question\":\"What are the secretary ids and department ids of all management.\",\"operator\":null,\"sub_questions\":[]}]},{\"index\":3,\"question\":\"What are the ids and creation years of all department?\",\"operator\":\"Scan\",\"sub_questions\":[]}]}\ndecompose the following question with index 5: What are the secretary ids and department ids of all management.",
"role": "user"
},
{
"content": "{\"index\":5,\"question\":\"What are the secretary ids and department ids of all management.\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
}
] |
3f36f679138a1b0cbb597bd04bf833870f757d27d1f867576d45d426577fcfe5_1
|
department_management
|
What are the ids of the departments managed by a secretary born in state 'Alabama'?
|
[
"#1 = Scan Table [ head ] Predicate [ born_state = 'Alabama' ] Output [ head_ID , born_state ]",
"#2 = Scan Table [ management ] Output [ head_ID , department_ID ]",
"#3 = Join [ #1 , #2 ] Predicate [ #1.head_ID = #2.head_ID ] Output [ #2.department_ID ]"
] |
[
"What are the ids of secretaries that born in state 'Alabama'?",
"What are the secretary ids and department ids of all management.",
"What are the ids of the departments managed by a secretary born in state 'Alabama'?"
] |
[
{
"content": "You are a question decomposition expert. You are given a database schema and a complex database input question in natural language, and your task is to break down the complex database input question into simpler sub-questions in a recursive way, like a tree. In each step you will be given a question to decompose, so that your answer will be the input for the next steps.\n\nInput Question:\nWhat are the distinct creation years of the departments managed by a secretary born in state 'Alabama'?\n\nDatabase Name:\ndepartment_management\n\nDatabase Schema:\nCREATE TABLE department (\n\tDepartment_ID number,\n\tName text,\n\tCreation text,\n\tRanking number,\n\tBudget_in_Billions number,\n\tNum_Employees number,\n\tprimary key ( Department_ID )\n)\n\nCREATE TABLE head (\n\thead_ID number,\n\tname text,\n\tborn_state text,\n\tage number,\n\tprimary key ( head_ID )\n)\n\nCREATE TABLE management (\n\tdepartment_ID number,\n\thead_ID number,\n\ttemporary_acting text,\n\tprimary key ( department_ID , head_ID ),\n\tforeign key ( department_ID ) references department ( Department_ID ),\n\tforeign key ( head_ID ) references head ( head_ID )\n)\n\nValid Operators:\nThe following operators are available for query decomposition:\n- Scan: Direct table access with no sub-questions\n- Filter: Selection based on conditions\n- Aggregate: Group and compute aggregations\n- Sort: Order results\n- Topsort: Sort and limit results\n- Top: Limit results\n- Join: Combine two sub-queries\n- Except: Set difference between two sub-queries\n- Intersect: Set intersection between two sub-queries\n- Union: Set union of two sub-queries\n\nOperator Rules:\n1. Each decomposition MUST specify exactly one operator from the above list\n2. Operator constraints:\n - Scan: Cannot have sub-questions\n - Filter/Aggregate/Sort/Top/Topsort: Can have 1 sub-question\n - Join/Union/Intersect/Except: Must have exactly 2 sub-questions\n\nTask Description:\n1. You will receive a complex database question that needs to be decomposed\n2. For each question, you should:\n - First, determine the appropriate operator from the valid list\n - Then break it down into sub-questions according to the operator's rules\n - Explain how these sub-questions relate to the original question\n - Indicate the order in which these sub-questions should be answered\n\nResponse Format:\nFor each decomposition step, respond with this exact JSON format without any other text:\n{\n \"type\": \"object\",\n \"properties\": {\n \"index\": {\n \"type\": [\n \"integer\",\n \"null\"\n ]\n },\n \"question\": {\n \"type\": \"string\"\n },\n \"operator\": {\n \"type\": [\n \"string\",\n \"null\"\n ],\n \"enum\": [\n \"Scan\",\n \"Filter\",\n \"Aggregate\",\n \"Sort\",\n \"Top\",\n \"Join\",\n \"Union\",\n \"Intersect\",\n \"Except\",\n null\n ]\n },\n \"sub_questions\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#\"\n }\n }\n },\n \"required\": [\n \"index\",\n \"question\",\n \"operator\"\n ]\n}\n\nConversation Flow:\n1. User will provide the initial complex question\n2. You will:\n a. Choose an appropriate operator\n b. Decompose into sub-questions according to operator rules\n3. User will ask you to decompose one of the sub-questions if needed\n4. This process continues until we reach simple, directly answerable questions (Scan operations)\n\nImportant Rules:\n- Each decomposition MUST use exactly one operator from the valid list\n- Operator choice must be justified and appropriate for the question\n- Sub-questions must comply with the operator's requirements\n- Each sub-question should be simpler than the original question\n- Sub-questions should be clear and self-contained\n- Maintain context between decomposition steps\n- Use only tables and columns that exist in the provided schema\n",
"role": "system"
},
{
"content": "decompose the following question: What are the ids of the departments managed by a secretary born in state 'Alabama'?",
"role": "user"
},
{
"content": "{\"index\":1,\"question\":\"What are the ids of the departments managed by a secretary born in state 'Alabama'?\",\"operator\":\"Join\",\"sub_questions\":[{\"index\":2,\"question\":\"What are the ids of secretaries that born in state 'Alabama'?\",\"operator\":null,\"sub_questions\":[]},{\"index\":3,\"question\":\"What are the secretary ids and department ids of all management.\",\"operator\":null,\"sub_questions\":[]}]}",
"role": "assistant"
},
{
"content": "given the decomposition: {\"index\":1,\"question\":\"What are the ids of the departments managed by a secretary born in state 'Alabama'?\",\"operator\":\"Join\",\"sub_questions\":[{\"index\":2,\"question\":\"What are the ids of secretaries that born in state 'Alabama'?\",\"operator\":null,\"sub_questions\":[]},{\"index\":3,\"question\":\"What are the secretary ids and department ids of all management.\",\"operator\":null,\"sub_questions\":[]}]}\ndecompose the following question with index 2: What are the ids of secretaries that born in state 'Alabama'?",
"role": "user"
},
{
"content": "{\"index\":2,\"question\":\"What are the ids of secretaries that born in state 'Alabama'?\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
},
{
"content": "given the decomposition: {\"index\":1,\"question\":\"What are the ids of the departments managed by a secretary born in state 'Alabama'?\",\"operator\":\"Join\",\"sub_questions\":[{\"index\":2,\"question\":\"What are the ids of secretaries that born in state 'Alabama'?\",\"operator\":\"Scan\",\"sub_questions\":[]},{\"index\":3,\"question\":\"What are the secretary ids and department ids of all management.\",\"operator\":null,\"sub_questions\":[]}]}\ndecompose the following question with index 3: What are the secretary ids and department ids of all management.",
"role": "user"
},
{
"content": "{\"index\":3,\"question\":\"What are the secretary ids and department ids of all management.\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
}
] |
3f36f679138a1b0cbb597bd04bf833870f757d27d1f867576d45d426577fcfe5_2
|
department_management
|
What are the ids and creation years of all department?
|
[
"#1 = Scan Table [ department ] Output [ Creation , Department_ID ]"
] |
[
"What are the ids and creation years of all department?"
] |
[
{
"content": "You are a question decomposition expert. You are given a database schema and a complex database input question in natural language, and your task is to break down the complex database input question into simpler sub-questions in a recursive way, like a tree. In each step you will be given a question to decompose, so that your answer will be the input for the next steps.\n\nInput Question:\nWhat are the distinct creation years of the departments managed by a secretary born in state 'Alabama'?\n\nDatabase Name:\ndepartment_management\n\nDatabase Schema:\nCREATE TABLE department (\n\tDepartment_ID number,\n\tName text,\n\tCreation text,\n\tRanking number,\n\tBudget_in_Billions number,\n\tNum_Employees number,\n\tprimary key ( Department_ID )\n)\n\nCREATE TABLE head (\n\thead_ID number,\n\tname text,\n\tborn_state text,\n\tage number,\n\tprimary key ( head_ID )\n)\n\nCREATE TABLE management (\n\tdepartment_ID number,\n\thead_ID number,\n\ttemporary_acting text,\n\tprimary key ( department_ID , head_ID ),\n\tforeign key ( department_ID ) references department ( Department_ID ),\n\tforeign key ( head_ID ) references head ( head_ID )\n)\n\nValid Operators:\nThe following operators are available for query decomposition:\n- Scan: Direct table access with no sub-questions\n- Filter: Selection based on conditions\n- Aggregate: Group and compute aggregations\n- Sort: Order results\n- Topsort: Sort and limit results\n- Top: Limit results\n- Join: Combine two sub-queries\n- Except: Set difference between two sub-queries\n- Intersect: Set intersection between two sub-queries\n- Union: Set union of two sub-queries\n\nOperator Rules:\n1. Each decomposition MUST specify exactly one operator from the above list\n2. Operator constraints:\n - Scan: Cannot have sub-questions\n - Filter/Aggregate/Sort/Top/Topsort: Can have 1 sub-question\n - Join/Union/Intersect/Except: Must have exactly 2 sub-questions\n\nTask Description:\n1. You will receive a complex database question that needs to be decomposed\n2. For each question, you should:\n - First, determine the appropriate operator from the valid list\n - Then break it down into sub-questions according to the operator's rules\n - Explain how these sub-questions relate to the original question\n - Indicate the order in which these sub-questions should be answered\n\nResponse Format:\nFor each decomposition step, respond with this exact JSON format without any other text:\n{\n \"type\": \"object\",\n \"properties\": {\n \"index\": {\n \"type\": [\n \"integer\",\n \"null\"\n ]\n },\n \"question\": {\n \"type\": \"string\"\n },\n \"operator\": {\n \"type\": [\n \"string\",\n \"null\"\n ],\n \"enum\": [\n \"Scan\",\n \"Filter\",\n \"Aggregate\",\n \"Sort\",\n \"Top\",\n \"Join\",\n \"Union\",\n \"Intersect\",\n \"Except\",\n null\n ]\n },\n \"sub_questions\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#\"\n }\n }\n },\n \"required\": [\n \"index\",\n \"question\",\n \"operator\"\n ]\n}\n\nConversation Flow:\n1. User will provide the initial complex question\n2. You will:\n a. Choose an appropriate operator\n b. Decompose into sub-questions according to operator rules\n3. User will ask you to decompose one of the sub-questions if needed\n4. This process continues until we reach simple, directly answerable questions (Scan operations)\n\nImportant Rules:\n- Each decomposition MUST use exactly one operator from the valid list\n- Operator choice must be justified and appropriate for the question\n- Sub-questions must comply with the operator's requirements\n- Each sub-question should be simpler than the original question\n- Sub-questions should be clear and self-contained\n- Maintain context between decomposition steps\n- Use only tables and columns that exist in the provided schema\n",
"role": "system"
},
{
"content": "decompose the following question: What are the ids and creation years of all department?",
"role": "user"
},
{
"content": "{\"index\":1,\"question\":\"What are the ids and creation years of all department?\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
}
] |
3f36f679138a1b0cbb597bd04bf833870f757d27d1f867576d45d426577fcfe5_3
|
department_management
|
What are the ids of secretaries that born in state 'Alabama'?
|
[
"#1 = Scan Table [ head ] Predicate [ born_state = 'Alabama' ] Output [ head_ID , born_state ]"
] |
[
"What are the ids of secretaries that born in state 'Alabama'?"
] |
[
{
"content": "You are a question decomposition expert. You are given a database schema and a complex database input question in natural language, and your task is to break down the complex database input question into simpler sub-questions in a recursive way, like a tree. In each step you will be given a question to decompose, so that your answer will be the input for the next steps.\n\nInput Question:\nWhat are the distinct creation years of the departments managed by a secretary born in state 'Alabama'?\n\nDatabase Name:\ndepartment_management\n\nDatabase Schema:\nCREATE TABLE department (\n\tDepartment_ID number,\n\tName text,\n\tCreation text,\n\tRanking number,\n\tBudget_in_Billions number,\n\tNum_Employees number,\n\tprimary key ( Department_ID )\n)\n\nCREATE TABLE head (\n\thead_ID number,\n\tname text,\n\tborn_state text,\n\tage number,\n\tprimary key ( head_ID )\n)\n\nCREATE TABLE management (\n\tdepartment_ID number,\n\thead_ID number,\n\ttemporary_acting text,\n\tprimary key ( department_ID , head_ID ),\n\tforeign key ( department_ID ) references department ( Department_ID ),\n\tforeign key ( head_ID ) references head ( head_ID )\n)\n\nValid Operators:\nThe following operators are available for query decomposition:\n- Scan: Direct table access with no sub-questions\n- Filter: Selection based on conditions\n- Aggregate: Group and compute aggregations\n- Sort: Order results\n- Topsort: Sort and limit results\n- Top: Limit results\n- Join: Combine two sub-queries\n- Except: Set difference between two sub-queries\n- Intersect: Set intersection between two sub-queries\n- Union: Set union of two sub-queries\n\nOperator Rules:\n1. Each decomposition MUST specify exactly one operator from the above list\n2. Operator constraints:\n - Scan: Cannot have sub-questions\n - Filter/Aggregate/Sort/Top/Topsort: Can have 1 sub-question\n - Join/Union/Intersect/Except: Must have exactly 2 sub-questions\n\nTask Description:\n1. You will receive a complex database question that needs to be decomposed\n2. For each question, you should:\n - First, determine the appropriate operator from the valid list\n - Then break it down into sub-questions according to the operator's rules\n - Explain how these sub-questions relate to the original question\n - Indicate the order in which these sub-questions should be answered\n\nResponse Format:\nFor each decomposition step, respond with this exact JSON format without any other text:\n{\n \"type\": \"object\",\n \"properties\": {\n \"index\": {\n \"type\": [\n \"integer\",\n \"null\"\n ]\n },\n \"question\": {\n \"type\": \"string\"\n },\n \"operator\": {\n \"type\": [\n \"string\",\n \"null\"\n ],\n \"enum\": [\n \"Scan\",\n \"Filter\",\n \"Aggregate\",\n \"Sort\",\n \"Top\",\n \"Join\",\n \"Union\",\n \"Intersect\",\n \"Except\",\n null\n ]\n },\n \"sub_questions\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#\"\n }\n }\n },\n \"required\": [\n \"index\",\n \"question\",\n \"operator\"\n ]\n}\n\nConversation Flow:\n1. User will provide the initial complex question\n2. You will:\n a. Choose an appropriate operator\n b. Decompose into sub-questions according to operator rules\n3. User will ask you to decompose one of the sub-questions if needed\n4. This process continues until we reach simple, directly answerable questions (Scan operations)\n\nImportant Rules:\n- Each decomposition MUST use exactly one operator from the valid list\n- Operator choice must be justified and appropriate for the question\n- Sub-questions must comply with the operator's requirements\n- Each sub-question should be simpler than the original question\n- Sub-questions should be clear and self-contained\n- Maintain context between decomposition steps\n- Use only tables and columns that exist in the provided schema\n",
"role": "system"
},
{
"content": "decompose the following question: What are the ids of secretaries that born in state 'Alabama'?",
"role": "user"
},
{
"content": "{\"index\":1,\"question\":\"What are the ids of secretaries that born in state 'Alabama'?\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
}
] |
3f36f679138a1b0cbb597bd04bf833870f757d27d1f867576d45d426577fcfe5_4
|
department_management
|
What are the secretary ids and department ids of all management.
|
[
"#1 = Scan Table [ management ] Output [ head_ID , department_ID ]"
] |
[
"What are the secretary ids and department ids of all management."
] |
[
{
"content": "You are a question decomposition expert. You are given a database schema and a complex database input question in natural language, and your task is to break down the complex database input question into simpler sub-questions in a recursive way, like a tree. In each step you will be given a question to decompose, so that your answer will be the input for the next steps.\n\nInput Question:\nWhat are the distinct creation years of the departments managed by a secretary born in state 'Alabama'?\n\nDatabase Name:\ndepartment_management\n\nDatabase Schema:\nCREATE TABLE department (\n\tDepartment_ID number,\n\tName text,\n\tCreation text,\n\tRanking number,\n\tBudget_in_Billions number,\n\tNum_Employees number,\n\tprimary key ( Department_ID )\n)\n\nCREATE TABLE head (\n\thead_ID number,\n\tname text,\n\tborn_state text,\n\tage number,\n\tprimary key ( head_ID )\n)\n\nCREATE TABLE management (\n\tdepartment_ID number,\n\thead_ID number,\n\ttemporary_acting text,\n\tprimary key ( department_ID , head_ID ),\n\tforeign key ( department_ID ) references department ( Department_ID ),\n\tforeign key ( head_ID ) references head ( head_ID )\n)\n\nValid Operators:\nThe following operators are available for query decomposition:\n- Scan: Direct table access with no sub-questions\n- Filter: Selection based on conditions\n- Aggregate: Group and compute aggregations\n- Sort: Order results\n- Topsort: Sort and limit results\n- Top: Limit results\n- Join: Combine two sub-queries\n- Except: Set difference between two sub-queries\n- Intersect: Set intersection between two sub-queries\n- Union: Set union of two sub-queries\n\nOperator Rules:\n1. Each decomposition MUST specify exactly one operator from the above list\n2. Operator constraints:\n - Scan: Cannot have sub-questions\n - Filter/Aggregate/Sort/Top/Topsort: Can have 1 sub-question\n - Join/Union/Intersect/Except: Must have exactly 2 sub-questions\n\nTask Description:\n1. You will receive a complex database question that needs to be decomposed\n2. For each question, you should:\n - First, determine the appropriate operator from the valid list\n - Then break it down into sub-questions according to the operator's rules\n - Explain how these sub-questions relate to the original question\n - Indicate the order in which these sub-questions should be answered\n\nResponse Format:\nFor each decomposition step, respond with this exact JSON format without any other text:\n{\n \"type\": \"object\",\n \"properties\": {\n \"index\": {\n \"type\": [\n \"integer\",\n \"null\"\n ]\n },\n \"question\": {\n \"type\": \"string\"\n },\n \"operator\": {\n \"type\": [\n \"string\",\n \"null\"\n ],\n \"enum\": [\n \"Scan\",\n \"Filter\",\n \"Aggregate\",\n \"Sort\",\n \"Top\",\n \"Join\",\n \"Union\",\n \"Intersect\",\n \"Except\",\n null\n ]\n },\n \"sub_questions\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#\"\n }\n }\n },\n \"required\": [\n \"index\",\n \"question\",\n \"operator\"\n ]\n}\n\nConversation Flow:\n1. User will provide the initial complex question\n2. You will:\n a. Choose an appropriate operator\n b. Decompose into sub-questions according to operator rules\n3. User will ask you to decompose one of the sub-questions if needed\n4. This process continues until we reach simple, directly answerable questions (Scan operations)\n\nImportant Rules:\n- Each decomposition MUST use exactly one operator from the valid list\n- Operator choice must be justified and appropriate for the question\n- Sub-questions must comply with the operator's requirements\n- Each sub-question should be simpler than the original question\n- Sub-questions should be clear and self-contained\n- Maintain context between decomposition steps\n- Use only tables and columns that exist in the provided schema\n",
"role": "system"
},
{
"content": "decompose the following question: What are the secretary ids and department ids of all management.",
"role": "user"
},
{
"content": "{\"index\":1,\"question\":\"What are the secretary ids and department ids of all management.\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
}
] |
00651f398215c361491c8d06175867c38b39a535517c378d98e8f7f5a0e6191f_0
|
department_management
|
What are the names of the states where at least 3 heads were born?
|
[
"#1 = Scan Table [ head ] Output [ born_state ]",
"#2 = Aggregate [ #1 ] GroupBy [ born_state ] Output [ countstar AS Count_Star , born_state ]",
"#3 = Filter [ #2 ] Predicate [ Count_Star >= 3 ] Output [ born_state ]"
] |
[
"What are the born states of all heads?",
"What are the different born states and the number of heads born there?",
"What are the names of the states where at least 3 heads were born?"
] |
[
{
"content": "You are a question decomposition expert. You are given a database schema and a complex database input question in natural language, and your task is to break down the complex database input question into simpler sub-questions in a recursive way, like a tree. In each step you will be given a question to decompose, so that your answer will be the input for the next steps.\n\nInput Question:\nWhat are the names of the states where at least 3 heads were born?\n\nDatabase Name:\ndepartment_management\n\nDatabase Schema:\nCREATE TABLE department (\n\tDepartment_ID number,\n\tName text,\n\tCreation text,\n\tRanking number,\n\tBudget_in_Billions number,\n\tNum_Employees number,\n\tprimary key ( Department_ID )\n)\n\nCREATE TABLE head (\n\thead_ID number,\n\tname text,\n\tborn_state text,\n\tage number,\n\tprimary key ( head_ID )\n)\n\nCREATE TABLE management (\n\tdepartment_ID number,\n\thead_ID number,\n\ttemporary_acting text,\n\tprimary key ( department_ID , head_ID ),\n\tforeign key ( department_ID ) references department ( Department_ID ),\n\tforeign key ( head_ID ) references head ( head_ID )\n)\n\nValid Operators:\nThe following operators are available for query decomposition:\n- Scan: Direct table access with no sub-questions\n- Filter: Selection based on conditions\n- Aggregate: Group and compute aggregations\n- Sort: Order results\n- Topsort: Sort and limit results\n- Top: Limit results\n- Join: Combine two sub-queries\n- Except: Set difference between two sub-queries\n- Intersect: Set intersection between two sub-queries\n- Union: Set union of two sub-queries\n\nOperator Rules:\n1. Each decomposition MUST specify exactly one operator from the above list\n2. Operator constraints:\n - Scan: Cannot have sub-questions\n - Filter/Aggregate/Sort/Top/Topsort: Can have 1 sub-question\n - Join/Union/Intersect/Except: Must have exactly 2 sub-questions\n\nTask Description:\n1. You will receive a complex database question that needs to be decomposed\n2. For each question, you should:\n - First, determine the appropriate operator from the valid list\n - Then break it down into sub-questions according to the operator's rules\n - Explain how these sub-questions relate to the original question\n - Indicate the order in which these sub-questions should be answered\n\nResponse Format:\nFor each decomposition step, respond with this exact JSON format without any other text:\n{\n \"type\": \"object\",\n \"properties\": {\n \"index\": {\n \"type\": [\n \"integer\",\n \"null\"\n ]\n },\n \"question\": {\n \"type\": \"string\"\n },\n \"operator\": {\n \"type\": [\n \"string\",\n \"null\"\n ],\n \"enum\": [\n \"Scan\",\n \"Filter\",\n \"Aggregate\",\n \"Sort\",\n \"Top\",\n \"Join\",\n \"Union\",\n \"Intersect\",\n \"Except\",\n null\n ]\n },\n \"sub_questions\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#\"\n }\n }\n },\n \"required\": [\n \"index\",\n \"question\",\n \"operator\"\n ]\n}\n\nConversation Flow:\n1. User will provide the initial complex question\n2. You will:\n a. Choose an appropriate operator\n b. Decompose into sub-questions according to operator rules\n3. User will ask you to decompose one of the sub-questions if needed\n4. This process continues until we reach simple, directly answerable questions (Scan operations)\n\nImportant Rules:\n- Each decomposition MUST use exactly one operator from the valid list\n- Operator choice must be justified and appropriate for the question\n- Sub-questions must comply with the operator's requirements\n- Each sub-question should be simpler than the original question\n- Sub-questions should be clear and self-contained\n- Maintain context between decomposition steps\n- Use only tables and columns that exist in the provided schema\n",
"role": "system"
},
{
"content": "decompose the following question: What are the names of the states where at least 3 heads were born?",
"role": "user"
},
{
"content": "{\"index\":1,\"question\":\"What are the names of the states where at least 3 heads were born?\",\"operator\":\"Filter\",\"sub_questions\":[{\"index\":2,\"question\":\"What are the different born states and the number of heads born there?\",\"operator\":null,\"sub_questions\":[]}]}",
"role": "assistant"
},
{
"content": "given the decomposition: {\"index\":1,\"question\":\"What are the names of the states where at least 3 heads were born?\",\"operator\":\"Filter\",\"sub_questions\":[{\"index\":2,\"question\":\"What are the different born states and the number of heads born there?\",\"operator\":null,\"sub_questions\":[]}]}\ndecompose the following question with index 2: What are the different born states and the number of heads born there?",
"role": "user"
},
{
"content": "{\"index\":2,\"question\":\"What are the different born states and the number of heads born there?\",\"operator\":\"Aggregate\",\"sub_questions\":[{\"index\":3,\"question\":\"What are the born states of all heads?\",\"operator\":null,\"sub_questions\":[]}]}",
"role": "assistant"
},
{
"content": "given the decomposition: {\"index\":1,\"question\":\"What are the names of the states where at least 3 heads were born?\",\"operator\":\"Filter\",\"sub_questions\":[{\"index\":2,\"question\":\"What are the different born states and the number of heads born there?\",\"operator\":\"Aggregate\",\"sub_questions\":[{\"index\":3,\"question\":\"What are the born states of all heads?\",\"operator\":null,\"sub_questions\":[]}]}]}\ndecompose the following question with index 3: What are the born states of all heads?",
"role": "user"
},
{
"content": "{\"index\":3,\"question\":\"What are the born states of all heads?\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
}
] |
00651f398215c361491c8d06175867c38b39a535517c378d98e8f7f5a0e6191f_1
|
department_management
|
What are the different born states and the number of heads born there?
|
[
"#1 = Scan Table [ head ] Output [ born_state ]",
"#2 = Aggregate [ #1 ] GroupBy [ born_state ] Output [ countstar AS Count_Star , born_state ]"
] |
[
"What are the born states of all heads?",
"What are the different born states and the number of heads born there?"
] |
[
{
"content": "You are a question decomposition expert. You are given a database schema and a complex database input question in natural language, and your task is to break down the complex database input question into simpler sub-questions in a recursive way, like a tree. In each step you will be given a question to decompose, so that your answer will be the input for the next steps.\n\nInput Question:\nWhat are the names of the states where at least 3 heads were born?\n\nDatabase Name:\ndepartment_management\n\nDatabase Schema:\nCREATE TABLE department (\n\tDepartment_ID number,\n\tName text,\n\tCreation text,\n\tRanking number,\n\tBudget_in_Billions number,\n\tNum_Employees number,\n\tprimary key ( Department_ID )\n)\n\nCREATE TABLE head (\n\thead_ID number,\n\tname text,\n\tborn_state text,\n\tage number,\n\tprimary key ( head_ID )\n)\n\nCREATE TABLE management (\n\tdepartment_ID number,\n\thead_ID number,\n\ttemporary_acting text,\n\tprimary key ( department_ID , head_ID ),\n\tforeign key ( department_ID ) references department ( Department_ID ),\n\tforeign key ( head_ID ) references head ( head_ID )\n)\n\nValid Operators:\nThe following operators are available for query decomposition:\n- Scan: Direct table access with no sub-questions\n- Filter: Selection based on conditions\n- Aggregate: Group and compute aggregations\n- Sort: Order results\n- Topsort: Sort and limit results\n- Top: Limit results\n- Join: Combine two sub-queries\n- Except: Set difference between two sub-queries\n- Intersect: Set intersection between two sub-queries\n- Union: Set union of two sub-queries\n\nOperator Rules:\n1. Each decomposition MUST specify exactly one operator from the above list\n2. Operator constraints:\n - Scan: Cannot have sub-questions\n - Filter/Aggregate/Sort/Top/Topsort: Can have 1 sub-question\n - Join/Union/Intersect/Except: Must have exactly 2 sub-questions\n\nTask Description:\n1. You will receive a complex database question that needs to be decomposed\n2. For each question, you should:\n - First, determine the appropriate operator from the valid list\n - Then break it down into sub-questions according to the operator's rules\n - Explain how these sub-questions relate to the original question\n - Indicate the order in which these sub-questions should be answered\n\nResponse Format:\nFor each decomposition step, respond with this exact JSON format without any other text:\n{\n \"type\": \"object\",\n \"properties\": {\n \"index\": {\n \"type\": [\n \"integer\",\n \"null\"\n ]\n },\n \"question\": {\n \"type\": \"string\"\n },\n \"operator\": {\n \"type\": [\n \"string\",\n \"null\"\n ],\n \"enum\": [\n \"Scan\",\n \"Filter\",\n \"Aggregate\",\n \"Sort\",\n \"Top\",\n \"Join\",\n \"Union\",\n \"Intersect\",\n \"Except\",\n null\n ]\n },\n \"sub_questions\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#\"\n }\n }\n },\n \"required\": [\n \"index\",\n \"question\",\n \"operator\"\n ]\n}\n\nConversation Flow:\n1. User will provide the initial complex question\n2. You will:\n a. Choose an appropriate operator\n b. Decompose into sub-questions according to operator rules\n3. User will ask you to decompose one of the sub-questions if needed\n4. This process continues until we reach simple, directly answerable questions (Scan operations)\n\nImportant Rules:\n- Each decomposition MUST use exactly one operator from the valid list\n- Operator choice must be justified and appropriate for the question\n- Sub-questions must comply with the operator's requirements\n- Each sub-question should be simpler than the original question\n- Sub-questions should be clear and self-contained\n- Maintain context between decomposition steps\n- Use only tables and columns that exist in the provided schema\n",
"role": "system"
},
{
"content": "decompose the following question: What are the different born states and the number of heads born there?",
"role": "user"
},
{
"content": "{\"index\":1,\"question\":\"What are the different born states and the number of heads born there?\",\"operator\":\"Aggregate\",\"sub_questions\":[{\"index\":2,\"question\":\"What are the born states of all heads?\",\"operator\":null,\"sub_questions\":[]}]}",
"role": "assistant"
},
{
"content": "given the decomposition: {\"index\":1,\"question\":\"What are the different born states and the number of heads born there?\",\"operator\":\"Aggregate\",\"sub_questions\":[{\"index\":2,\"question\":\"What are the born states of all heads?\",\"operator\":null,\"sub_questions\":[]}]}\ndecompose the following question with index 2: What are the born states of all heads?",
"role": "user"
},
{
"content": "{\"index\":2,\"question\":\"What are the born states of all heads?\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
}
] |
00651f398215c361491c8d06175867c38b39a535517c378d98e8f7f5a0e6191f_2
|
department_management
|
What are the born states of all heads?
|
[
"#1 = Scan Table [ head ] Output [ born_state ]"
] |
[
"What are the born states of all heads?"
] |
[
{
"content": "You are a question decomposition expert. You are given a database schema and a complex database input question in natural language, and your task is to break down the complex database input question into simpler sub-questions in a recursive way, like a tree. In each step you will be given a question to decompose, so that your answer will be the input for the next steps.\n\nInput Question:\nWhat are the names of the states where at least 3 heads were born?\n\nDatabase Name:\ndepartment_management\n\nDatabase Schema:\nCREATE TABLE department (\n\tDepartment_ID number,\n\tName text,\n\tCreation text,\n\tRanking number,\n\tBudget_in_Billions number,\n\tNum_Employees number,\n\tprimary key ( Department_ID )\n)\n\nCREATE TABLE head (\n\thead_ID number,\n\tname text,\n\tborn_state text,\n\tage number,\n\tprimary key ( head_ID )\n)\n\nCREATE TABLE management (\n\tdepartment_ID number,\n\thead_ID number,\n\ttemporary_acting text,\n\tprimary key ( department_ID , head_ID ),\n\tforeign key ( department_ID ) references department ( Department_ID ),\n\tforeign key ( head_ID ) references head ( head_ID )\n)\n\nValid Operators:\nThe following operators are available for query decomposition:\n- Scan: Direct table access with no sub-questions\n- Filter: Selection based on conditions\n- Aggregate: Group and compute aggregations\n- Sort: Order results\n- Topsort: Sort and limit results\n- Top: Limit results\n- Join: Combine two sub-queries\n- Except: Set difference between two sub-queries\n- Intersect: Set intersection between two sub-queries\n- Union: Set union of two sub-queries\n\nOperator Rules:\n1. Each decomposition MUST specify exactly one operator from the above list\n2. Operator constraints:\n - Scan: Cannot have sub-questions\n - Filter/Aggregate/Sort/Top/Topsort: Can have 1 sub-question\n - Join/Union/Intersect/Except: Must have exactly 2 sub-questions\n\nTask Description:\n1. You will receive a complex database question that needs to be decomposed\n2. For each question, you should:\n - First, determine the appropriate operator from the valid list\n - Then break it down into sub-questions according to the operator's rules\n - Explain how these sub-questions relate to the original question\n - Indicate the order in which these sub-questions should be answered\n\nResponse Format:\nFor each decomposition step, respond with this exact JSON format without any other text:\n{\n \"type\": \"object\",\n \"properties\": {\n \"index\": {\n \"type\": [\n \"integer\",\n \"null\"\n ]\n },\n \"question\": {\n \"type\": \"string\"\n },\n \"operator\": {\n \"type\": [\n \"string\",\n \"null\"\n ],\n \"enum\": [\n \"Scan\",\n \"Filter\",\n \"Aggregate\",\n \"Sort\",\n \"Top\",\n \"Join\",\n \"Union\",\n \"Intersect\",\n \"Except\",\n null\n ]\n },\n \"sub_questions\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#\"\n }\n }\n },\n \"required\": [\n \"index\",\n \"question\",\n \"operator\"\n ]\n}\n\nConversation Flow:\n1. User will provide the initial complex question\n2. You will:\n a. Choose an appropriate operator\n b. Decompose into sub-questions according to operator rules\n3. User will ask you to decompose one of the sub-questions if needed\n4. This process continues until we reach simple, directly answerable questions (Scan operations)\n\nImportant Rules:\n- Each decomposition MUST use exactly one operator from the valid list\n- Operator choice must be justified and appropriate for the question\n- Sub-questions must comply with the operator's requirements\n- Each sub-question should be simpler than the original question\n- Sub-questions should be clear and self-contained\n- Maintain context between decomposition steps\n- Use only tables and columns that exist in the provided schema\n",
"role": "system"
},
{
"content": "decompose the following question: What are the born states of all heads?",
"role": "user"
},
{
"content": "{\"index\":1,\"question\":\"What are the born states of all heads?\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
}
] |
586865d060d7830514507ad9c19a330a0fe3f7dd3a21dc88d9c82b2c0b3f3626_0
|
department_management
|
In which year were most departments established?
|
[
"#1 = Scan Table [ department ] Output [ Creation ]",
"#2 = Aggregate [ #1 ] GroupBy [ Creation ] Output [ Creation , countstar AS Count_Star ]",
"#3 = TopSort [ #2 ] Rows [ 1 ] OrderBy [ Count_Star DESC ] Output [ Creation , Count_Star ]"
] |
[
"What is the establishment year of all departments?",
"What are the number of departments established for each establishment year?",
"In which year were most departments established?"
] |
[
{
"content": "You are a question decomposition expert. You are given a database schema and a complex database input question in natural language, and your task is to break down the complex database input question into simpler sub-questions in a recursive way, like a tree. In each step you will be given a question to decompose, so that your answer will be the input for the next steps.\n\nInput Question:\nIn which year were most departments established?\n\nDatabase Name:\ndepartment_management\n\nDatabase Schema:\nCREATE TABLE department (\n\tDepartment_ID number,\n\tName text,\n\tCreation text,\n\tRanking number,\n\tBudget_in_Billions number,\n\tNum_Employees number,\n\tprimary key ( Department_ID )\n)\n\nCREATE TABLE head (\n\thead_ID number,\n\tname text,\n\tborn_state text,\n\tage number,\n\tprimary key ( head_ID )\n)\n\nCREATE TABLE management (\n\tdepartment_ID number,\n\thead_ID number,\n\ttemporary_acting text,\n\tprimary key ( department_ID , head_ID ),\n\tforeign key ( department_ID ) references department ( Department_ID ),\n\tforeign key ( head_ID ) references head ( head_ID )\n)\n\nValid Operators:\nThe following operators are available for query decomposition:\n- Scan: Direct table access with no sub-questions\n- Filter: Selection based on conditions\n- Aggregate: Group and compute aggregations\n- Sort: Order results\n- Topsort: Sort and limit results\n- Top: Limit results\n- Join: Combine two sub-queries\n- Except: Set difference between two sub-queries\n- Intersect: Set intersection between two sub-queries\n- Union: Set union of two sub-queries\n\nOperator Rules:\n1. Each decomposition MUST specify exactly one operator from the above list\n2. Operator constraints:\n - Scan: Cannot have sub-questions\n - Filter/Aggregate/Sort/Top/Topsort: Can have 1 sub-question\n - Join/Union/Intersect/Except: Must have exactly 2 sub-questions\n\nTask Description:\n1. You will receive a complex database question that needs to be decomposed\n2. For each question, you should:\n - First, determine the appropriate operator from the valid list\n - Then break it down into sub-questions according to the operator's rules\n - Explain how these sub-questions relate to the original question\n - Indicate the order in which these sub-questions should be answered\n\nResponse Format:\nFor each decomposition step, respond with this exact JSON format without any other text:\n{\n \"type\": \"object\",\n \"properties\": {\n \"index\": {\n \"type\": [\n \"integer\",\n \"null\"\n ]\n },\n \"question\": {\n \"type\": \"string\"\n },\n \"operator\": {\n \"type\": [\n \"string\",\n \"null\"\n ],\n \"enum\": [\n \"Scan\",\n \"Filter\",\n \"Aggregate\",\n \"Sort\",\n \"Top\",\n \"Join\",\n \"Union\",\n \"Intersect\",\n \"Except\",\n null\n ]\n },\n \"sub_questions\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#\"\n }\n }\n },\n \"required\": [\n \"index\",\n \"question\",\n \"operator\"\n ]\n}\n\nConversation Flow:\n1. User will provide the initial complex question\n2. You will:\n a. Choose an appropriate operator\n b. Decompose into sub-questions according to operator rules\n3. User will ask you to decompose one of the sub-questions if needed\n4. This process continues until we reach simple, directly answerable questions (Scan operations)\n\nImportant Rules:\n- Each decomposition MUST use exactly one operator from the valid list\n- Operator choice must be justified and appropriate for the question\n- Sub-questions must comply with the operator's requirements\n- Each sub-question should be simpler than the original question\n- Sub-questions should be clear and self-contained\n- Maintain context between decomposition steps\n- Use only tables and columns that exist in the provided schema\n",
"role": "system"
},
{
"content": "decompose the following question: In which year were most departments established?",
"role": "user"
},
{
"content": "{\"index\":1,\"question\":\"In which year were most departments established?\",\"operator\":\"TopSort\",\"sub_questions\":[{\"index\":2,\"question\":\"What are the number of departments established for each establishment year?\",\"operator\":null,\"sub_questions\":[]}]}",
"role": "assistant"
},
{
"content": "given the decomposition: {\"index\":1,\"question\":\"In which year were most departments established?\",\"operator\":\"TopSort\",\"sub_questions\":[{\"index\":2,\"question\":\"What are the number of departments established for each establishment year?\",\"operator\":null,\"sub_questions\":[]}]}\ndecompose the following question with index 2: What are the number of departments established for each establishment year?",
"role": "user"
},
{
"content": "{\"index\":2,\"question\":\"What are the number of departments established for each establishment year?\",\"operator\":\"Aggregate\",\"sub_questions\":[{\"index\":3,\"question\":\"What is the establishment year of all departments?\",\"operator\":null,\"sub_questions\":[]}]}",
"role": "assistant"
},
{
"content": "given the decomposition: {\"index\":1,\"question\":\"In which year were most departments established?\",\"operator\":\"TopSort\",\"sub_questions\":[{\"index\":2,\"question\":\"What are the number of departments established for each establishment year?\",\"operator\":\"Aggregate\",\"sub_questions\":[{\"index\":3,\"question\":\"What is the establishment year of all departments?\",\"operator\":null,\"sub_questions\":[]}]}]}\ndecompose the following question with index 3: What is the establishment year of all departments?",
"role": "user"
},
{
"content": "{\"index\":3,\"question\":\"What is the establishment year of all departments?\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
}
] |
586865d060d7830514507ad9c19a330a0fe3f7dd3a21dc88d9c82b2c0b3f3626_1
|
department_management
|
What are the number of departments established for each establishment year?
|
[
"#1 = Scan Table [ department ] Output [ Creation ]",
"#2 = Aggregate [ #1 ] GroupBy [ Creation ] Output [ Creation , countstar AS Count_Star ]"
] |
[
"What is the establishment year of all departments?",
"What are the number of departments established for each establishment year?"
] |
[
{
"content": "You are a question decomposition expert. You are given a database schema and a complex database input question in natural language, and your task is to break down the complex database input question into simpler sub-questions in a recursive way, like a tree. In each step you will be given a question to decompose, so that your answer will be the input for the next steps.\n\nInput Question:\nIn which year were most departments established?\n\nDatabase Name:\ndepartment_management\n\nDatabase Schema:\nCREATE TABLE department (\n\tDepartment_ID number,\n\tName text,\n\tCreation text,\n\tRanking number,\n\tBudget_in_Billions number,\n\tNum_Employees number,\n\tprimary key ( Department_ID )\n)\n\nCREATE TABLE head (\n\thead_ID number,\n\tname text,\n\tborn_state text,\n\tage number,\n\tprimary key ( head_ID )\n)\n\nCREATE TABLE management (\n\tdepartment_ID number,\n\thead_ID number,\n\ttemporary_acting text,\n\tprimary key ( department_ID , head_ID ),\n\tforeign key ( department_ID ) references department ( Department_ID ),\n\tforeign key ( head_ID ) references head ( head_ID )\n)\n\nValid Operators:\nThe following operators are available for query decomposition:\n- Scan: Direct table access with no sub-questions\n- Filter: Selection based on conditions\n- Aggregate: Group and compute aggregations\n- Sort: Order results\n- Topsort: Sort and limit results\n- Top: Limit results\n- Join: Combine two sub-queries\n- Except: Set difference between two sub-queries\n- Intersect: Set intersection between two sub-queries\n- Union: Set union of two sub-queries\n\nOperator Rules:\n1. Each decomposition MUST specify exactly one operator from the above list\n2. Operator constraints:\n - Scan: Cannot have sub-questions\n - Filter/Aggregate/Sort/Top/Topsort: Can have 1 sub-question\n - Join/Union/Intersect/Except: Must have exactly 2 sub-questions\n\nTask Description:\n1. You will receive a complex database question that needs to be decomposed\n2. For each question, you should:\n - First, determine the appropriate operator from the valid list\n - Then break it down into sub-questions according to the operator's rules\n - Explain how these sub-questions relate to the original question\n - Indicate the order in which these sub-questions should be answered\n\nResponse Format:\nFor each decomposition step, respond with this exact JSON format without any other text:\n{\n \"type\": \"object\",\n \"properties\": {\n \"index\": {\n \"type\": [\n \"integer\",\n \"null\"\n ]\n },\n \"question\": {\n \"type\": \"string\"\n },\n \"operator\": {\n \"type\": [\n \"string\",\n \"null\"\n ],\n \"enum\": [\n \"Scan\",\n \"Filter\",\n \"Aggregate\",\n \"Sort\",\n \"Top\",\n \"Join\",\n \"Union\",\n \"Intersect\",\n \"Except\",\n null\n ]\n },\n \"sub_questions\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#\"\n }\n }\n },\n \"required\": [\n \"index\",\n \"question\",\n \"operator\"\n ]\n}\n\nConversation Flow:\n1. User will provide the initial complex question\n2. You will:\n a. Choose an appropriate operator\n b. Decompose into sub-questions according to operator rules\n3. User will ask you to decompose one of the sub-questions if needed\n4. This process continues until we reach simple, directly answerable questions (Scan operations)\n\nImportant Rules:\n- Each decomposition MUST use exactly one operator from the valid list\n- Operator choice must be justified and appropriate for the question\n- Sub-questions must comply with the operator's requirements\n- Each sub-question should be simpler than the original question\n- Sub-questions should be clear and self-contained\n- Maintain context between decomposition steps\n- Use only tables and columns that exist in the provided schema\n",
"role": "system"
},
{
"content": "decompose the following question: What are the number of departments established for each establishment year?",
"role": "user"
},
{
"content": "{\"index\":1,\"question\":\"What are the number of departments established for each establishment year?\",\"operator\":\"Aggregate\",\"sub_questions\":[{\"index\":2,\"question\":\"What is the establishment year of all departments?\",\"operator\":null,\"sub_questions\":[]}]}",
"role": "assistant"
},
{
"content": "given the decomposition: {\"index\":1,\"question\":\"What are the number of departments established for each establishment year?\",\"operator\":\"Aggregate\",\"sub_questions\":[{\"index\":2,\"question\":\"What is the establishment year of all departments?\",\"operator\":null,\"sub_questions\":[]}]}\ndecompose the following question with index 2: What is the establishment year of all departments?",
"role": "user"
},
{
"content": "{\"index\":2,\"question\":\"What is the establishment year of all departments?\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
}
] |
586865d060d7830514507ad9c19a330a0fe3f7dd3a21dc88d9c82b2c0b3f3626_2
|
department_management
|
What is the establishment year of all departments?
|
[
"#1 = Scan Table [ department ] Output [ Creation ]"
] |
[
"What is the establishment year of all departments?"
] |
[
{
"content": "You are a question decomposition expert. You are given a database schema and a complex database input question in natural language, and your task is to break down the complex database input question into simpler sub-questions in a recursive way, like a tree. In each step you will be given a question to decompose, so that your answer will be the input for the next steps.\n\nInput Question:\nIn which year were most departments established?\n\nDatabase Name:\ndepartment_management\n\nDatabase Schema:\nCREATE TABLE department (\n\tDepartment_ID number,\n\tName text,\n\tCreation text,\n\tRanking number,\n\tBudget_in_Billions number,\n\tNum_Employees number,\n\tprimary key ( Department_ID )\n)\n\nCREATE TABLE head (\n\thead_ID number,\n\tname text,\n\tborn_state text,\n\tage number,\n\tprimary key ( head_ID )\n)\n\nCREATE TABLE management (\n\tdepartment_ID number,\n\thead_ID number,\n\ttemporary_acting text,\n\tprimary key ( department_ID , head_ID ),\n\tforeign key ( department_ID ) references department ( Department_ID ),\n\tforeign key ( head_ID ) references head ( head_ID )\n)\n\nValid Operators:\nThe following operators are available for query decomposition:\n- Scan: Direct table access with no sub-questions\n- Filter: Selection based on conditions\n- Aggregate: Group and compute aggregations\n- Sort: Order results\n- Topsort: Sort and limit results\n- Top: Limit results\n- Join: Combine two sub-queries\n- Except: Set difference between two sub-queries\n- Intersect: Set intersection between two sub-queries\n- Union: Set union of two sub-queries\n\nOperator Rules:\n1. Each decomposition MUST specify exactly one operator from the above list\n2. Operator constraints:\n - Scan: Cannot have sub-questions\n - Filter/Aggregate/Sort/Top/Topsort: Can have 1 sub-question\n - Join/Union/Intersect/Except: Must have exactly 2 sub-questions\n\nTask Description:\n1. You will receive a complex database question that needs to be decomposed\n2. For each question, you should:\n - First, determine the appropriate operator from the valid list\n - Then break it down into sub-questions according to the operator's rules\n - Explain how these sub-questions relate to the original question\n - Indicate the order in which these sub-questions should be answered\n\nResponse Format:\nFor each decomposition step, respond with this exact JSON format without any other text:\n{\n \"type\": \"object\",\n \"properties\": {\n \"index\": {\n \"type\": [\n \"integer\",\n \"null\"\n ]\n },\n \"question\": {\n \"type\": \"string\"\n },\n \"operator\": {\n \"type\": [\n \"string\",\n \"null\"\n ],\n \"enum\": [\n \"Scan\",\n \"Filter\",\n \"Aggregate\",\n \"Sort\",\n \"Top\",\n \"Join\",\n \"Union\",\n \"Intersect\",\n \"Except\",\n null\n ]\n },\n \"sub_questions\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#\"\n }\n }\n },\n \"required\": [\n \"index\",\n \"question\",\n \"operator\"\n ]\n}\n\nConversation Flow:\n1. User will provide the initial complex question\n2. You will:\n a. Choose an appropriate operator\n b. Decompose into sub-questions according to operator rules\n3. User will ask you to decompose one of the sub-questions if needed\n4. This process continues until we reach simple, directly answerable questions (Scan operations)\n\nImportant Rules:\n- Each decomposition MUST use exactly one operator from the valid list\n- Operator choice must be justified and appropriate for the question\n- Sub-questions must comply with the operator's requirements\n- Each sub-question should be simpler than the original question\n- Sub-questions should be clear and self-contained\n- Maintain context between decomposition steps\n- Use only tables and columns that exist in the provided schema\n",
"role": "system"
},
{
"content": "decompose the following question: What is the establishment year of all departments?",
"role": "user"
},
{
"content": "{\"index\":1,\"question\":\"What is the establishment year of all departments?\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
}
] |
a755587236ae98ce64932aae821a229a2fa5c22085e4ae14a98c9e2ed37913e1_0
|
department_management
|
Show the name and number of employees for the departments managed by heads whose temporary acting value is 'Yes'?
|
[
"#1 = Scan Table [ management ] Predicate [ temporary_acting = 'Yes' ] Output [ temporary_acting , department_ID ]",
"#2 = Scan Table [ department ] Output [ Name , Department_ID , Num_Employees ]",
"#3 = Join [ #1 , #2 ] Predicate [ #1.department_ID = #2.Department_ID ] Output [ #2.Name , #2.Num_Employees ]"
] |
[
"Show the id for the departments managed by heads whose temporary acting value is 'Yes'.",
"Show the id, name and number of employees of all departments.",
"Show the name and number of employees for the departments managed by heads whose temporary acting value is 'Yes'?"
] |
[
{
"content": "You are a question decomposition expert. You are given a database schema and a complex database input question in natural language, and your task is to break down the complex database input question into simpler sub-questions in a recursive way, like a tree. In each step you will be given a question to decompose, so that your answer will be the input for the next steps.\n\nInput Question:\nShow the name and number of employees for the departments managed by heads whose temporary acting value is 'Yes'?\n\nDatabase Name:\ndepartment_management\n\nDatabase Schema:\nCREATE TABLE department (\n\tDepartment_ID number,\n\tName text,\n\tCreation text,\n\tRanking number,\n\tBudget_in_Billions number,\n\tNum_Employees number,\n\tprimary key ( Department_ID )\n)\n\nCREATE TABLE head (\n\thead_ID number,\n\tname text,\n\tborn_state text,\n\tage number,\n\tprimary key ( head_ID )\n)\n\nCREATE TABLE management (\n\tdepartment_ID number,\n\thead_ID number,\n\ttemporary_acting text,\n\tprimary key ( department_ID , head_ID ),\n\tforeign key ( department_ID ) references department ( Department_ID ),\n\tforeign key ( head_ID ) references head ( head_ID )\n)\n\nValid Operators:\nThe following operators are available for query decomposition:\n- Scan: Direct table access with no sub-questions\n- Filter: Selection based on conditions\n- Aggregate: Group and compute aggregations\n- Sort: Order results\n- Topsort: Sort and limit results\n- Top: Limit results\n- Join: Combine two sub-queries\n- Except: Set difference between two sub-queries\n- Intersect: Set intersection between two sub-queries\n- Union: Set union of two sub-queries\n\nOperator Rules:\n1. Each decomposition MUST specify exactly one operator from the above list\n2. Operator constraints:\n - Scan: Cannot have sub-questions\n - Filter/Aggregate/Sort/Top/Topsort: Can have 1 sub-question\n - Join/Union/Intersect/Except: Must have exactly 2 sub-questions\n\nTask Description:\n1. You will receive a complex database question that needs to be decomposed\n2. For each question, you should:\n - First, determine the appropriate operator from the valid list\n - Then break it down into sub-questions according to the operator's rules\n - Explain how these sub-questions relate to the original question\n - Indicate the order in which these sub-questions should be answered\n\nResponse Format:\nFor each decomposition step, respond with this exact JSON format without any other text:\n{\n \"type\": \"object\",\n \"properties\": {\n \"index\": {\n \"type\": [\n \"integer\",\n \"null\"\n ]\n },\n \"question\": {\n \"type\": \"string\"\n },\n \"operator\": {\n \"type\": [\n \"string\",\n \"null\"\n ],\n \"enum\": [\n \"Scan\",\n \"Filter\",\n \"Aggregate\",\n \"Sort\",\n \"Top\",\n \"Join\",\n \"Union\",\n \"Intersect\",\n \"Except\",\n null\n ]\n },\n \"sub_questions\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#\"\n }\n }\n },\n \"required\": [\n \"index\",\n \"question\",\n \"operator\"\n ]\n}\n\nConversation Flow:\n1. User will provide the initial complex question\n2. You will:\n a. Choose an appropriate operator\n b. Decompose into sub-questions according to operator rules\n3. User will ask you to decompose one of the sub-questions if needed\n4. This process continues until we reach simple, directly answerable questions (Scan operations)\n\nImportant Rules:\n- Each decomposition MUST use exactly one operator from the valid list\n- Operator choice must be justified and appropriate for the question\n- Sub-questions must comply with the operator's requirements\n- Each sub-question should be simpler than the original question\n- Sub-questions should be clear and self-contained\n- Maintain context between decomposition steps\n- Use only tables and columns that exist in the provided schema\n",
"role": "system"
},
{
"content": "decompose the following question: Show the name and number of employees for the departments managed by heads whose temporary acting value is 'Yes'?",
"role": "user"
},
{
"content": "{\"index\":1,\"question\":\"Show the name and number of employees for the departments managed by heads whose temporary acting value is 'Yes'?\",\"operator\":\"Join\",\"sub_questions\":[{\"index\":2,\"question\":\"Show the id for the departments managed by heads whose temporary acting value is 'Yes'.\",\"operator\":null,\"sub_questions\":[]},{\"index\":3,\"question\":\"Show the id, name and number of employees of all departments.\",\"operator\":null,\"sub_questions\":[]}]}",
"role": "assistant"
},
{
"content": "given the decomposition: {\"index\":1,\"question\":\"Show the name and number of employees for the departments managed by heads whose temporary acting value is 'Yes'?\",\"operator\":\"Join\",\"sub_questions\":[{\"index\":2,\"question\":\"Show the id for the departments managed by heads whose temporary acting value is 'Yes'.\",\"operator\":null,\"sub_questions\":[]},{\"index\":3,\"question\":\"Show the id, name and number of employees of all departments.\",\"operator\":null,\"sub_questions\":[]}]}\ndecompose the following question with index 2: Show the id for the departments managed by heads whose temporary acting value is 'Yes'.",
"role": "user"
},
{
"content": "{\"index\":2,\"question\":\"Show the id for the departments managed by heads whose temporary acting value is 'Yes'.\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
},
{
"content": "given the decomposition: {\"index\":1,\"question\":\"Show the name and number of employees for the departments managed by heads whose temporary acting value is 'Yes'?\",\"operator\":\"Join\",\"sub_questions\":[{\"index\":2,\"question\":\"Show the id for the departments managed by heads whose temporary acting value is 'Yes'.\",\"operator\":\"Scan\",\"sub_questions\":[]},{\"index\":3,\"question\":\"Show the id, name and number of employees of all departments.\",\"operator\":null,\"sub_questions\":[]}]}\ndecompose the following question with index 3: Show the id, name and number of employees of all departments.",
"role": "user"
},
{
"content": "{\"index\":3,\"question\":\"Show the id, name and number of employees of all departments.\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
}
] |
a755587236ae98ce64932aae821a229a2fa5c22085e4ae14a98c9e2ed37913e1_1
|
department_management
|
Show the id for the departments managed by heads whose temporary acting value is 'Yes'.
|
[
"#1 = Scan Table [ management ] Predicate [ temporary_acting = 'Yes' ] Output [ temporary_acting , department_ID ]"
] |
[
"Show the id for the departments managed by heads whose temporary acting value is 'Yes'."
] |
[
{
"content": "You are a question decomposition expert. You are given a database schema and a complex database input question in natural language, and your task is to break down the complex database input question into simpler sub-questions in a recursive way, like a tree. In each step you will be given a question to decompose, so that your answer will be the input for the next steps.\n\nInput Question:\nShow the name and number of employees for the departments managed by heads whose temporary acting value is 'Yes'?\n\nDatabase Name:\ndepartment_management\n\nDatabase Schema:\nCREATE TABLE department (\n\tDepartment_ID number,\n\tName text,\n\tCreation text,\n\tRanking number,\n\tBudget_in_Billions number,\n\tNum_Employees number,\n\tprimary key ( Department_ID )\n)\n\nCREATE TABLE head (\n\thead_ID number,\n\tname text,\n\tborn_state text,\n\tage number,\n\tprimary key ( head_ID )\n)\n\nCREATE TABLE management (\n\tdepartment_ID number,\n\thead_ID number,\n\ttemporary_acting text,\n\tprimary key ( department_ID , head_ID ),\n\tforeign key ( department_ID ) references department ( Department_ID ),\n\tforeign key ( head_ID ) references head ( head_ID )\n)\n\nValid Operators:\nThe following operators are available for query decomposition:\n- Scan: Direct table access with no sub-questions\n- Filter: Selection based on conditions\n- Aggregate: Group and compute aggregations\n- Sort: Order results\n- Topsort: Sort and limit results\n- Top: Limit results\n- Join: Combine two sub-queries\n- Except: Set difference between two sub-queries\n- Intersect: Set intersection between two sub-queries\n- Union: Set union of two sub-queries\n\nOperator Rules:\n1. Each decomposition MUST specify exactly one operator from the above list\n2. Operator constraints:\n - Scan: Cannot have sub-questions\n - Filter/Aggregate/Sort/Top/Topsort: Can have 1 sub-question\n - Join/Union/Intersect/Except: Must have exactly 2 sub-questions\n\nTask Description:\n1. You will receive a complex database question that needs to be decomposed\n2. For each question, you should:\n - First, determine the appropriate operator from the valid list\n - Then break it down into sub-questions according to the operator's rules\n - Explain how these sub-questions relate to the original question\n - Indicate the order in which these sub-questions should be answered\n\nResponse Format:\nFor each decomposition step, respond with this exact JSON format without any other text:\n{\n \"type\": \"object\",\n \"properties\": {\n \"index\": {\n \"type\": [\n \"integer\",\n \"null\"\n ]\n },\n \"question\": {\n \"type\": \"string\"\n },\n \"operator\": {\n \"type\": [\n \"string\",\n \"null\"\n ],\n \"enum\": [\n \"Scan\",\n \"Filter\",\n \"Aggregate\",\n \"Sort\",\n \"Top\",\n \"Join\",\n \"Union\",\n \"Intersect\",\n \"Except\",\n null\n ]\n },\n \"sub_questions\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#\"\n }\n }\n },\n \"required\": [\n \"index\",\n \"question\",\n \"operator\"\n ]\n}\n\nConversation Flow:\n1. User will provide the initial complex question\n2. You will:\n a. Choose an appropriate operator\n b. Decompose into sub-questions according to operator rules\n3. User will ask you to decompose one of the sub-questions if needed\n4. This process continues until we reach simple, directly answerable questions (Scan operations)\n\nImportant Rules:\n- Each decomposition MUST use exactly one operator from the valid list\n- Operator choice must be justified and appropriate for the question\n- Sub-questions must comply with the operator's requirements\n- Each sub-question should be simpler than the original question\n- Sub-questions should be clear and self-contained\n- Maintain context between decomposition steps\n- Use only tables and columns that exist in the provided schema\n",
"role": "system"
},
{
"content": "decompose the following question: Show the id for the departments managed by heads whose temporary acting value is 'Yes'.",
"role": "user"
},
{
"content": "{\"index\":1,\"question\":\"Show the id for the departments managed by heads whose temporary acting value is 'Yes'.\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
}
] |
a755587236ae98ce64932aae821a229a2fa5c22085e4ae14a98c9e2ed37913e1_2
|
department_management
|
Show the id, name and number of employees of all departments.
|
[
"#1 = Scan Table [ department ] Output [ Name , Department_ID , Num_Employees ]"
] |
[
"Show the id, name and number of employees of all departments."
] |
[
{
"content": "You are a question decomposition expert. You are given a database schema and a complex database input question in natural language, and your task is to break down the complex database input question into simpler sub-questions in a recursive way, like a tree. In each step you will be given a question to decompose, so that your answer will be the input for the next steps.\n\nInput Question:\nShow the name and number of employees for the departments managed by heads whose temporary acting value is 'Yes'?\n\nDatabase Name:\ndepartment_management\n\nDatabase Schema:\nCREATE TABLE department (\n\tDepartment_ID number,\n\tName text,\n\tCreation text,\n\tRanking number,\n\tBudget_in_Billions number,\n\tNum_Employees number,\n\tprimary key ( Department_ID )\n)\n\nCREATE TABLE head (\n\thead_ID number,\n\tname text,\n\tborn_state text,\n\tage number,\n\tprimary key ( head_ID )\n)\n\nCREATE TABLE management (\n\tdepartment_ID number,\n\thead_ID number,\n\ttemporary_acting text,\n\tprimary key ( department_ID , head_ID ),\n\tforeign key ( department_ID ) references department ( Department_ID ),\n\tforeign key ( head_ID ) references head ( head_ID )\n)\n\nValid Operators:\nThe following operators are available for query decomposition:\n- Scan: Direct table access with no sub-questions\n- Filter: Selection based on conditions\n- Aggregate: Group and compute aggregations\n- Sort: Order results\n- Topsort: Sort and limit results\n- Top: Limit results\n- Join: Combine two sub-queries\n- Except: Set difference between two sub-queries\n- Intersect: Set intersection between two sub-queries\n- Union: Set union of two sub-queries\n\nOperator Rules:\n1. Each decomposition MUST specify exactly one operator from the above list\n2. Operator constraints:\n - Scan: Cannot have sub-questions\n - Filter/Aggregate/Sort/Top/Topsort: Can have 1 sub-question\n - Join/Union/Intersect/Except: Must have exactly 2 sub-questions\n\nTask Description:\n1. You will receive a complex database question that needs to be decomposed\n2. For each question, you should:\n - First, determine the appropriate operator from the valid list\n - Then break it down into sub-questions according to the operator's rules\n - Explain how these sub-questions relate to the original question\n - Indicate the order in which these sub-questions should be answered\n\nResponse Format:\nFor each decomposition step, respond with this exact JSON format without any other text:\n{\n \"type\": \"object\",\n \"properties\": {\n \"index\": {\n \"type\": [\n \"integer\",\n \"null\"\n ]\n },\n \"question\": {\n \"type\": \"string\"\n },\n \"operator\": {\n \"type\": [\n \"string\",\n \"null\"\n ],\n \"enum\": [\n \"Scan\",\n \"Filter\",\n \"Aggregate\",\n \"Sort\",\n \"Top\",\n \"Join\",\n \"Union\",\n \"Intersect\",\n \"Except\",\n null\n ]\n },\n \"sub_questions\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#\"\n }\n }\n },\n \"required\": [\n \"index\",\n \"question\",\n \"operator\"\n ]\n}\n\nConversation Flow:\n1. User will provide the initial complex question\n2. You will:\n a. Choose an appropriate operator\n b. Decompose into sub-questions according to operator rules\n3. User will ask you to decompose one of the sub-questions if needed\n4. This process continues until we reach simple, directly answerable questions (Scan operations)\n\nImportant Rules:\n- Each decomposition MUST use exactly one operator from the valid list\n- Operator choice must be justified and appropriate for the question\n- Sub-questions must comply with the operator's requirements\n- Each sub-question should be simpler than the original question\n- Sub-questions should be clear and self-contained\n- Maintain context between decomposition steps\n- Use only tables and columns that exist in the provided schema\n",
"role": "system"
},
{
"content": "decompose the following question: Show the id, name and number of employees of all departments.",
"role": "user"
},
{
"content": "{\"index\":1,\"question\":\"Show the id, name and number of employees of all departments.\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
}
] |
91d8d2fd0df0fc77fca751084707e55ef77ded3b9fddf66b2c3a0152bf83fd22_0
|
department_management
|
How many acting statuses are there?
|
[
"#1 = Scan Table [ management ] Distinct [ true ] Output [ temporary_acting ]",
"#2 = Aggregate [ #1 ] Output [ countstar AS Count_Star ]"
] |
[
"List the different acting statuses.",
"How many acting statuses are there?"
] |
[
{
"content": "You are a question decomposition expert. You are given a database schema and a complex database input question in natural language, and your task is to break down the complex database input question into simpler sub-questions in a recursive way, like a tree. In each step you will be given a question to decompose, so that your answer will be the input for the next steps.\n\nInput Question:\nHow many acting statuses are there?\n\nDatabase Name:\ndepartment_management\n\nDatabase Schema:\nCREATE TABLE department (\n\tDepartment_ID number,\n\tName text,\n\tCreation text,\n\tRanking number,\n\tBudget_in_Billions number,\n\tNum_Employees number,\n\tprimary key ( Department_ID )\n)\n\nCREATE TABLE head (\n\thead_ID number,\n\tname text,\n\tborn_state text,\n\tage number,\n\tprimary key ( head_ID )\n)\n\nCREATE TABLE management (\n\tdepartment_ID number,\n\thead_ID number,\n\ttemporary_acting text,\n\tprimary key ( department_ID , head_ID ),\n\tforeign key ( department_ID ) references department ( Department_ID ),\n\tforeign key ( head_ID ) references head ( head_ID )\n)\n\nValid Operators:\nThe following operators are available for query decomposition:\n- Scan: Direct table access with no sub-questions\n- Filter: Selection based on conditions\n- Aggregate: Group and compute aggregations\n- Sort: Order results\n- Topsort: Sort and limit results\n- Top: Limit results\n- Join: Combine two sub-queries\n- Except: Set difference between two sub-queries\n- Intersect: Set intersection between two sub-queries\n- Union: Set union of two sub-queries\n\nOperator Rules:\n1. Each decomposition MUST specify exactly one operator from the above list\n2. Operator constraints:\n - Scan: Cannot have sub-questions\n - Filter/Aggregate/Sort/Top/Topsort: Can have 1 sub-question\n - Join/Union/Intersect/Except: Must have exactly 2 sub-questions\n\nTask Description:\n1. You will receive a complex database question that needs to be decomposed\n2. For each question, you should:\n - First, determine the appropriate operator from the valid list\n - Then break it down into sub-questions according to the operator's rules\n - Explain how these sub-questions relate to the original question\n - Indicate the order in which these sub-questions should be answered\n\nResponse Format:\nFor each decomposition step, respond with this exact JSON format without any other text:\n{\n \"type\": \"object\",\n \"properties\": {\n \"index\": {\n \"type\": [\n \"integer\",\n \"null\"\n ]\n },\n \"question\": {\n \"type\": \"string\"\n },\n \"operator\": {\n \"type\": [\n \"string\",\n \"null\"\n ],\n \"enum\": [\n \"Scan\",\n \"Filter\",\n \"Aggregate\",\n \"Sort\",\n \"Top\",\n \"Join\",\n \"Union\",\n \"Intersect\",\n \"Except\",\n null\n ]\n },\n \"sub_questions\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#\"\n }\n }\n },\n \"required\": [\n \"index\",\n \"question\",\n \"operator\"\n ]\n}\n\nConversation Flow:\n1. User will provide the initial complex question\n2. You will:\n a. Choose an appropriate operator\n b. Decompose into sub-questions according to operator rules\n3. User will ask you to decompose one of the sub-questions if needed\n4. This process continues until we reach simple, directly answerable questions (Scan operations)\n\nImportant Rules:\n- Each decomposition MUST use exactly one operator from the valid list\n- Operator choice must be justified and appropriate for the question\n- Sub-questions must comply with the operator's requirements\n- Each sub-question should be simpler than the original question\n- Sub-questions should be clear and self-contained\n- Maintain context between decomposition steps\n- Use only tables and columns that exist in the provided schema\n",
"role": "system"
},
{
"content": "decompose the following question: How many acting statuses are there?",
"role": "user"
},
{
"content": "{\"index\":1,\"question\":\"How many acting statuses are there?\",\"operator\":\"Aggregate\",\"sub_questions\":[{\"index\":2,\"question\":\"List the different acting statuses.\",\"operator\":null,\"sub_questions\":[]}]}",
"role": "assistant"
},
{
"content": "given the decomposition: {\"index\":1,\"question\":\"How many acting statuses are there?\",\"operator\":\"Aggregate\",\"sub_questions\":[{\"index\":2,\"question\":\"List the different acting statuses.\",\"operator\":null,\"sub_questions\":[]}]}\ndecompose the following question with index 2: List the different acting statuses.",
"role": "user"
},
{
"content": "{\"index\":2,\"question\":\"List the different acting statuses.\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
}
] |
91d8d2fd0df0fc77fca751084707e55ef77ded3b9fddf66b2c3a0152bf83fd22_1
|
department_management
|
List the different acting statuses.
|
[
"#1 = Scan Table [ management ] Distinct [ true ] Output [ temporary_acting ]"
] |
[
"List the different acting statuses."
] |
[
{
"content": "You are a question decomposition expert. You are given a database schema and a complex database input question in natural language, and your task is to break down the complex database input question into simpler sub-questions in a recursive way, like a tree. In each step you will be given a question to decompose, so that your answer will be the input for the next steps.\n\nInput Question:\nHow many acting statuses are there?\n\nDatabase Name:\ndepartment_management\n\nDatabase Schema:\nCREATE TABLE department (\n\tDepartment_ID number,\n\tName text,\n\tCreation text,\n\tRanking number,\n\tBudget_in_Billions number,\n\tNum_Employees number,\n\tprimary key ( Department_ID )\n)\n\nCREATE TABLE head (\n\thead_ID number,\n\tname text,\n\tborn_state text,\n\tage number,\n\tprimary key ( head_ID )\n)\n\nCREATE TABLE management (\n\tdepartment_ID number,\n\thead_ID number,\n\ttemporary_acting text,\n\tprimary key ( department_ID , head_ID ),\n\tforeign key ( department_ID ) references department ( Department_ID ),\n\tforeign key ( head_ID ) references head ( head_ID )\n)\n\nValid Operators:\nThe following operators are available for query decomposition:\n- Scan: Direct table access with no sub-questions\n- Filter: Selection based on conditions\n- Aggregate: Group and compute aggregations\n- Sort: Order results\n- Topsort: Sort and limit results\n- Top: Limit results\n- Join: Combine two sub-queries\n- Except: Set difference between two sub-queries\n- Intersect: Set intersection between two sub-queries\n- Union: Set union of two sub-queries\n\nOperator Rules:\n1. Each decomposition MUST specify exactly one operator from the above list\n2. Operator constraints:\n - Scan: Cannot have sub-questions\n - Filter/Aggregate/Sort/Top/Topsort: Can have 1 sub-question\n - Join/Union/Intersect/Except: Must have exactly 2 sub-questions\n\nTask Description:\n1. You will receive a complex database question that needs to be decomposed\n2. For each question, you should:\n - First, determine the appropriate operator from the valid list\n - Then break it down into sub-questions according to the operator's rules\n - Explain how these sub-questions relate to the original question\n - Indicate the order in which these sub-questions should be answered\n\nResponse Format:\nFor each decomposition step, respond with this exact JSON format without any other text:\n{\n \"type\": \"object\",\n \"properties\": {\n \"index\": {\n \"type\": [\n \"integer\",\n \"null\"\n ]\n },\n \"question\": {\n \"type\": \"string\"\n },\n \"operator\": {\n \"type\": [\n \"string\",\n \"null\"\n ],\n \"enum\": [\n \"Scan\",\n \"Filter\",\n \"Aggregate\",\n \"Sort\",\n \"Top\",\n \"Join\",\n \"Union\",\n \"Intersect\",\n \"Except\",\n null\n ]\n },\n \"sub_questions\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#\"\n }\n }\n },\n \"required\": [\n \"index\",\n \"question\",\n \"operator\"\n ]\n}\n\nConversation Flow:\n1. User will provide the initial complex question\n2. You will:\n a. Choose an appropriate operator\n b. Decompose into sub-questions according to operator rules\n3. User will ask you to decompose one of the sub-questions if needed\n4. This process continues until we reach simple, directly answerable questions (Scan operations)\n\nImportant Rules:\n- Each decomposition MUST use exactly one operator from the valid list\n- Operator choice must be justified and appropriate for the question\n- Sub-questions must comply with the operator's requirements\n- Each sub-question should be simpler than the original question\n- Sub-questions should be clear and self-contained\n- Maintain context between decomposition steps\n- Use only tables and columns that exist in the provided schema\n",
"role": "system"
},
{
"content": "decompose the following question: List the different acting statuses.",
"role": "user"
},
{
"content": "{\"index\":1,\"question\":\"List the different acting statuses.\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
}
] |
11721bd0ca619c9b885db09fa053a789068bbc906d3565209a493f47b01c04b0_0
|
department_management
|
How many departments are led by heads who are not mentioned?
|
[
"#1 = Scan Table [ department ] Output [ Department_ID ]",
"#2 = Scan Table [ management ] Output [ department_ID ]",
"#3 = Aggregate [ #2 ] GroupBy [ department_ID ] Output [ department_ID ]",
"#4 = Except [ #1 , #3 ] Predicate [ #3.department_ID = #1.Department_ID ] Output [ 1 AS One ]",
"#5 = Aggregate [ #4 ] Output [ countstar AS Count_Star ]"
] |
[
"Find the ids of all departments.",
"Find the department ids that are led by heads who are mentioned.",
"Find the different department ids that are led by heads who are mentioned.",
"List 1 for each department led by heads who are not mentioned.",
"How many departments are led by heads who are not mentioned?"
] |
[
{
"content": "You are a question decomposition expert. You are given a database schema and a complex database input question in natural language, and your task is to break down the complex database input question into simpler sub-questions in a recursive way, like a tree. In each step you will be given a question to decompose, so that your answer will be the input for the next steps.\n\nInput Question:\nHow many departments are led by heads who are not mentioned?\n\nDatabase Name:\ndepartment_management\n\nDatabase Schema:\nCREATE TABLE department (\n\tDepartment_ID number,\n\tName text,\n\tCreation text,\n\tRanking number,\n\tBudget_in_Billions number,\n\tNum_Employees number,\n\tprimary key ( Department_ID )\n)\n\nCREATE TABLE head (\n\thead_ID number,\n\tname text,\n\tborn_state text,\n\tage number,\n\tprimary key ( head_ID )\n)\n\nCREATE TABLE management (\n\tdepartment_ID number,\n\thead_ID number,\n\ttemporary_acting text,\n\tprimary key ( department_ID , head_ID ),\n\tforeign key ( department_ID ) references department ( Department_ID ),\n\tforeign key ( head_ID ) references head ( head_ID )\n)\n\nValid Operators:\nThe following operators are available for query decomposition:\n- Scan: Direct table access with no sub-questions\n- Filter: Selection based on conditions\n- Aggregate: Group and compute aggregations\n- Sort: Order results\n- Topsort: Sort and limit results\n- Top: Limit results\n- Join: Combine two sub-queries\n- Except: Set difference between two sub-queries\n- Intersect: Set intersection between two sub-queries\n- Union: Set union of two sub-queries\n\nOperator Rules:\n1. Each decomposition MUST specify exactly one operator from the above list\n2. Operator constraints:\n - Scan: Cannot have sub-questions\n - Filter/Aggregate/Sort/Top/Topsort: Can have 1 sub-question\n - Join/Union/Intersect/Except: Must have exactly 2 sub-questions\n\nTask Description:\n1. You will receive a complex database question that needs to be decomposed\n2. For each question, you should:\n - First, determine the appropriate operator from the valid list\n - Then break it down into sub-questions according to the operator's rules\n - Explain how these sub-questions relate to the original question\n - Indicate the order in which these sub-questions should be answered\n\nResponse Format:\nFor each decomposition step, respond with this exact JSON format without any other text:\n{\n \"type\": \"object\",\n \"properties\": {\n \"index\": {\n \"type\": [\n \"integer\",\n \"null\"\n ]\n },\n \"question\": {\n \"type\": \"string\"\n },\n \"operator\": {\n \"type\": [\n \"string\",\n \"null\"\n ],\n \"enum\": [\n \"Scan\",\n \"Filter\",\n \"Aggregate\",\n \"Sort\",\n \"Top\",\n \"Join\",\n \"Union\",\n \"Intersect\",\n \"Except\",\n null\n ]\n },\n \"sub_questions\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#\"\n }\n }\n },\n \"required\": [\n \"index\",\n \"question\",\n \"operator\"\n ]\n}\n\nConversation Flow:\n1. User will provide the initial complex question\n2. You will:\n a. Choose an appropriate operator\n b. Decompose into sub-questions according to operator rules\n3. User will ask you to decompose one of the sub-questions if needed\n4. This process continues until we reach simple, directly answerable questions (Scan operations)\n\nImportant Rules:\n- Each decomposition MUST use exactly one operator from the valid list\n- Operator choice must be justified and appropriate for the question\n- Sub-questions must comply with the operator's requirements\n- Each sub-question should be simpler than the original question\n- Sub-questions should be clear and self-contained\n- Maintain context between decomposition steps\n- Use only tables and columns that exist in the provided schema\n",
"role": "system"
},
{
"content": "decompose the following question: How many departments are led by heads who are not mentioned?",
"role": "user"
},
{
"content": "{\"index\":1,\"question\":\"How many departments are led by heads who are not mentioned?\",\"operator\":\"Aggregate\",\"sub_questions\":[{\"index\":2,\"question\":\"List 1 for each department led by heads who are not mentioned.\",\"operator\":null,\"sub_questions\":[]}]}",
"role": "assistant"
},
{
"content": "given the decomposition: {\"index\":1,\"question\":\"How many departments are led by heads who are not mentioned?\",\"operator\":\"Aggregate\",\"sub_questions\":[{\"index\":2,\"question\":\"List 1 for each department led by heads who are not mentioned.\",\"operator\":null,\"sub_questions\":[]}]}\ndecompose the following question with index 2: List 1 for each department led by heads who are not mentioned.",
"role": "user"
},
{
"content": "{\"index\":2,\"question\":\"List 1 for each department led by heads who are not mentioned.\",\"operator\":\"Except\",\"sub_questions\":[{\"index\":3,\"question\":\"Find the ids of all departments.\",\"operator\":null,\"sub_questions\":[]},{\"index\":4,\"question\":\"Find the different department ids that are led by heads who are mentioned.\",\"operator\":null,\"sub_questions\":[]}]}",
"role": "assistant"
},
{
"content": "given the decomposition: {\"index\":1,\"question\":\"How many departments are led by heads who are not mentioned?\",\"operator\":\"Aggregate\",\"sub_questions\":[{\"index\":2,\"question\":\"List 1 for each department led by heads who are not mentioned.\",\"operator\":\"Except\",\"sub_questions\":[{\"index\":3,\"question\":\"Find the ids of all departments.\",\"operator\":null,\"sub_questions\":[]},{\"index\":4,\"question\":\"Find the different department ids that are led by heads who are mentioned.\",\"operator\":null,\"sub_questions\":[]}]}]}\ndecompose the following question with index 3: Find the ids of all departments.",
"role": "user"
},
{
"content": "{\"index\":3,\"question\":\"Find the ids of all departments.\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
},
{
"content": "given the decomposition: {\"index\":1,\"question\":\"How many departments are led by heads who are not mentioned?\",\"operator\":\"Aggregate\",\"sub_questions\":[{\"index\":2,\"question\":\"List 1 for each department led by heads who are not mentioned.\",\"operator\":\"Except\",\"sub_questions\":[{\"index\":3,\"question\":\"Find the ids of all departments.\",\"operator\":\"Scan\",\"sub_questions\":[]},{\"index\":4,\"question\":\"Find the different department ids that are led by heads who are mentioned.\",\"operator\":null,\"sub_questions\":[]}]}]}\ndecompose the following question with index 4: Find the different department ids that are led by heads who are mentioned.",
"role": "user"
},
{
"content": "{\"index\":4,\"question\":\"Find the different department ids that are led by heads who are mentioned.\",\"operator\":\"Aggregate\",\"sub_questions\":[{\"index\":5,\"question\":\"Find the department ids that are led by heads who are mentioned.\",\"operator\":null,\"sub_questions\":[]}]}",
"role": "assistant"
},
{
"content": "given the decomposition: {\"index\":1,\"question\":\"How many departments are led by heads who are not mentioned?\",\"operator\":\"Aggregate\",\"sub_questions\":[{\"index\":2,\"question\":\"List 1 for each department led by heads who are not mentioned.\",\"operator\":\"Except\",\"sub_questions\":[{\"index\":3,\"question\":\"Find the ids of all departments.\",\"operator\":\"Scan\",\"sub_questions\":[]},{\"index\":4,\"question\":\"Find the different department ids that are led by heads who are mentioned.\",\"operator\":\"Aggregate\",\"sub_questions\":[{\"index\":5,\"question\":\"Find the department ids that are led by heads who are mentioned.\",\"operator\":null,\"sub_questions\":[]}]}]}]}\ndecompose the following question with index 5: Find the department ids that are led by heads who are mentioned.",
"role": "user"
},
{
"content": "{\"index\":5,\"question\":\"Find the department ids that are led by heads who are mentioned.\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
}
] |
11721bd0ca619c9b885db09fa053a789068bbc906d3565209a493f47b01c04b0_1
|
department_management
|
List 1 for each department led by heads who are not mentioned.
|
[
"#1 = Scan Table [ department ] Output [ Department_ID ]",
"#2 = Scan Table [ management ] Output [ department_ID ]",
"#3 = Aggregate [ #2 ] GroupBy [ department_ID ] Output [ department_ID ]",
"#4 = Except [ #1 , #3 ] Predicate [ #3.department_ID = #1.Department_ID ] Output [ 1 AS One ]"
] |
[
"Find the ids of all departments.",
"Find the department ids that are led by heads who are mentioned.",
"Find the different department ids that are led by heads who are mentioned.",
"List 1 for each department led by heads who are not mentioned."
] |
[
{
"content": "You are a question decomposition expert. You are given a database schema and a complex database input question in natural language, and your task is to break down the complex database input question into simpler sub-questions in a recursive way, like a tree. In each step you will be given a question to decompose, so that your answer will be the input for the next steps.\n\nInput Question:\nHow many departments are led by heads who are not mentioned?\n\nDatabase Name:\ndepartment_management\n\nDatabase Schema:\nCREATE TABLE department (\n\tDepartment_ID number,\n\tName text,\n\tCreation text,\n\tRanking number,\n\tBudget_in_Billions number,\n\tNum_Employees number,\n\tprimary key ( Department_ID )\n)\n\nCREATE TABLE head (\n\thead_ID number,\n\tname text,\n\tborn_state text,\n\tage number,\n\tprimary key ( head_ID )\n)\n\nCREATE TABLE management (\n\tdepartment_ID number,\n\thead_ID number,\n\ttemporary_acting text,\n\tprimary key ( department_ID , head_ID ),\n\tforeign key ( department_ID ) references department ( Department_ID ),\n\tforeign key ( head_ID ) references head ( head_ID )\n)\n\nValid Operators:\nThe following operators are available for query decomposition:\n- Scan: Direct table access with no sub-questions\n- Filter: Selection based on conditions\n- Aggregate: Group and compute aggregations\n- Sort: Order results\n- Topsort: Sort and limit results\n- Top: Limit results\n- Join: Combine two sub-queries\n- Except: Set difference between two sub-queries\n- Intersect: Set intersection between two sub-queries\n- Union: Set union of two sub-queries\n\nOperator Rules:\n1. Each decomposition MUST specify exactly one operator from the above list\n2. Operator constraints:\n - Scan: Cannot have sub-questions\n - Filter/Aggregate/Sort/Top/Topsort: Can have 1 sub-question\n - Join/Union/Intersect/Except: Must have exactly 2 sub-questions\n\nTask Description:\n1. You will receive a complex database question that needs to be decomposed\n2. For each question, you should:\n - First, determine the appropriate operator from the valid list\n - Then break it down into sub-questions according to the operator's rules\n - Explain how these sub-questions relate to the original question\n - Indicate the order in which these sub-questions should be answered\n\nResponse Format:\nFor each decomposition step, respond with this exact JSON format without any other text:\n{\n \"type\": \"object\",\n \"properties\": {\n \"index\": {\n \"type\": [\n \"integer\",\n \"null\"\n ]\n },\n \"question\": {\n \"type\": \"string\"\n },\n \"operator\": {\n \"type\": [\n \"string\",\n \"null\"\n ],\n \"enum\": [\n \"Scan\",\n \"Filter\",\n \"Aggregate\",\n \"Sort\",\n \"Top\",\n \"Join\",\n \"Union\",\n \"Intersect\",\n \"Except\",\n null\n ]\n },\n \"sub_questions\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#\"\n }\n }\n },\n \"required\": [\n \"index\",\n \"question\",\n \"operator\"\n ]\n}\n\nConversation Flow:\n1. User will provide the initial complex question\n2. You will:\n a. Choose an appropriate operator\n b. Decompose into sub-questions according to operator rules\n3. User will ask you to decompose one of the sub-questions if needed\n4. This process continues until we reach simple, directly answerable questions (Scan operations)\n\nImportant Rules:\n- Each decomposition MUST use exactly one operator from the valid list\n- Operator choice must be justified and appropriate for the question\n- Sub-questions must comply with the operator's requirements\n- Each sub-question should be simpler than the original question\n- Sub-questions should be clear and self-contained\n- Maintain context between decomposition steps\n- Use only tables and columns that exist in the provided schema\n",
"role": "system"
},
{
"content": "decompose the following question: List 1 for each department led by heads who are not mentioned.",
"role": "user"
},
{
"content": "{\"index\":1,\"question\":\"List 1 for each department led by heads who are not mentioned.\",\"operator\":\"Except\",\"sub_questions\":[{\"index\":2,\"question\":\"Find the ids of all departments.\",\"operator\":null,\"sub_questions\":[]},{\"index\":3,\"question\":\"Find the different department ids that are led by heads who are mentioned.\",\"operator\":null,\"sub_questions\":[]}]}",
"role": "assistant"
},
{
"content": "given the decomposition: {\"index\":1,\"question\":\"List 1 for each department led by heads who are not mentioned.\",\"operator\":\"Except\",\"sub_questions\":[{\"index\":2,\"question\":\"Find the ids of all departments.\",\"operator\":null,\"sub_questions\":[]},{\"index\":3,\"question\":\"Find the different department ids that are led by heads who are mentioned.\",\"operator\":null,\"sub_questions\":[]}]}\ndecompose the following question with index 2: Find the ids of all departments.",
"role": "user"
},
{
"content": "{\"index\":2,\"question\":\"Find the ids of all departments.\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
},
{
"content": "given the decomposition: {\"index\":1,\"question\":\"List 1 for each department led by heads who are not mentioned.\",\"operator\":\"Except\",\"sub_questions\":[{\"index\":2,\"question\":\"Find the ids of all departments.\",\"operator\":\"Scan\",\"sub_questions\":[]},{\"index\":3,\"question\":\"Find the different department ids that are led by heads who are mentioned.\",\"operator\":null,\"sub_questions\":[]}]}\ndecompose the following question with index 3: Find the different department ids that are led by heads who are mentioned.",
"role": "user"
},
{
"content": "{\"index\":3,\"question\":\"Find the different department ids that are led by heads who are mentioned.\",\"operator\":\"Aggregate\",\"sub_questions\":[{\"index\":4,\"question\":\"Find the department ids that are led by heads who are mentioned.\",\"operator\":null,\"sub_questions\":[]}]}",
"role": "assistant"
},
{
"content": "given the decomposition: {\"index\":1,\"question\":\"List 1 for each department led by heads who are not mentioned.\",\"operator\":\"Except\",\"sub_questions\":[{\"index\":2,\"question\":\"Find the ids of all departments.\",\"operator\":\"Scan\",\"sub_questions\":[]},{\"index\":3,\"question\":\"Find the different department ids that are led by heads who are mentioned.\",\"operator\":\"Aggregate\",\"sub_questions\":[{\"index\":4,\"question\":\"Find the department ids that are led by heads who are mentioned.\",\"operator\":null,\"sub_questions\":[]}]}]}\ndecompose the following question with index 4: Find the department ids that are led by heads who are mentioned.",
"role": "user"
},
{
"content": "{\"index\":4,\"question\":\"Find the department ids that are led by heads who are mentioned.\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
}
] |
11721bd0ca619c9b885db09fa053a789068bbc906d3565209a493f47b01c04b0_2
|
department_management
|
Find the ids of all departments.
|
[
"#1 = Scan Table [ department ] Output [ Department_ID ]"
] |
[
"Find the ids of all departments."
] |
[
{
"content": "You are a question decomposition expert. You are given a database schema and a complex database input question in natural language, and your task is to break down the complex database input question into simpler sub-questions in a recursive way, like a tree. In each step you will be given a question to decompose, so that your answer will be the input for the next steps.\n\nInput Question:\nHow many departments are led by heads who are not mentioned?\n\nDatabase Name:\ndepartment_management\n\nDatabase Schema:\nCREATE TABLE department (\n\tDepartment_ID number,\n\tName text,\n\tCreation text,\n\tRanking number,\n\tBudget_in_Billions number,\n\tNum_Employees number,\n\tprimary key ( Department_ID )\n)\n\nCREATE TABLE head (\n\thead_ID number,\n\tname text,\n\tborn_state text,\n\tage number,\n\tprimary key ( head_ID )\n)\n\nCREATE TABLE management (\n\tdepartment_ID number,\n\thead_ID number,\n\ttemporary_acting text,\n\tprimary key ( department_ID , head_ID ),\n\tforeign key ( department_ID ) references department ( Department_ID ),\n\tforeign key ( head_ID ) references head ( head_ID )\n)\n\nValid Operators:\nThe following operators are available for query decomposition:\n- Scan: Direct table access with no sub-questions\n- Filter: Selection based on conditions\n- Aggregate: Group and compute aggregations\n- Sort: Order results\n- Topsort: Sort and limit results\n- Top: Limit results\n- Join: Combine two sub-queries\n- Except: Set difference between two sub-queries\n- Intersect: Set intersection between two sub-queries\n- Union: Set union of two sub-queries\n\nOperator Rules:\n1. Each decomposition MUST specify exactly one operator from the above list\n2. Operator constraints:\n - Scan: Cannot have sub-questions\n - Filter/Aggregate/Sort/Top/Topsort: Can have 1 sub-question\n - Join/Union/Intersect/Except: Must have exactly 2 sub-questions\n\nTask Description:\n1. You will receive a complex database question that needs to be decomposed\n2. For each question, you should:\n - First, determine the appropriate operator from the valid list\n - Then break it down into sub-questions according to the operator's rules\n - Explain how these sub-questions relate to the original question\n - Indicate the order in which these sub-questions should be answered\n\nResponse Format:\nFor each decomposition step, respond with this exact JSON format without any other text:\n{\n \"type\": \"object\",\n \"properties\": {\n \"index\": {\n \"type\": [\n \"integer\",\n \"null\"\n ]\n },\n \"question\": {\n \"type\": \"string\"\n },\n \"operator\": {\n \"type\": [\n \"string\",\n \"null\"\n ],\n \"enum\": [\n \"Scan\",\n \"Filter\",\n \"Aggregate\",\n \"Sort\",\n \"Top\",\n \"Join\",\n \"Union\",\n \"Intersect\",\n \"Except\",\n null\n ]\n },\n \"sub_questions\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#\"\n }\n }\n },\n \"required\": [\n \"index\",\n \"question\",\n \"operator\"\n ]\n}\n\nConversation Flow:\n1. User will provide the initial complex question\n2. You will:\n a. Choose an appropriate operator\n b. Decompose into sub-questions according to operator rules\n3. User will ask you to decompose one of the sub-questions if needed\n4. This process continues until we reach simple, directly answerable questions (Scan operations)\n\nImportant Rules:\n- Each decomposition MUST use exactly one operator from the valid list\n- Operator choice must be justified and appropriate for the question\n- Sub-questions must comply with the operator's requirements\n- Each sub-question should be simpler than the original question\n- Sub-questions should be clear and self-contained\n- Maintain context between decomposition steps\n- Use only tables and columns that exist in the provided schema\n",
"role": "system"
},
{
"content": "decompose the following question: Find the ids of all departments.",
"role": "user"
},
{
"content": "{\"index\":1,\"question\":\"Find the ids of all departments.\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
}
] |
11721bd0ca619c9b885db09fa053a789068bbc906d3565209a493f47b01c04b0_3
|
department_management
|
Find the different department ids that are led by heads who are mentioned.
|
[
"#1 = Scan Table [ management ] Output [ department_ID ]",
"#2 = Aggregate [ #1 ] GroupBy [ department_ID ] Output [ department_ID ]"
] |
[
"Find the department ids that are led by heads who are mentioned.",
"Find the different department ids that are led by heads who are mentioned."
] |
[
{
"content": "You are a question decomposition expert. You are given a database schema and a complex database input question in natural language, and your task is to break down the complex database input question into simpler sub-questions in a recursive way, like a tree. In each step you will be given a question to decompose, so that your answer will be the input for the next steps.\n\nInput Question:\nHow many departments are led by heads who are not mentioned?\n\nDatabase Name:\ndepartment_management\n\nDatabase Schema:\nCREATE TABLE department (\n\tDepartment_ID number,\n\tName text,\n\tCreation text,\n\tRanking number,\n\tBudget_in_Billions number,\n\tNum_Employees number,\n\tprimary key ( Department_ID )\n)\n\nCREATE TABLE head (\n\thead_ID number,\n\tname text,\n\tborn_state text,\n\tage number,\n\tprimary key ( head_ID )\n)\n\nCREATE TABLE management (\n\tdepartment_ID number,\n\thead_ID number,\n\ttemporary_acting text,\n\tprimary key ( department_ID , head_ID ),\n\tforeign key ( department_ID ) references department ( Department_ID ),\n\tforeign key ( head_ID ) references head ( head_ID )\n)\n\nValid Operators:\nThe following operators are available for query decomposition:\n- Scan: Direct table access with no sub-questions\n- Filter: Selection based on conditions\n- Aggregate: Group and compute aggregations\n- Sort: Order results\n- Topsort: Sort and limit results\n- Top: Limit results\n- Join: Combine two sub-queries\n- Except: Set difference between two sub-queries\n- Intersect: Set intersection between two sub-queries\n- Union: Set union of two sub-queries\n\nOperator Rules:\n1. Each decomposition MUST specify exactly one operator from the above list\n2. Operator constraints:\n - Scan: Cannot have sub-questions\n - Filter/Aggregate/Sort/Top/Topsort: Can have 1 sub-question\n - Join/Union/Intersect/Except: Must have exactly 2 sub-questions\n\nTask Description:\n1. You will receive a complex database question that needs to be decomposed\n2. For each question, you should:\n - First, determine the appropriate operator from the valid list\n - Then break it down into sub-questions according to the operator's rules\n - Explain how these sub-questions relate to the original question\n - Indicate the order in which these sub-questions should be answered\n\nResponse Format:\nFor each decomposition step, respond with this exact JSON format without any other text:\n{\n \"type\": \"object\",\n \"properties\": {\n \"index\": {\n \"type\": [\n \"integer\",\n \"null\"\n ]\n },\n \"question\": {\n \"type\": \"string\"\n },\n \"operator\": {\n \"type\": [\n \"string\",\n \"null\"\n ],\n \"enum\": [\n \"Scan\",\n \"Filter\",\n \"Aggregate\",\n \"Sort\",\n \"Top\",\n \"Join\",\n \"Union\",\n \"Intersect\",\n \"Except\",\n null\n ]\n },\n \"sub_questions\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#\"\n }\n }\n },\n \"required\": [\n \"index\",\n \"question\",\n \"operator\"\n ]\n}\n\nConversation Flow:\n1. User will provide the initial complex question\n2. You will:\n a. Choose an appropriate operator\n b. Decompose into sub-questions according to operator rules\n3. User will ask you to decompose one of the sub-questions if needed\n4. This process continues until we reach simple, directly answerable questions (Scan operations)\n\nImportant Rules:\n- Each decomposition MUST use exactly one operator from the valid list\n- Operator choice must be justified and appropriate for the question\n- Sub-questions must comply with the operator's requirements\n- Each sub-question should be simpler than the original question\n- Sub-questions should be clear and self-contained\n- Maintain context between decomposition steps\n- Use only tables and columns that exist in the provided schema\n",
"role": "system"
},
{
"content": "decompose the following question: Find the different department ids that are led by heads who are mentioned.",
"role": "user"
},
{
"content": "{\"index\":1,\"question\":\"Find the different department ids that are led by heads who are mentioned.\",\"operator\":\"Aggregate\",\"sub_questions\":[{\"index\":2,\"question\":\"Find the department ids that are led by heads who are mentioned.\",\"operator\":null,\"sub_questions\":[]}]}",
"role": "assistant"
},
{
"content": "given the decomposition: {\"index\":1,\"question\":\"Find the different department ids that are led by heads who are mentioned.\",\"operator\":\"Aggregate\",\"sub_questions\":[{\"index\":2,\"question\":\"Find the department ids that are led by heads who are mentioned.\",\"operator\":null,\"sub_questions\":[]}]}\ndecompose the following question with index 2: Find the department ids that are led by heads who are mentioned.",
"role": "user"
},
{
"content": "{\"index\":2,\"question\":\"Find the department ids that are led by heads who are mentioned.\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
}
] |
11721bd0ca619c9b885db09fa053a789068bbc906d3565209a493f47b01c04b0_4
|
department_management
|
Find the department ids that are led by heads who are mentioned.
|
[
"#1 = Scan Table [ management ] Output [ department_ID ]"
] |
[
"Find the department ids that are led by heads who are mentioned."
] |
[
{
"content": "You are a question decomposition expert. You are given a database schema and a complex database input question in natural language, and your task is to break down the complex database input question into simpler sub-questions in a recursive way, like a tree. In each step you will be given a question to decompose, so that your answer will be the input for the next steps.\n\nInput Question:\nHow many departments are led by heads who are not mentioned?\n\nDatabase Name:\ndepartment_management\n\nDatabase Schema:\nCREATE TABLE department (\n\tDepartment_ID number,\n\tName text,\n\tCreation text,\n\tRanking number,\n\tBudget_in_Billions number,\n\tNum_Employees number,\n\tprimary key ( Department_ID )\n)\n\nCREATE TABLE head (\n\thead_ID number,\n\tname text,\n\tborn_state text,\n\tage number,\n\tprimary key ( head_ID )\n)\n\nCREATE TABLE management (\n\tdepartment_ID number,\n\thead_ID number,\n\ttemporary_acting text,\n\tprimary key ( department_ID , head_ID ),\n\tforeign key ( department_ID ) references department ( Department_ID ),\n\tforeign key ( head_ID ) references head ( head_ID )\n)\n\nValid Operators:\nThe following operators are available for query decomposition:\n- Scan: Direct table access with no sub-questions\n- Filter: Selection based on conditions\n- Aggregate: Group and compute aggregations\n- Sort: Order results\n- Topsort: Sort and limit results\n- Top: Limit results\n- Join: Combine two sub-queries\n- Except: Set difference between two sub-queries\n- Intersect: Set intersection between two sub-queries\n- Union: Set union of two sub-queries\n\nOperator Rules:\n1. Each decomposition MUST specify exactly one operator from the above list\n2. Operator constraints:\n - Scan: Cannot have sub-questions\n - Filter/Aggregate/Sort/Top/Topsort: Can have 1 sub-question\n - Join/Union/Intersect/Except: Must have exactly 2 sub-questions\n\nTask Description:\n1. You will receive a complex database question that needs to be decomposed\n2. For each question, you should:\n - First, determine the appropriate operator from the valid list\n - Then break it down into sub-questions according to the operator's rules\n - Explain how these sub-questions relate to the original question\n - Indicate the order in which these sub-questions should be answered\n\nResponse Format:\nFor each decomposition step, respond with this exact JSON format without any other text:\n{\n \"type\": \"object\",\n \"properties\": {\n \"index\": {\n \"type\": [\n \"integer\",\n \"null\"\n ]\n },\n \"question\": {\n \"type\": \"string\"\n },\n \"operator\": {\n \"type\": [\n \"string\",\n \"null\"\n ],\n \"enum\": [\n \"Scan\",\n \"Filter\",\n \"Aggregate\",\n \"Sort\",\n \"Top\",\n \"Join\",\n \"Union\",\n \"Intersect\",\n \"Except\",\n null\n ]\n },\n \"sub_questions\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#\"\n }\n }\n },\n \"required\": [\n \"index\",\n \"question\",\n \"operator\"\n ]\n}\n\nConversation Flow:\n1. User will provide the initial complex question\n2. You will:\n a. Choose an appropriate operator\n b. Decompose into sub-questions according to operator rules\n3. User will ask you to decompose one of the sub-questions if needed\n4. This process continues until we reach simple, directly answerable questions (Scan operations)\n\nImportant Rules:\n- Each decomposition MUST use exactly one operator from the valid list\n- Operator choice must be justified and appropriate for the question\n- Sub-questions must comply with the operator's requirements\n- Each sub-question should be simpler than the original question\n- Sub-questions should be clear and self-contained\n- Maintain context between decomposition steps\n- Use only tables and columns that exist in the provided schema\n",
"role": "system"
},
{
"content": "decompose the following question: Find the department ids that are led by heads who are mentioned.",
"role": "user"
},
{
"content": "{\"index\":1,\"question\":\"Find the department ids that are led by heads who are mentioned.\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
}
] |
84ee6c0bbf937a87b1575510a08e72067bb1e07ac77e10e668e97e922f82649c_0
|
department_management
|
What are the distinct ages of the heads who are acting?
|
[
"#1 = Scan Table [ management ] Predicate [ temporary_acting = 'Yes' ] Output [ head_ID , temporary_acting ]",
"#2 = Scan Table [ head ] Output [ head_ID , age ]",
"#3 = Join [ #1 , #2 ] Predicate [ #1.head_ID = #2.head_ID ] Distinct [ true ] Output [ #2.age ]"
] |
[
"What are the ids of the heads who are acting?",
"What are the ids and ages of all heads?",
"What are the distinct ages of the heads who are acting?"
] |
[
{
"content": "You are a question decomposition expert. You are given a database schema and a complex database input question in natural language, and your task is to break down the complex database input question into simpler sub-questions in a recursive way, like a tree. In each step you will be given a question to decompose, so that your answer will be the input for the next steps.\n\nInput Question:\nWhat are the distinct ages of the heads who are acting?\n\nDatabase Name:\ndepartment_management\n\nDatabase Schema:\nCREATE TABLE department (\n\tDepartment_ID number,\n\tName text,\n\tCreation text,\n\tRanking number,\n\tBudget_in_Billions number,\n\tNum_Employees number,\n\tprimary key ( Department_ID )\n)\n\nCREATE TABLE head (\n\thead_ID number,\n\tname text,\n\tborn_state text,\n\tage number,\n\tprimary key ( head_ID )\n)\n\nCREATE TABLE management (\n\tdepartment_ID number,\n\thead_ID number,\n\ttemporary_acting text,\n\tprimary key ( department_ID , head_ID ),\n\tforeign key ( department_ID ) references department ( Department_ID ),\n\tforeign key ( head_ID ) references head ( head_ID )\n)\n\nValid Operators:\nThe following operators are available for query decomposition:\n- Scan: Direct table access with no sub-questions\n- Filter: Selection based on conditions\n- Aggregate: Group and compute aggregations\n- Sort: Order results\n- Topsort: Sort and limit results\n- Top: Limit results\n- Join: Combine two sub-queries\n- Except: Set difference between two sub-queries\n- Intersect: Set intersection between two sub-queries\n- Union: Set union of two sub-queries\n\nOperator Rules:\n1. Each decomposition MUST specify exactly one operator from the above list\n2. Operator constraints:\n - Scan: Cannot have sub-questions\n - Filter/Aggregate/Sort/Top/Topsort: Can have 1 sub-question\n - Join/Union/Intersect/Except: Must have exactly 2 sub-questions\n\nTask Description:\n1. You will receive a complex database question that needs to be decomposed\n2. For each question, you should:\n - First, determine the appropriate operator from the valid list\n - Then break it down into sub-questions according to the operator's rules\n - Explain how these sub-questions relate to the original question\n - Indicate the order in which these sub-questions should be answered\n\nResponse Format:\nFor each decomposition step, respond with this exact JSON format without any other text:\n{\n \"type\": \"object\",\n \"properties\": {\n \"index\": {\n \"type\": [\n \"integer\",\n \"null\"\n ]\n },\n \"question\": {\n \"type\": \"string\"\n },\n \"operator\": {\n \"type\": [\n \"string\",\n \"null\"\n ],\n \"enum\": [\n \"Scan\",\n \"Filter\",\n \"Aggregate\",\n \"Sort\",\n \"Top\",\n \"Join\",\n \"Union\",\n \"Intersect\",\n \"Except\",\n null\n ]\n },\n \"sub_questions\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#\"\n }\n }\n },\n \"required\": [\n \"index\",\n \"question\",\n \"operator\"\n ]\n}\n\nConversation Flow:\n1. User will provide the initial complex question\n2. You will:\n a. Choose an appropriate operator\n b. Decompose into sub-questions according to operator rules\n3. User will ask you to decompose one of the sub-questions if needed\n4. This process continues until we reach simple, directly answerable questions (Scan operations)\n\nImportant Rules:\n- Each decomposition MUST use exactly one operator from the valid list\n- Operator choice must be justified and appropriate for the question\n- Sub-questions must comply with the operator's requirements\n- Each sub-question should be simpler than the original question\n- Sub-questions should be clear and self-contained\n- Maintain context between decomposition steps\n- Use only tables and columns that exist in the provided schema\n",
"role": "system"
},
{
"content": "decompose the following question: What are the distinct ages of the heads who are acting?",
"role": "user"
},
{
"content": "{\"index\":1,\"question\":\"What are the distinct ages of the heads who are acting?\",\"operator\":\"Join\",\"sub_questions\":[{\"index\":2,\"question\":\"What are the ids of the heads who are acting?\",\"operator\":null,\"sub_questions\":[]},{\"index\":3,\"question\":\"What are the ids and ages of all heads?\",\"operator\":null,\"sub_questions\":[]}]}",
"role": "assistant"
},
{
"content": "given the decomposition: {\"index\":1,\"question\":\"What are the distinct ages of the heads who are acting?\",\"operator\":\"Join\",\"sub_questions\":[{\"index\":2,\"question\":\"What are the ids of the heads who are acting?\",\"operator\":null,\"sub_questions\":[]},{\"index\":3,\"question\":\"What are the ids and ages of all heads?\",\"operator\":null,\"sub_questions\":[]}]}\ndecompose the following question with index 2: What are the ids of the heads who are acting?",
"role": "user"
},
{
"content": "{\"index\":2,\"question\":\"What are the ids of the heads who are acting?\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
},
{
"content": "given the decomposition: {\"index\":1,\"question\":\"What are the distinct ages of the heads who are acting?\",\"operator\":\"Join\",\"sub_questions\":[{\"index\":2,\"question\":\"What are the ids of the heads who are acting?\",\"operator\":\"Scan\",\"sub_questions\":[]},{\"index\":3,\"question\":\"What are the ids and ages of all heads?\",\"operator\":null,\"sub_questions\":[]}]}\ndecompose the following question with index 3: What are the ids and ages of all heads?",
"role": "user"
},
{
"content": "{\"index\":3,\"question\":\"What are the ids and ages of all heads?\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
}
] |
84ee6c0bbf937a87b1575510a08e72067bb1e07ac77e10e668e97e922f82649c_1
|
department_management
|
What are the ids of the heads who are acting?
|
[
"#1 = Scan Table [ management ] Predicate [ temporary_acting = 'Yes' ] Output [ head_ID , temporary_acting ]"
] |
[
"What are the ids of the heads who are acting?"
] |
[
{
"content": "You are a question decomposition expert. You are given a database schema and a complex database input question in natural language, and your task is to break down the complex database input question into simpler sub-questions in a recursive way, like a tree. In each step you will be given a question to decompose, so that your answer will be the input for the next steps.\n\nInput Question:\nWhat are the distinct ages of the heads who are acting?\n\nDatabase Name:\ndepartment_management\n\nDatabase Schema:\nCREATE TABLE department (\n\tDepartment_ID number,\n\tName text,\n\tCreation text,\n\tRanking number,\n\tBudget_in_Billions number,\n\tNum_Employees number,\n\tprimary key ( Department_ID )\n)\n\nCREATE TABLE head (\n\thead_ID number,\n\tname text,\n\tborn_state text,\n\tage number,\n\tprimary key ( head_ID )\n)\n\nCREATE TABLE management (\n\tdepartment_ID number,\n\thead_ID number,\n\ttemporary_acting text,\n\tprimary key ( department_ID , head_ID ),\n\tforeign key ( department_ID ) references department ( Department_ID ),\n\tforeign key ( head_ID ) references head ( head_ID )\n)\n\nValid Operators:\nThe following operators are available for query decomposition:\n- Scan: Direct table access with no sub-questions\n- Filter: Selection based on conditions\n- Aggregate: Group and compute aggregations\n- Sort: Order results\n- Topsort: Sort and limit results\n- Top: Limit results\n- Join: Combine two sub-queries\n- Except: Set difference between two sub-queries\n- Intersect: Set intersection between two sub-queries\n- Union: Set union of two sub-queries\n\nOperator Rules:\n1. Each decomposition MUST specify exactly one operator from the above list\n2. Operator constraints:\n - Scan: Cannot have sub-questions\n - Filter/Aggregate/Sort/Top/Topsort: Can have 1 sub-question\n - Join/Union/Intersect/Except: Must have exactly 2 sub-questions\n\nTask Description:\n1. You will receive a complex database question that needs to be decomposed\n2. For each question, you should:\n - First, determine the appropriate operator from the valid list\n - Then break it down into sub-questions according to the operator's rules\n - Explain how these sub-questions relate to the original question\n - Indicate the order in which these sub-questions should be answered\n\nResponse Format:\nFor each decomposition step, respond with this exact JSON format without any other text:\n{\n \"type\": \"object\",\n \"properties\": {\n \"index\": {\n \"type\": [\n \"integer\",\n \"null\"\n ]\n },\n \"question\": {\n \"type\": \"string\"\n },\n \"operator\": {\n \"type\": [\n \"string\",\n \"null\"\n ],\n \"enum\": [\n \"Scan\",\n \"Filter\",\n \"Aggregate\",\n \"Sort\",\n \"Top\",\n \"Join\",\n \"Union\",\n \"Intersect\",\n \"Except\",\n null\n ]\n },\n \"sub_questions\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#\"\n }\n }\n },\n \"required\": [\n \"index\",\n \"question\",\n \"operator\"\n ]\n}\n\nConversation Flow:\n1. User will provide the initial complex question\n2. You will:\n a. Choose an appropriate operator\n b. Decompose into sub-questions according to operator rules\n3. User will ask you to decompose one of the sub-questions if needed\n4. This process continues until we reach simple, directly answerable questions (Scan operations)\n\nImportant Rules:\n- Each decomposition MUST use exactly one operator from the valid list\n- Operator choice must be justified and appropriate for the question\n- Sub-questions must comply with the operator's requirements\n- Each sub-question should be simpler than the original question\n- Sub-questions should be clear and self-contained\n- Maintain context between decomposition steps\n- Use only tables and columns that exist in the provided schema\n",
"role": "system"
},
{
"content": "decompose the following question: What are the ids of the heads who are acting?",
"role": "user"
},
{
"content": "{\"index\":1,\"question\":\"What are the ids of the heads who are acting?\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
}
] |
84ee6c0bbf937a87b1575510a08e72067bb1e07ac77e10e668e97e922f82649c_2
|
department_management
|
What are the ids and ages of all heads?
|
[
"#1 = Scan Table [ head ] Output [ head_ID , age ]"
] |
[
"What are the ids and ages of all heads?"
] |
[
{
"content": "You are a question decomposition expert. You are given a database schema and a complex database input question in natural language, and your task is to break down the complex database input question into simpler sub-questions in a recursive way, like a tree. In each step you will be given a question to decompose, so that your answer will be the input for the next steps.\n\nInput Question:\nWhat are the distinct ages of the heads who are acting?\n\nDatabase Name:\ndepartment_management\n\nDatabase Schema:\nCREATE TABLE department (\n\tDepartment_ID number,\n\tName text,\n\tCreation text,\n\tRanking number,\n\tBudget_in_Billions number,\n\tNum_Employees number,\n\tprimary key ( Department_ID )\n)\n\nCREATE TABLE head (\n\thead_ID number,\n\tname text,\n\tborn_state text,\n\tage number,\n\tprimary key ( head_ID )\n)\n\nCREATE TABLE management (\n\tdepartment_ID number,\n\thead_ID number,\n\ttemporary_acting text,\n\tprimary key ( department_ID , head_ID ),\n\tforeign key ( department_ID ) references department ( Department_ID ),\n\tforeign key ( head_ID ) references head ( head_ID )\n)\n\nValid Operators:\nThe following operators are available for query decomposition:\n- Scan: Direct table access with no sub-questions\n- Filter: Selection based on conditions\n- Aggregate: Group and compute aggregations\n- Sort: Order results\n- Topsort: Sort and limit results\n- Top: Limit results\n- Join: Combine two sub-queries\n- Except: Set difference between two sub-queries\n- Intersect: Set intersection between two sub-queries\n- Union: Set union of two sub-queries\n\nOperator Rules:\n1. Each decomposition MUST specify exactly one operator from the above list\n2. Operator constraints:\n - Scan: Cannot have sub-questions\n - Filter/Aggregate/Sort/Top/Topsort: Can have 1 sub-question\n - Join/Union/Intersect/Except: Must have exactly 2 sub-questions\n\nTask Description:\n1. You will receive a complex database question that needs to be decomposed\n2. For each question, you should:\n - First, determine the appropriate operator from the valid list\n - Then break it down into sub-questions according to the operator's rules\n - Explain how these sub-questions relate to the original question\n - Indicate the order in which these sub-questions should be answered\n\nResponse Format:\nFor each decomposition step, respond with this exact JSON format without any other text:\n{\n \"type\": \"object\",\n \"properties\": {\n \"index\": {\n \"type\": [\n \"integer\",\n \"null\"\n ]\n },\n \"question\": {\n \"type\": \"string\"\n },\n \"operator\": {\n \"type\": [\n \"string\",\n \"null\"\n ],\n \"enum\": [\n \"Scan\",\n \"Filter\",\n \"Aggregate\",\n \"Sort\",\n \"Top\",\n \"Join\",\n \"Union\",\n \"Intersect\",\n \"Except\",\n null\n ]\n },\n \"sub_questions\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#\"\n }\n }\n },\n \"required\": [\n \"index\",\n \"question\",\n \"operator\"\n ]\n}\n\nConversation Flow:\n1. User will provide the initial complex question\n2. You will:\n a. Choose an appropriate operator\n b. Decompose into sub-questions according to operator rules\n3. User will ask you to decompose one of the sub-questions if needed\n4. This process continues until we reach simple, directly answerable questions (Scan operations)\n\nImportant Rules:\n- Each decomposition MUST use exactly one operator from the valid list\n- Operator choice must be justified and appropriate for the question\n- Sub-questions must comply with the operator's requirements\n- Each sub-question should be simpler than the original question\n- Sub-questions should be clear and self-contained\n- Maintain context between decomposition steps\n- Use only tables and columns that exist in the provided schema\n",
"role": "system"
},
{
"content": "decompose the following question: What are the ids and ages of all heads?",
"role": "user"
},
{
"content": "{\"index\":1,\"question\":\"What are the ids and ages of all heads?\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
}
] |
05fa1d5719ed4259ca79420810514335c8c92d1a75f475ba25bbc8c7b9d36673_0
|
department_management
|
List the states where both the secretary of 'Treasury' department and the secretary of 'Homeland Security' were born.
|
[
"#1 = Scan Table [ department ] Predicate [ Name = 'Treasury' ] Output [ Name , Department_ID ]",
"#2 = Scan Table [ management ] Output [ head_ID , department_ID ]",
"#3 = Join [ #1 , #2 ] Predicate [ #1.Department_ID = #2.department_ID ] Output [ #2.head_ID ]",
"#4 = Scan Table [ head ] Output [ head_ID , born_state ]",
"#5 = Join [ #3 , #4 ] Predicate [ #3.head_ID = #4.head_ID ] Output [ #4.born_state ]",
"#6 = Scan Table [ department ] Predicate [ Name = 'Homeland Security' ] Output [ Name , Department_ID ]",
"#7 = Scan Table [ management ] Output [ head_ID , department_ID ]",
"#8 = Join [ #6 , #7 ] Predicate [ #6.Department_ID = #7.department_ID ] Output [ #7.head_ID ]",
"#9 = Scan Table [ head ] Output [ head_ID , born_state ]",
"#10 = Join [ #8 , #9 ] Predicate [ #8.head_ID = #9.head_ID ] Output [ #9.born_state ]",
"#11 = Intersect [ #5 , #10 ] Predicate [ #5.born_state = #10.born_state ] Output [ #5.born_state ]"
] |
[
"List the id of 'Treasury' department.",
"List the department ids and their secretary ids.",
"List the secretary id of 'Treasury' department.",
"List the secretary ids and born states of all heads.",
"List the state where the secretary of 'Treasury' department was born.",
"List the id of 'Homeland Security' department.",
"List the department ids and their secretary ids.",
"List the secretary id of 'Homeland Security' department.",
"List the secretary ids and born states of all heads.",
"List the state where the secretary of 'Homeland Security' department was born.",
"List the states where both the secretary of 'Treasury' department and the secretary of 'Homeland Security' were born."
] |
[
{
"content": "You are a question decomposition expert. You are given a database schema and a complex database input question in natural language, and your task is to break down the complex database input question into simpler sub-questions in a recursive way, like a tree. In each step you will be given a question to decompose, so that your answer will be the input for the next steps.\n\nInput Question:\nList the states where both the secretary of 'Treasury' department and the secretary of 'Homeland Security' were born.\n\nDatabase Name:\ndepartment_management\n\nDatabase Schema:\nCREATE TABLE department (\n\tDepartment_ID number,\n\tName text,\n\tCreation text,\n\tRanking number,\n\tBudget_in_Billions number,\n\tNum_Employees number,\n\tprimary key ( Department_ID )\n)\n\nCREATE TABLE head (\n\thead_ID number,\n\tname text,\n\tborn_state text,\n\tage number,\n\tprimary key ( head_ID )\n)\n\nCREATE TABLE management (\n\tdepartment_ID number,\n\thead_ID number,\n\ttemporary_acting text,\n\tprimary key ( department_ID , head_ID ),\n\tforeign key ( department_ID ) references department ( Department_ID ),\n\tforeign key ( head_ID ) references head ( head_ID )\n)\n\nValid Operators:\nThe following operators are available for query decomposition:\n- Scan: Direct table access with no sub-questions\n- Filter: Selection based on conditions\n- Aggregate: Group and compute aggregations\n- Sort: Order results\n- Topsort: Sort and limit results\n- Top: Limit results\n- Join: Combine two sub-queries\n- Except: Set difference between two sub-queries\n- Intersect: Set intersection between two sub-queries\n- Union: Set union of two sub-queries\n\nOperator Rules:\n1. Each decomposition MUST specify exactly one operator from the above list\n2. Operator constraints:\n - Scan: Cannot have sub-questions\n - Filter/Aggregate/Sort/Top/Topsort: Can have 1 sub-question\n - Join/Union/Intersect/Except: Must have exactly 2 sub-questions\n\nTask Description:\n1. You will receive a complex database question that needs to be decomposed\n2. For each question, you should:\n - First, determine the appropriate operator from the valid list\n - Then break it down into sub-questions according to the operator's rules\n - Explain how these sub-questions relate to the original question\n - Indicate the order in which these sub-questions should be answered\n\nResponse Format:\nFor each decomposition step, respond with this exact JSON format without any other text:\n{\n \"type\": \"object\",\n \"properties\": {\n \"index\": {\n \"type\": [\n \"integer\",\n \"null\"\n ]\n },\n \"question\": {\n \"type\": \"string\"\n },\n \"operator\": {\n \"type\": [\n \"string\",\n \"null\"\n ],\n \"enum\": [\n \"Scan\",\n \"Filter\",\n \"Aggregate\",\n \"Sort\",\n \"Top\",\n \"Join\",\n \"Union\",\n \"Intersect\",\n \"Except\",\n null\n ]\n },\n \"sub_questions\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#\"\n }\n }\n },\n \"required\": [\n \"index\",\n \"question\",\n \"operator\"\n ]\n}\n\nConversation Flow:\n1. User will provide the initial complex question\n2. You will:\n a. Choose an appropriate operator\n b. Decompose into sub-questions according to operator rules\n3. User will ask you to decompose one of the sub-questions if needed\n4. This process continues until we reach simple, directly answerable questions (Scan operations)\n\nImportant Rules:\n- Each decomposition MUST use exactly one operator from the valid list\n- Operator choice must be justified and appropriate for the question\n- Sub-questions must comply with the operator's requirements\n- Each sub-question should be simpler than the original question\n- Sub-questions should be clear and self-contained\n- Maintain context between decomposition steps\n- Use only tables and columns that exist in the provided schema\n",
"role": "system"
},
{
"content": "decompose the following question: List the states where both the secretary of 'Treasury' department and the secretary of 'Homeland Security' were born.",
"role": "user"
},
{
"content": "{\"index\":1,\"question\":\"List the states where both the secretary of 'Treasury' department and the secretary of 'Homeland Security' were born.\",\"operator\":\"Intersect\",\"sub_questions\":[{\"index\":2,\"question\":\"List the state where the secretary of 'Treasury' department was born.\",\"operator\":null,\"sub_questions\":[]},{\"index\":3,\"question\":\"List the state where the secretary of 'Homeland Security' department was born.\",\"operator\":null,\"sub_questions\":[]}]}",
"role": "assistant"
},
{
"content": "given the decomposition: {\"index\":1,\"question\":\"List the states where both the secretary of 'Treasury' department and the secretary of 'Homeland Security' were born.\",\"operator\":\"Intersect\",\"sub_questions\":[{\"index\":2,\"question\":\"List the state where the secretary of 'Treasury' department was born.\",\"operator\":null,\"sub_questions\":[]},{\"index\":3,\"question\":\"List the state where the secretary of 'Homeland Security' department was born.\",\"operator\":null,\"sub_questions\":[]}]}\ndecompose the following question with index 2: List the state where the secretary of 'Treasury' department was born.",
"role": "user"
},
{
"content": "{\"index\":2,\"question\":\"List the state where the secretary of 'Treasury' department was born.\",\"operator\":\"Join\",\"sub_questions\":[{\"index\":4,\"question\":\"List the secretary id of 'Treasury' department.\",\"operator\":null,\"sub_questions\":[]},{\"index\":5,\"question\":\"List the secretary ids and born states of all heads.\",\"operator\":null,\"sub_questions\":[]}]}",
"role": "assistant"
},
{
"content": "given the decomposition: {\"index\":1,\"question\":\"List the states where both the secretary of 'Treasury' department and the secretary of 'Homeland Security' were born.\",\"operator\":\"Intersect\",\"sub_questions\":[{\"index\":2,\"question\":\"List the state where the secretary of 'Treasury' department was born.\",\"operator\":\"Join\",\"sub_questions\":[{\"index\":4,\"question\":\"List the secretary id of 'Treasury' department.\",\"operator\":null,\"sub_questions\":[]},{\"index\":5,\"question\":\"List the secretary ids and born states of all heads.\",\"operator\":null,\"sub_questions\":[]}]},{\"index\":3,\"question\":\"List the state where the secretary of 'Homeland Security' department was born.\",\"operator\":null,\"sub_questions\":[]}]}\ndecompose the following question with index 3: List the state where the secretary of 'Homeland Security' department was born.",
"role": "user"
},
{
"content": "{\"index\":3,\"question\":\"List the state where the secretary of 'Homeland Security' department was born.\",\"operator\":\"Join\",\"sub_questions\":[{\"index\":6,\"question\":\"List the secretary id of 'Homeland Security' department.\",\"operator\":null,\"sub_questions\":[]},{\"index\":7,\"question\":\"List the secretary ids and born states of all heads.\",\"operator\":null,\"sub_questions\":[]}]}",
"role": "assistant"
},
{
"content": "given the decomposition: {\"index\":1,\"question\":\"List the states where both the secretary of 'Treasury' department and the secretary of 'Homeland Security' were born.\",\"operator\":\"Intersect\",\"sub_questions\":[{\"index\":2,\"question\":\"List the state where the secretary of 'Treasury' department was born.\",\"operator\":\"Join\",\"sub_questions\":[{\"index\":4,\"question\":\"List the secretary id of 'Treasury' department.\",\"operator\":null,\"sub_questions\":[]},{\"index\":5,\"question\":\"List the secretary ids and born states of all heads.\",\"operator\":null,\"sub_questions\":[]}]},{\"index\":3,\"question\":\"List the state where the secretary of 'Homeland Security' department was born.\",\"operator\":\"Join\",\"sub_questions\":[{\"index\":6,\"question\":\"List the secretary id of 'Homeland Security' department.\",\"operator\":null,\"sub_questions\":[]},{\"index\":7,\"question\":\"List the secretary ids and born states of all heads.\",\"operator\":null,\"sub_questions\":[]}]}]}\ndecompose the following question with index 4: List the secretary id of 'Treasury' department.",
"role": "user"
},
{
"content": "{\"index\":4,\"question\":\"List the secretary id of 'Treasury' department.\",\"operator\":\"Join\",\"sub_questions\":[{\"index\":8,\"question\":\"List the id of 'Treasury' department.\",\"operator\":null,\"sub_questions\":[]},{\"index\":9,\"question\":\"List the department ids and their secretary ids.\",\"operator\":null,\"sub_questions\":[]}]}",
"role": "assistant"
},
{
"content": "given the decomposition: {\"index\":1,\"question\":\"List the states where both the secretary of 'Treasury' department and the secretary of 'Homeland Security' were born.\",\"operator\":\"Intersect\",\"sub_questions\":[{\"index\":2,\"question\":\"List the state where the secretary of 'Treasury' department was born.\",\"operator\":\"Join\",\"sub_questions\":[{\"index\":4,\"question\":\"List the secretary id of 'Treasury' department.\",\"operator\":\"Join\",\"sub_questions\":[{\"index\":8,\"question\":\"List the id of 'Treasury' department.\",\"operator\":null,\"sub_questions\":[]},{\"index\":9,\"question\":\"List the department ids and their secretary ids.\",\"operator\":null,\"sub_questions\":[]}]},{\"index\":5,\"question\":\"List the secretary ids and born states of all heads.\",\"operator\":null,\"sub_questions\":[]}]},{\"index\":3,\"question\":\"List the state where the secretary of 'Homeland Security' department was born.\",\"operator\":\"Join\",\"sub_questions\":[{\"index\":6,\"question\":\"List the secretary id of 'Homeland Security' department.\",\"operator\":null,\"sub_questions\":[]},{\"index\":7,\"question\":\"List the secretary ids and born states of all heads.\",\"operator\":null,\"sub_questions\":[]}]}]}\ndecompose the following question with index 5: List the secretary ids and born states of all heads.",
"role": "user"
},
{
"content": "{\"index\":5,\"question\":\"List the secretary ids and born states of all heads.\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
},
{
"content": "given the decomposition: {\"index\":1,\"question\":\"List the states where both the secretary of 'Treasury' department and the secretary of 'Homeland Security' were born.\",\"operator\":\"Intersect\",\"sub_questions\":[{\"index\":2,\"question\":\"List the state where the secretary of 'Treasury' department was born.\",\"operator\":\"Join\",\"sub_questions\":[{\"index\":4,\"question\":\"List the secretary id of 'Treasury' department.\",\"operator\":\"Join\",\"sub_questions\":[{\"index\":8,\"question\":\"List the id of 'Treasury' department.\",\"operator\":null,\"sub_questions\":[]},{\"index\":9,\"question\":\"List the department ids and their secretary ids.\",\"operator\":null,\"sub_questions\":[]}]},{\"index\":5,\"question\":\"List the secretary ids and born states of all heads.\",\"operator\":\"Scan\",\"sub_questions\":[]}]},{\"index\":3,\"question\":\"List the state where the secretary of 'Homeland Security' department was born.\",\"operator\":\"Join\",\"sub_questions\":[{\"index\":6,\"question\":\"List the secretary id of 'Homeland Security' department.\",\"operator\":null,\"sub_questions\":[]},{\"index\":7,\"question\":\"List the secretary ids and born states of all heads.\",\"operator\":null,\"sub_questions\":[]}]}]}\ndecompose the following question with index 6: List the secretary id of 'Homeland Security' department.",
"role": "user"
},
{
"content": "{\"index\":6,\"question\":\"List the secretary id of 'Homeland Security' department.\",\"operator\":\"Join\",\"sub_questions\":[{\"index\":10,\"question\":\"List the id of 'Homeland Security' department.\",\"operator\":null,\"sub_questions\":[]},{\"index\":11,\"question\":\"List the department ids and their secretary ids.\",\"operator\":null,\"sub_questions\":[]}]}",
"role": "assistant"
},
{
"content": "given the decomposition: {\"index\":1,\"question\":\"List the states where both the secretary of 'Treasury' department and the secretary of 'Homeland Security' were born.\",\"operator\":\"Intersect\",\"sub_questions\":[{\"index\":2,\"question\":\"List the state where the secretary of 'Treasury' department was born.\",\"operator\":\"Join\",\"sub_questions\":[{\"index\":4,\"question\":\"List the secretary id of 'Treasury' department.\",\"operator\":\"Join\",\"sub_questions\":[{\"index\":8,\"question\":\"List the id of 'Treasury' department.\",\"operator\":null,\"sub_questions\":[]},{\"index\":9,\"question\":\"List the department ids and their secretary ids.\",\"operator\":null,\"sub_questions\":[]}]},{\"index\":5,\"question\":\"List the secretary ids and born states of all heads.\",\"operator\":\"Scan\",\"sub_questions\":[]}]},{\"index\":3,\"question\":\"List the state where the secretary of 'Homeland Security' department was born.\",\"operator\":\"Join\",\"sub_questions\":[{\"index\":6,\"question\":\"List the secretary id of 'Homeland Security' department.\",\"operator\":\"Join\",\"sub_questions\":[{\"index\":10,\"question\":\"List the id of 'Homeland Security' department.\",\"operator\":null,\"sub_questions\":[]},{\"index\":11,\"question\":\"List the department ids and their secretary ids.\",\"operator\":null,\"sub_questions\":[]}]},{\"index\":7,\"question\":\"List the secretary ids and born states of all heads.\",\"operator\":null,\"sub_questions\":[]}]}]}\ndecompose the following question with index 7: List the secretary ids and born states of all heads.",
"role": "user"
},
{
"content": "{\"index\":7,\"question\":\"List the secretary ids and born states of all heads.\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
},
{
"content": "given the decomposition: {\"index\":1,\"question\":\"List the states where both the secretary of 'Treasury' department and the secretary of 'Homeland Security' were born.\",\"operator\":\"Intersect\",\"sub_questions\":[{\"index\":2,\"question\":\"List the state where the secretary of 'Treasury' department was born.\",\"operator\":\"Join\",\"sub_questions\":[{\"index\":4,\"question\":\"List the secretary id of 'Treasury' department.\",\"operator\":\"Join\",\"sub_questions\":[{\"index\":8,\"question\":\"List the id of 'Treasury' department.\",\"operator\":null,\"sub_questions\":[]},{\"index\":9,\"question\":\"List the department ids and their secretary ids.\",\"operator\":null,\"sub_questions\":[]}]},{\"index\":5,\"question\":\"List the secretary ids and born states of all heads.\",\"operator\":\"Scan\",\"sub_questions\":[]}]},{\"index\":3,\"question\":\"List the state where the secretary of 'Homeland Security' department was born.\",\"operator\":\"Join\",\"sub_questions\":[{\"index\":6,\"question\":\"List the secretary id of 'Homeland Security' department.\",\"operator\":\"Join\",\"sub_questions\":[{\"index\":10,\"question\":\"List the id of 'Homeland Security' department.\",\"operator\":null,\"sub_questions\":[]},{\"index\":11,\"question\":\"List the department ids and their secretary ids.\",\"operator\":null,\"sub_questions\":[]}]},{\"index\":7,\"question\":\"List the secretary ids and born states of all heads.\",\"operator\":\"Scan\",\"sub_questions\":[]}]}]}\ndecompose the following question with index 8: List the id of 'Treasury' department.",
"role": "user"
},
{
"content": "{\"index\":8,\"question\":\"List the id of 'Treasury' department.\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
},
{
"content": "given the decomposition: {\"index\":1,\"question\":\"List the states where both the secretary of 'Treasury' department and the secretary of 'Homeland Security' were born.\",\"operator\":\"Intersect\",\"sub_questions\":[{\"index\":2,\"question\":\"List the state where the secretary of 'Treasury' department was born.\",\"operator\":\"Join\",\"sub_questions\":[{\"index\":4,\"question\":\"List the secretary id of 'Treasury' department.\",\"operator\":\"Join\",\"sub_questions\":[{\"index\":8,\"question\":\"List the id of 'Treasury' department.\",\"operator\":\"Scan\",\"sub_questions\":[]},{\"index\":9,\"question\":\"List the department ids and their secretary ids.\",\"operator\":null,\"sub_questions\":[]}]},{\"index\":5,\"question\":\"List the secretary ids and born states of all heads.\",\"operator\":\"Scan\",\"sub_questions\":[]}]},{\"index\":3,\"question\":\"List the state where the secretary of 'Homeland Security' department was born.\",\"operator\":\"Join\",\"sub_questions\":[{\"index\":6,\"question\":\"List the secretary id of 'Homeland Security' department.\",\"operator\":\"Join\",\"sub_questions\":[{\"index\":10,\"question\":\"List the id of 'Homeland Security' department.\",\"operator\":null,\"sub_questions\":[]},{\"index\":11,\"question\":\"List the department ids and their secretary ids.\",\"operator\":null,\"sub_questions\":[]}]},{\"index\":7,\"question\":\"List the secretary ids and born states of all heads.\",\"operator\":\"Scan\",\"sub_questions\":[]}]}]}\ndecompose the following question with index 9: List the department ids and their secretary ids.",
"role": "user"
},
{
"content": "{\"index\":9,\"question\":\"List the department ids and their secretary ids.\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
},
{
"content": "given the decomposition: {\"index\":1,\"question\":\"List the states where both the secretary of 'Treasury' department and the secretary of 'Homeland Security' were born.\",\"operator\":\"Intersect\",\"sub_questions\":[{\"index\":2,\"question\":\"List the state where the secretary of 'Treasury' department was born.\",\"operator\":\"Join\",\"sub_questions\":[{\"index\":4,\"question\":\"List the secretary id of 'Treasury' department.\",\"operator\":\"Join\",\"sub_questions\":[{\"index\":8,\"question\":\"List the id of 'Treasury' department.\",\"operator\":\"Scan\",\"sub_questions\":[]},{\"index\":9,\"question\":\"List the department ids and their secretary ids.\",\"operator\":\"Scan\",\"sub_questions\":[]}]},{\"index\":5,\"question\":\"List the secretary ids and born states of all heads.\",\"operator\":\"Scan\",\"sub_questions\":[]}]},{\"index\":3,\"question\":\"List the state where the secretary of 'Homeland Security' department was born.\",\"operator\":\"Join\",\"sub_questions\":[{\"index\":6,\"question\":\"List the secretary id of 'Homeland Security' department.\",\"operator\":\"Join\",\"sub_questions\":[{\"index\":10,\"question\":\"List the id of 'Homeland Security' department.\",\"operator\":null,\"sub_questions\":[]},{\"index\":11,\"question\":\"List the department ids and their secretary ids.\",\"operator\":null,\"sub_questions\":[]}]},{\"index\":7,\"question\":\"List the secretary ids and born states of all heads.\",\"operator\":\"Scan\",\"sub_questions\":[]}]}]}\ndecompose the following question with index 10: List the id of 'Homeland Security' department.",
"role": "user"
},
{
"content": "{\"index\":10,\"question\":\"List the id of 'Homeland Security' department.\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
},
{
"content": "given the decomposition: {\"index\":1,\"question\":\"List the states where both the secretary of 'Treasury' department and the secretary of 'Homeland Security' were born.\",\"operator\":\"Intersect\",\"sub_questions\":[{\"index\":2,\"question\":\"List the state where the secretary of 'Treasury' department was born.\",\"operator\":\"Join\",\"sub_questions\":[{\"index\":4,\"question\":\"List the secretary id of 'Treasury' department.\",\"operator\":\"Join\",\"sub_questions\":[{\"index\":8,\"question\":\"List the id of 'Treasury' department.\",\"operator\":\"Scan\",\"sub_questions\":[]},{\"index\":9,\"question\":\"List the department ids and their secretary ids.\",\"operator\":\"Scan\",\"sub_questions\":[]}]},{\"index\":5,\"question\":\"List the secretary ids and born states of all heads.\",\"operator\":\"Scan\",\"sub_questions\":[]}]},{\"index\":3,\"question\":\"List the state where the secretary of 'Homeland Security' department was born.\",\"operator\":\"Join\",\"sub_questions\":[{\"index\":6,\"question\":\"List the secretary id of 'Homeland Security' department.\",\"operator\":\"Join\",\"sub_questions\":[{\"index\":10,\"question\":\"List the id of 'Homeland Security' department.\",\"operator\":\"Scan\",\"sub_questions\":[]},{\"index\":11,\"question\":\"List the department ids and their secretary ids.\",\"operator\":null,\"sub_questions\":[]}]},{\"index\":7,\"question\":\"List the secretary ids and born states of all heads.\",\"operator\":\"Scan\",\"sub_questions\":[]}]}]}\ndecompose the following question with index 11: List the department ids and their secretary ids.",
"role": "user"
},
{
"content": "{\"index\":11,\"question\":\"List the department ids and their secretary ids.\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
}
] |
05fa1d5719ed4259ca79420810514335c8c92d1a75f475ba25bbc8c7b9d36673_1
|
department_management
|
List the state where the secretary of 'Treasury' department was born.
|
[
"#1 = Scan Table [ department ] Predicate [ Name = 'Treasury' ] Output [ Name , Department_ID ]",
"#2 = Scan Table [ management ] Output [ head_ID , department_ID ]",
"#3 = Join [ #1 , #2 ] Predicate [ #1.Department_ID = #2.department_ID ] Output [ #2.head_ID ]",
"#4 = Scan Table [ head ] Output [ head_ID , born_state ]",
"#5 = Join [ #3 , #4 ] Predicate [ #3.head_ID = #4.head_ID ] Output [ #4.born_state ]"
] |
[
"List the id of 'Treasury' department.",
"List the department ids and their secretary ids.",
"List the secretary id of 'Treasury' department.",
"List the secretary ids and born states of all heads.",
"List the state where the secretary of 'Treasury' department was born."
] |
[
{
"content": "You are a question decomposition expert. You are given a database schema and a complex database input question in natural language, and your task is to break down the complex database input question into simpler sub-questions in a recursive way, like a tree. In each step you will be given a question to decompose, so that your answer will be the input for the next steps.\n\nInput Question:\nList the states where both the secretary of 'Treasury' department and the secretary of 'Homeland Security' were born.\n\nDatabase Name:\ndepartment_management\n\nDatabase Schema:\nCREATE TABLE department (\n\tDepartment_ID number,\n\tName text,\n\tCreation text,\n\tRanking number,\n\tBudget_in_Billions number,\n\tNum_Employees number,\n\tprimary key ( Department_ID )\n)\n\nCREATE TABLE head (\n\thead_ID number,\n\tname text,\n\tborn_state text,\n\tage number,\n\tprimary key ( head_ID )\n)\n\nCREATE TABLE management (\n\tdepartment_ID number,\n\thead_ID number,\n\ttemporary_acting text,\n\tprimary key ( department_ID , head_ID ),\n\tforeign key ( department_ID ) references department ( Department_ID ),\n\tforeign key ( head_ID ) references head ( head_ID )\n)\n\nValid Operators:\nThe following operators are available for query decomposition:\n- Scan: Direct table access with no sub-questions\n- Filter: Selection based on conditions\n- Aggregate: Group and compute aggregations\n- Sort: Order results\n- Topsort: Sort and limit results\n- Top: Limit results\n- Join: Combine two sub-queries\n- Except: Set difference between two sub-queries\n- Intersect: Set intersection between two sub-queries\n- Union: Set union of two sub-queries\n\nOperator Rules:\n1. Each decomposition MUST specify exactly one operator from the above list\n2. Operator constraints:\n - Scan: Cannot have sub-questions\n - Filter/Aggregate/Sort/Top/Topsort: Can have 1 sub-question\n - Join/Union/Intersect/Except: Must have exactly 2 sub-questions\n\nTask Description:\n1. You will receive a complex database question that needs to be decomposed\n2. For each question, you should:\n - First, determine the appropriate operator from the valid list\n - Then break it down into sub-questions according to the operator's rules\n - Explain how these sub-questions relate to the original question\n - Indicate the order in which these sub-questions should be answered\n\nResponse Format:\nFor each decomposition step, respond with this exact JSON format without any other text:\n{\n \"type\": \"object\",\n \"properties\": {\n \"index\": {\n \"type\": [\n \"integer\",\n \"null\"\n ]\n },\n \"question\": {\n \"type\": \"string\"\n },\n \"operator\": {\n \"type\": [\n \"string\",\n \"null\"\n ],\n \"enum\": [\n \"Scan\",\n \"Filter\",\n \"Aggregate\",\n \"Sort\",\n \"Top\",\n \"Join\",\n \"Union\",\n \"Intersect\",\n \"Except\",\n null\n ]\n },\n \"sub_questions\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#\"\n }\n }\n },\n \"required\": [\n \"index\",\n \"question\",\n \"operator\"\n ]\n}\n\nConversation Flow:\n1. User will provide the initial complex question\n2. You will:\n a. Choose an appropriate operator\n b. Decompose into sub-questions according to operator rules\n3. User will ask you to decompose one of the sub-questions if needed\n4. This process continues until we reach simple, directly answerable questions (Scan operations)\n\nImportant Rules:\n- Each decomposition MUST use exactly one operator from the valid list\n- Operator choice must be justified and appropriate for the question\n- Sub-questions must comply with the operator's requirements\n- Each sub-question should be simpler than the original question\n- Sub-questions should be clear and self-contained\n- Maintain context between decomposition steps\n- Use only tables and columns that exist in the provided schema\n",
"role": "system"
},
{
"content": "decompose the following question: List the state where the secretary of 'Treasury' department was born.",
"role": "user"
},
{
"content": "{\"index\":1,\"question\":\"List the state where the secretary of 'Treasury' department was born.\",\"operator\":\"Join\",\"sub_questions\":[{\"index\":2,\"question\":\"List the secretary id of 'Treasury' department.\",\"operator\":null,\"sub_questions\":[]},{\"index\":3,\"question\":\"List the secretary ids and born states of all heads.\",\"operator\":null,\"sub_questions\":[]}]}",
"role": "assistant"
},
{
"content": "given the decomposition: {\"index\":1,\"question\":\"List the state where the secretary of 'Treasury' department was born.\",\"operator\":\"Join\",\"sub_questions\":[{\"index\":2,\"question\":\"List the secretary id of 'Treasury' department.\",\"operator\":null,\"sub_questions\":[]},{\"index\":3,\"question\":\"List the secretary ids and born states of all heads.\",\"operator\":null,\"sub_questions\":[]}]}\ndecompose the following question with index 2: List the secretary id of 'Treasury' department.",
"role": "user"
},
{
"content": "{\"index\":2,\"question\":\"List the secretary id of 'Treasury' department.\",\"operator\":\"Join\",\"sub_questions\":[{\"index\":4,\"question\":\"List the id of 'Treasury' department.\",\"operator\":null,\"sub_questions\":[]},{\"index\":5,\"question\":\"List the department ids and their secretary ids.\",\"operator\":null,\"sub_questions\":[]}]}",
"role": "assistant"
},
{
"content": "given the decomposition: {\"index\":1,\"question\":\"List the state where the secretary of 'Treasury' department was born.\",\"operator\":\"Join\",\"sub_questions\":[{\"index\":2,\"question\":\"List the secretary id of 'Treasury' department.\",\"operator\":\"Join\",\"sub_questions\":[{\"index\":4,\"question\":\"List the id of 'Treasury' department.\",\"operator\":null,\"sub_questions\":[]},{\"index\":5,\"question\":\"List the department ids and their secretary ids.\",\"operator\":null,\"sub_questions\":[]}]},{\"index\":3,\"question\":\"List the secretary ids and born states of all heads.\",\"operator\":null,\"sub_questions\":[]}]}\ndecompose the following question with index 3: List the secretary ids and born states of all heads.",
"role": "user"
},
{
"content": "{\"index\":3,\"question\":\"List the secretary ids and born states of all heads.\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
},
{
"content": "given the decomposition: {\"index\":1,\"question\":\"List the state where the secretary of 'Treasury' department was born.\",\"operator\":\"Join\",\"sub_questions\":[{\"index\":2,\"question\":\"List the secretary id of 'Treasury' department.\",\"operator\":\"Join\",\"sub_questions\":[{\"index\":4,\"question\":\"List the id of 'Treasury' department.\",\"operator\":null,\"sub_questions\":[]},{\"index\":5,\"question\":\"List the department ids and their secretary ids.\",\"operator\":null,\"sub_questions\":[]}]},{\"index\":3,\"question\":\"List the secretary ids and born states of all heads.\",\"operator\":\"Scan\",\"sub_questions\":[]}]}\ndecompose the following question with index 4: List the id of 'Treasury' department.",
"role": "user"
},
{
"content": "{\"index\":4,\"question\":\"List the id of 'Treasury' department.\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
},
{
"content": "given the decomposition: {\"index\":1,\"question\":\"List the state where the secretary of 'Treasury' department was born.\",\"operator\":\"Join\",\"sub_questions\":[{\"index\":2,\"question\":\"List the secretary id of 'Treasury' department.\",\"operator\":\"Join\",\"sub_questions\":[{\"index\":4,\"question\":\"List the id of 'Treasury' department.\",\"operator\":\"Scan\",\"sub_questions\":[]},{\"index\":5,\"question\":\"List the department ids and their secretary ids.\",\"operator\":null,\"sub_questions\":[]}]},{\"index\":3,\"question\":\"List the secretary ids and born states of all heads.\",\"operator\":\"Scan\",\"sub_questions\":[]}]}\ndecompose the following question with index 5: List the department ids and their secretary ids.",
"role": "user"
},
{
"content": "{\"index\":5,\"question\":\"List the department ids and their secretary ids.\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
}
] |
05fa1d5719ed4259ca79420810514335c8c92d1a75f475ba25bbc8c7b9d36673_2
|
department_management
|
List the state where the secretary of 'Homeland Security' department was born.
|
[
"#1 = Scan Table [ department ] Predicate [ Name = 'Homeland Security' ] Output [ Name , Department_ID ]",
"#2 = Scan Table [ management ] Output [ head_ID , department_ID ]",
"#3 = Join [ #1 , #2 ] Predicate [ #1.Department_ID = #2.department_ID ] Output [ #2.head_ID ]",
"#4 = Scan Table [ head ] Output [ head_ID , born_state ]",
"#5 = Join [ #3 , #4 ] Predicate [ #3.head_ID = #4.head_ID ] Output [ #4.born_state ]"
] |
[
"List the id of 'Homeland Security' department.",
"List the department ids and their secretary ids.",
"List the secretary id of 'Homeland Security' department.",
"List the secretary ids and born states of all heads.",
"List the state where the secretary of 'Homeland Security' department was born."
] |
[
{
"content": "You are a question decomposition expert. You are given a database schema and a complex database input question in natural language, and your task is to break down the complex database input question into simpler sub-questions in a recursive way, like a tree. In each step you will be given a question to decompose, so that your answer will be the input for the next steps.\n\nInput Question:\nList the states where both the secretary of 'Treasury' department and the secretary of 'Homeland Security' were born.\n\nDatabase Name:\ndepartment_management\n\nDatabase Schema:\nCREATE TABLE department (\n\tDepartment_ID number,\n\tName text,\n\tCreation text,\n\tRanking number,\n\tBudget_in_Billions number,\n\tNum_Employees number,\n\tprimary key ( Department_ID )\n)\n\nCREATE TABLE head (\n\thead_ID number,\n\tname text,\n\tborn_state text,\n\tage number,\n\tprimary key ( head_ID )\n)\n\nCREATE TABLE management (\n\tdepartment_ID number,\n\thead_ID number,\n\ttemporary_acting text,\n\tprimary key ( department_ID , head_ID ),\n\tforeign key ( department_ID ) references department ( Department_ID ),\n\tforeign key ( head_ID ) references head ( head_ID )\n)\n\nValid Operators:\nThe following operators are available for query decomposition:\n- Scan: Direct table access with no sub-questions\n- Filter: Selection based on conditions\n- Aggregate: Group and compute aggregations\n- Sort: Order results\n- Topsort: Sort and limit results\n- Top: Limit results\n- Join: Combine two sub-queries\n- Except: Set difference between two sub-queries\n- Intersect: Set intersection between two sub-queries\n- Union: Set union of two sub-queries\n\nOperator Rules:\n1. Each decomposition MUST specify exactly one operator from the above list\n2. Operator constraints:\n - Scan: Cannot have sub-questions\n - Filter/Aggregate/Sort/Top/Topsort: Can have 1 sub-question\n - Join/Union/Intersect/Except: Must have exactly 2 sub-questions\n\nTask Description:\n1. You will receive a complex database question that needs to be decomposed\n2. For each question, you should:\n - First, determine the appropriate operator from the valid list\n - Then break it down into sub-questions according to the operator's rules\n - Explain how these sub-questions relate to the original question\n - Indicate the order in which these sub-questions should be answered\n\nResponse Format:\nFor each decomposition step, respond with this exact JSON format without any other text:\n{\n \"type\": \"object\",\n \"properties\": {\n \"index\": {\n \"type\": [\n \"integer\",\n \"null\"\n ]\n },\n \"question\": {\n \"type\": \"string\"\n },\n \"operator\": {\n \"type\": [\n \"string\",\n \"null\"\n ],\n \"enum\": [\n \"Scan\",\n \"Filter\",\n \"Aggregate\",\n \"Sort\",\n \"Top\",\n \"Join\",\n \"Union\",\n \"Intersect\",\n \"Except\",\n null\n ]\n },\n \"sub_questions\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#\"\n }\n }\n },\n \"required\": [\n \"index\",\n \"question\",\n \"operator\"\n ]\n}\n\nConversation Flow:\n1. User will provide the initial complex question\n2. You will:\n a. Choose an appropriate operator\n b. Decompose into sub-questions according to operator rules\n3. User will ask you to decompose one of the sub-questions if needed\n4. This process continues until we reach simple, directly answerable questions (Scan operations)\n\nImportant Rules:\n- Each decomposition MUST use exactly one operator from the valid list\n- Operator choice must be justified and appropriate for the question\n- Sub-questions must comply with the operator's requirements\n- Each sub-question should be simpler than the original question\n- Sub-questions should be clear and self-contained\n- Maintain context between decomposition steps\n- Use only tables and columns that exist in the provided schema\n",
"role": "system"
},
{
"content": "decompose the following question: List the state where the secretary of 'Homeland Security' department was born.",
"role": "user"
},
{
"content": "{\"index\":1,\"question\":\"List the state where the secretary of 'Homeland Security' department was born.\",\"operator\":\"Join\",\"sub_questions\":[{\"index\":2,\"question\":\"List the secretary id of 'Homeland Security' department.\",\"operator\":null,\"sub_questions\":[]},{\"index\":3,\"question\":\"List the secretary ids and born states of all heads.\",\"operator\":null,\"sub_questions\":[]}]}",
"role": "assistant"
},
{
"content": "given the decomposition: {\"index\":1,\"question\":\"List the state where the secretary of 'Homeland Security' department was born.\",\"operator\":\"Join\",\"sub_questions\":[{\"index\":2,\"question\":\"List the secretary id of 'Homeland Security' department.\",\"operator\":null,\"sub_questions\":[]},{\"index\":3,\"question\":\"List the secretary ids and born states of all heads.\",\"operator\":null,\"sub_questions\":[]}]}\ndecompose the following question with index 2: List the secretary id of 'Homeland Security' department.",
"role": "user"
},
{
"content": "{\"index\":2,\"question\":\"List the secretary id of 'Homeland Security' department.\",\"operator\":\"Join\",\"sub_questions\":[{\"index\":4,\"question\":\"List the id of 'Homeland Security' department.\",\"operator\":null,\"sub_questions\":[]},{\"index\":5,\"question\":\"List the department ids and their secretary ids.\",\"operator\":null,\"sub_questions\":[]}]}",
"role": "assistant"
},
{
"content": "given the decomposition: {\"index\":1,\"question\":\"List the state where the secretary of 'Homeland Security' department was born.\",\"operator\":\"Join\",\"sub_questions\":[{\"index\":2,\"question\":\"List the secretary id of 'Homeland Security' department.\",\"operator\":\"Join\",\"sub_questions\":[{\"index\":4,\"question\":\"List the id of 'Homeland Security' department.\",\"operator\":null,\"sub_questions\":[]},{\"index\":5,\"question\":\"List the department ids and their secretary ids.\",\"operator\":null,\"sub_questions\":[]}]},{\"index\":3,\"question\":\"List the secretary ids and born states of all heads.\",\"operator\":null,\"sub_questions\":[]}]}\ndecompose the following question with index 3: List the secretary ids and born states of all heads.",
"role": "user"
},
{
"content": "{\"index\":3,\"question\":\"List the secretary ids and born states of all heads.\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
},
{
"content": "given the decomposition: {\"index\":1,\"question\":\"List the state where the secretary of 'Homeland Security' department was born.\",\"operator\":\"Join\",\"sub_questions\":[{\"index\":2,\"question\":\"List the secretary id of 'Homeland Security' department.\",\"operator\":\"Join\",\"sub_questions\":[{\"index\":4,\"question\":\"List the id of 'Homeland Security' department.\",\"operator\":null,\"sub_questions\":[]},{\"index\":5,\"question\":\"List the department ids and their secretary ids.\",\"operator\":null,\"sub_questions\":[]}]},{\"index\":3,\"question\":\"List the secretary ids and born states of all heads.\",\"operator\":\"Scan\",\"sub_questions\":[]}]}\ndecompose the following question with index 4: List the id of 'Homeland Security' department.",
"role": "user"
},
{
"content": "{\"index\":4,\"question\":\"List the id of 'Homeland Security' department.\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
},
{
"content": "given the decomposition: {\"index\":1,\"question\":\"List the state where the secretary of 'Homeland Security' department was born.\",\"operator\":\"Join\",\"sub_questions\":[{\"index\":2,\"question\":\"List the secretary id of 'Homeland Security' department.\",\"operator\":\"Join\",\"sub_questions\":[{\"index\":4,\"question\":\"List the id of 'Homeland Security' department.\",\"operator\":\"Scan\",\"sub_questions\":[]},{\"index\":5,\"question\":\"List the department ids and their secretary ids.\",\"operator\":null,\"sub_questions\":[]}]},{\"index\":3,\"question\":\"List the secretary ids and born states of all heads.\",\"operator\":\"Scan\",\"sub_questions\":[]}]}\ndecompose the following question with index 5: List the department ids and their secretary ids.",
"role": "user"
},
{
"content": "{\"index\":5,\"question\":\"List the department ids and their secretary ids.\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
}
] |
05fa1d5719ed4259ca79420810514335c8c92d1a75f475ba25bbc8c7b9d36673_3
|
department_management
|
List the secretary id of 'Treasury' department.
|
[
"#1 = Scan Table [ department ] Predicate [ Name = 'Treasury' ] Output [ Name , Department_ID ]",
"#2 = Scan Table [ management ] Output [ head_ID , department_ID ]",
"#3 = Join [ #1 , #2 ] Predicate [ #1.Department_ID = #2.department_ID ] Output [ #2.head_ID ]"
] |
[
"List the id of 'Treasury' department.",
"List the department ids and their secretary ids.",
"List the secretary id of 'Treasury' department."
] |
[
{
"content": "You are a question decomposition expert. You are given a database schema and a complex database input question in natural language, and your task is to break down the complex database input question into simpler sub-questions in a recursive way, like a tree. In each step you will be given a question to decompose, so that your answer will be the input for the next steps.\n\nInput Question:\nList the states where both the secretary of 'Treasury' department and the secretary of 'Homeland Security' were born.\n\nDatabase Name:\ndepartment_management\n\nDatabase Schema:\nCREATE TABLE department (\n\tDepartment_ID number,\n\tName text,\n\tCreation text,\n\tRanking number,\n\tBudget_in_Billions number,\n\tNum_Employees number,\n\tprimary key ( Department_ID )\n)\n\nCREATE TABLE head (\n\thead_ID number,\n\tname text,\n\tborn_state text,\n\tage number,\n\tprimary key ( head_ID )\n)\n\nCREATE TABLE management (\n\tdepartment_ID number,\n\thead_ID number,\n\ttemporary_acting text,\n\tprimary key ( department_ID , head_ID ),\n\tforeign key ( department_ID ) references department ( Department_ID ),\n\tforeign key ( head_ID ) references head ( head_ID )\n)\n\nValid Operators:\nThe following operators are available for query decomposition:\n- Scan: Direct table access with no sub-questions\n- Filter: Selection based on conditions\n- Aggregate: Group and compute aggregations\n- Sort: Order results\n- Topsort: Sort and limit results\n- Top: Limit results\n- Join: Combine two sub-queries\n- Except: Set difference between two sub-queries\n- Intersect: Set intersection between two sub-queries\n- Union: Set union of two sub-queries\n\nOperator Rules:\n1. Each decomposition MUST specify exactly one operator from the above list\n2. Operator constraints:\n - Scan: Cannot have sub-questions\n - Filter/Aggregate/Sort/Top/Topsort: Can have 1 sub-question\n - Join/Union/Intersect/Except: Must have exactly 2 sub-questions\n\nTask Description:\n1. You will receive a complex database question that needs to be decomposed\n2. For each question, you should:\n - First, determine the appropriate operator from the valid list\n - Then break it down into sub-questions according to the operator's rules\n - Explain how these sub-questions relate to the original question\n - Indicate the order in which these sub-questions should be answered\n\nResponse Format:\nFor each decomposition step, respond with this exact JSON format without any other text:\n{\n \"type\": \"object\",\n \"properties\": {\n \"index\": {\n \"type\": [\n \"integer\",\n \"null\"\n ]\n },\n \"question\": {\n \"type\": \"string\"\n },\n \"operator\": {\n \"type\": [\n \"string\",\n \"null\"\n ],\n \"enum\": [\n \"Scan\",\n \"Filter\",\n \"Aggregate\",\n \"Sort\",\n \"Top\",\n \"Join\",\n \"Union\",\n \"Intersect\",\n \"Except\",\n null\n ]\n },\n \"sub_questions\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#\"\n }\n }\n },\n \"required\": [\n \"index\",\n \"question\",\n \"operator\"\n ]\n}\n\nConversation Flow:\n1. User will provide the initial complex question\n2. You will:\n a. Choose an appropriate operator\n b. Decompose into sub-questions according to operator rules\n3. User will ask you to decompose one of the sub-questions if needed\n4. This process continues until we reach simple, directly answerable questions (Scan operations)\n\nImportant Rules:\n- Each decomposition MUST use exactly one operator from the valid list\n- Operator choice must be justified and appropriate for the question\n- Sub-questions must comply with the operator's requirements\n- Each sub-question should be simpler than the original question\n- Sub-questions should be clear and self-contained\n- Maintain context between decomposition steps\n- Use only tables and columns that exist in the provided schema\n",
"role": "system"
},
{
"content": "decompose the following question: List the secretary id of 'Treasury' department.",
"role": "user"
},
{
"content": "{\"index\":1,\"question\":\"List the secretary id of 'Treasury' department.\",\"operator\":\"Join\",\"sub_questions\":[{\"index\":2,\"question\":\"List the id of 'Treasury' department.\",\"operator\":null,\"sub_questions\":[]},{\"index\":3,\"question\":\"List the department ids and their secretary ids.\",\"operator\":null,\"sub_questions\":[]}]}",
"role": "assistant"
},
{
"content": "given the decomposition: {\"index\":1,\"question\":\"List the secretary id of 'Treasury' department.\",\"operator\":\"Join\",\"sub_questions\":[{\"index\":2,\"question\":\"List the id of 'Treasury' department.\",\"operator\":null,\"sub_questions\":[]},{\"index\":3,\"question\":\"List the department ids and their secretary ids.\",\"operator\":null,\"sub_questions\":[]}]}\ndecompose the following question with index 2: List the id of 'Treasury' department.",
"role": "user"
},
{
"content": "{\"index\":2,\"question\":\"List the id of 'Treasury' department.\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
},
{
"content": "given the decomposition: {\"index\":1,\"question\":\"List the secretary id of 'Treasury' department.\",\"operator\":\"Join\",\"sub_questions\":[{\"index\":2,\"question\":\"List the id of 'Treasury' department.\",\"operator\":\"Scan\",\"sub_questions\":[]},{\"index\":3,\"question\":\"List the department ids and their secretary ids.\",\"operator\":null,\"sub_questions\":[]}]}\ndecompose the following question with index 3: List the department ids and their secretary ids.",
"role": "user"
},
{
"content": "{\"index\":3,\"question\":\"List the department ids and their secretary ids.\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
}
] |
05fa1d5719ed4259ca79420810514335c8c92d1a75f475ba25bbc8c7b9d36673_4
|
department_management
|
List the secretary ids and born states of all heads.
|
[
"#1 = Scan Table [ head ] Output [ head_ID , born_state ]"
] |
[
"List the secretary ids and born states of all heads."
] |
[
{
"content": "You are a question decomposition expert. You are given a database schema and a complex database input question in natural language, and your task is to break down the complex database input question into simpler sub-questions in a recursive way, like a tree. In each step you will be given a question to decompose, so that your answer will be the input for the next steps.\n\nInput Question:\nList the states where both the secretary of 'Treasury' department and the secretary of 'Homeland Security' were born.\n\nDatabase Name:\ndepartment_management\n\nDatabase Schema:\nCREATE TABLE department (\n\tDepartment_ID number,\n\tName text,\n\tCreation text,\n\tRanking number,\n\tBudget_in_Billions number,\n\tNum_Employees number,\n\tprimary key ( Department_ID )\n)\n\nCREATE TABLE head (\n\thead_ID number,\n\tname text,\n\tborn_state text,\n\tage number,\n\tprimary key ( head_ID )\n)\n\nCREATE TABLE management (\n\tdepartment_ID number,\n\thead_ID number,\n\ttemporary_acting text,\n\tprimary key ( department_ID , head_ID ),\n\tforeign key ( department_ID ) references department ( Department_ID ),\n\tforeign key ( head_ID ) references head ( head_ID )\n)\n\nValid Operators:\nThe following operators are available for query decomposition:\n- Scan: Direct table access with no sub-questions\n- Filter: Selection based on conditions\n- Aggregate: Group and compute aggregations\n- Sort: Order results\n- Topsort: Sort and limit results\n- Top: Limit results\n- Join: Combine two sub-queries\n- Except: Set difference between two sub-queries\n- Intersect: Set intersection between two sub-queries\n- Union: Set union of two sub-queries\n\nOperator Rules:\n1. Each decomposition MUST specify exactly one operator from the above list\n2. Operator constraints:\n - Scan: Cannot have sub-questions\n - Filter/Aggregate/Sort/Top/Topsort: Can have 1 sub-question\n - Join/Union/Intersect/Except: Must have exactly 2 sub-questions\n\nTask Description:\n1. You will receive a complex database question that needs to be decomposed\n2. For each question, you should:\n - First, determine the appropriate operator from the valid list\n - Then break it down into sub-questions according to the operator's rules\n - Explain how these sub-questions relate to the original question\n - Indicate the order in which these sub-questions should be answered\n\nResponse Format:\nFor each decomposition step, respond with this exact JSON format without any other text:\n{\n \"type\": \"object\",\n \"properties\": {\n \"index\": {\n \"type\": [\n \"integer\",\n \"null\"\n ]\n },\n \"question\": {\n \"type\": \"string\"\n },\n \"operator\": {\n \"type\": [\n \"string\",\n \"null\"\n ],\n \"enum\": [\n \"Scan\",\n \"Filter\",\n \"Aggregate\",\n \"Sort\",\n \"Top\",\n \"Join\",\n \"Union\",\n \"Intersect\",\n \"Except\",\n null\n ]\n },\n \"sub_questions\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#\"\n }\n }\n },\n \"required\": [\n \"index\",\n \"question\",\n \"operator\"\n ]\n}\n\nConversation Flow:\n1. User will provide the initial complex question\n2. You will:\n a. Choose an appropriate operator\n b. Decompose into sub-questions according to operator rules\n3. User will ask you to decompose one of the sub-questions if needed\n4. This process continues until we reach simple, directly answerable questions (Scan operations)\n\nImportant Rules:\n- Each decomposition MUST use exactly one operator from the valid list\n- Operator choice must be justified and appropriate for the question\n- Sub-questions must comply with the operator's requirements\n- Each sub-question should be simpler than the original question\n- Sub-questions should be clear and self-contained\n- Maintain context between decomposition steps\n- Use only tables and columns that exist in the provided schema\n",
"role": "system"
},
{
"content": "decompose the following question: List the secretary ids and born states of all heads.",
"role": "user"
},
{
"content": "{\"index\":1,\"question\":\"List the secretary ids and born states of all heads.\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
}
] |
05fa1d5719ed4259ca79420810514335c8c92d1a75f475ba25bbc8c7b9d36673_5
|
department_management
|
List the secretary id of 'Homeland Security' department.
|
[
"#1 = Scan Table [ department ] Predicate [ Name = 'Homeland Security' ] Output [ Name , Department_ID ]",
"#2 = Scan Table [ management ] Output [ head_ID , department_ID ]",
"#3 = Join [ #1 , #2 ] Predicate [ #1.Department_ID = #2.department_ID ] Output [ #2.head_ID ]"
] |
[
"List the id of 'Homeland Security' department.",
"List the department ids and their secretary ids.",
"List the secretary id of 'Homeland Security' department."
] |
[
{
"content": "You are a question decomposition expert. You are given a database schema and a complex database input question in natural language, and your task is to break down the complex database input question into simpler sub-questions in a recursive way, like a tree. In each step you will be given a question to decompose, so that your answer will be the input for the next steps.\n\nInput Question:\nList the states where both the secretary of 'Treasury' department and the secretary of 'Homeland Security' were born.\n\nDatabase Name:\ndepartment_management\n\nDatabase Schema:\nCREATE TABLE department (\n\tDepartment_ID number,\n\tName text,\n\tCreation text,\n\tRanking number,\n\tBudget_in_Billions number,\n\tNum_Employees number,\n\tprimary key ( Department_ID )\n)\n\nCREATE TABLE head (\n\thead_ID number,\n\tname text,\n\tborn_state text,\n\tage number,\n\tprimary key ( head_ID )\n)\n\nCREATE TABLE management (\n\tdepartment_ID number,\n\thead_ID number,\n\ttemporary_acting text,\n\tprimary key ( department_ID , head_ID ),\n\tforeign key ( department_ID ) references department ( Department_ID ),\n\tforeign key ( head_ID ) references head ( head_ID )\n)\n\nValid Operators:\nThe following operators are available for query decomposition:\n- Scan: Direct table access with no sub-questions\n- Filter: Selection based on conditions\n- Aggregate: Group and compute aggregations\n- Sort: Order results\n- Topsort: Sort and limit results\n- Top: Limit results\n- Join: Combine two sub-queries\n- Except: Set difference between two sub-queries\n- Intersect: Set intersection between two sub-queries\n- Union: Set union of two sub-queries\n\nOperator Rules:\n1. Each decomposition MUST specify exactly one operator from the above list\n2. Operator constraints:\n - Scan: Cannot have sub-questions\n - Filter/Aggregate/Sort/Top/Topsort: Can have 1 sub-question\n - Join/Union/Intersect/Except: Must have exactly 2 sub-questions\n\nTask Description:\n1. You will receive a complex database question that needs to be decomposed\n2. For each question, you should:\n - First, determine the appropriate operator from the valid list\n - Then break it down into sub-questions according to the operator's rules\n - Explain how these sub-questions relate to the original question\n - Indicate the order in which these sub-questions should be answered\n\nResponse Format:\nFor each decomposition step, respond with this exact JSON format without any other text:\n{\n \"type\": \"object\",\n \"properties\": {\n \"index\": {\n \"type\": [\n \"integer\",\n \"null\"\n ]\n },\n \"question\": {\n \"type\": \"string\"\n },\n \"operator\": {\n \"type\": [\n \"string\",\n \"null\"\n ],\n \"enum\": [\n \"Scan\",\n \"Filter\",\n \"Aggregate\",\n \"Sort\",\n \"Top\",\n \"Join\",\n \"Union\",\n \"Intersect\",\n \"Except\",\n null\n ]\n },\n \"sub_questions\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#\"\n }\n }\n },\n \"required\": [\n \"index\",\n \"question\",\n \"operator\"\n ]\n}\n\nConversation Flow:\n1. User will provide the initial complex question\n2. You will:\n a. Choose an appropriate operator\n b. Decompose into sub-questions according to operator rules\n3. User will ask you to decompose one of the sub-questions if needed\n4. This process continues until we reach simple, directly answerable questions (Scan operations)\n\nImportant Rules:\n- Each decomposition MUST use exactly one operator from the valid list\n- Operator choice must be justified and appropriate for the question\n- Sub-questions must comply with the operator's requirements\n- Each sub-question should be simpler than the original question\n- Sub-questions should be clear and self-contained\n- Maintain context between decomposition steps\n- Use only tables and columns that exist in the provided schema\n",
"role": "system"
},
{
"content": "decompose the following question: List the secretary id of 'Homeland Security' department.",
"role": "user"
},
{
"content": "{\"index\":1,\"question\":\"List the secretary id of 'Homeland Security' department.\",\"operator\":\"Join\",\"sub_questions\":[{\"index\":2,\"question\":\"List the id of 'Homeland Security' department.\",\"operator\":null,\"sub_questions\":[]},{\"index\":3,\"question\":\"List the department ids and their secretary ids.\",\"operator\":null,\"sub_questions\":[]}]}",
"role": "assistant"
},
{
"content": "given the decomposition: {\"index\":1,\"question\":\"List the secretary id of 'Homeland Security' department.\",\"operator\":\"Join\",\"sub_questions\":[{\"index\":2,\"question\":\"List the id of 'Homeland Security' department.\",\"operator\":null,\"sub_questions\":[]},{\"index\":3,\"question\":\"List the department ids and their secretary ids.\",\"operator\":null,\"sub_questions\":[]}]}\ndecompose the following question with index 2: List the id of 'Homeland Security' department.",
"role": "user"
},
{
"content": "{\"index\":2,\"question\":\"List the id of 'Homeland Security' department.\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
},
{
"content": "given the decomposition: {\"index\":1,\"question\":\"List the secretary id of 'Homeland Security' department.\",\"operator\":\"Join\",\"sub_questions\":[{\"index\":2,\"question\":\"List the id of 'Homeland Security' department.\",\"operator\":\"Scan\",\"sub_questions\":[]},{\"index\":3,\"question\":\"List the department ids and their secretary ids.\",\"operator\":null,\"sub_questions\":[]}]}\ndecompose the following question with index 3: List the department ids and their secretary ids.",
"role": "user"
},
{
"content": "{\"index\":3,\"question\":\"List the department ids and their secretary ids.\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
}
] |
05fa1d5719ed4259ca79420810514335c8c92d1a75f475ba25bbc8c7b9d36673_6
|
department_management
|
List the secretary ids and born states of all heads.
|
[
"#1 = Scan Table [ head ] Output [ head_ID , born_state ]"
] |
[
"List the secretary ids and born states of all heads."
] |
[
{
"content": "You are a question decomposition expert. You are given a database schema and a complex database input question in natural language, and your task is to break down the complex database input question into simpler sub-questions in a recursive way, like a tree. In each step you will be given a question to decompose, so that your answer will be the input for the next steps.\n\nInput Question:\nList the states where both the secretary of 'Treasury' department and the secretary of 'Homeland Security' were born.\n\nDatabase Name:\ndepartment_management\n\nDatabase Schema:\nCREATE TABLE department (\n\tDepartment_ID number,\n\tName text,\n\tCreation text,\n\tRanking number,\n\tBudget_in_Billions number,\n\tNum_Employees number,\n\tprimary key ( Department_ID )\n)\n\nCREATE TABLE head (\n\thead_ID number,\n\tname text,\n\tborn_state text,\n\tage number,\n\tprimary key ( head_ID )\n)\n\nCREATE TABLE management (\n\tdepartment_ID number,\n\thead_ID number,\n\ttemporary_acting text,\n\tprimary key ( department_ID , head_ID ),\n\tforeign key ( department_ID ) references department ( Department_ID ),\n\tforeign key ( head_ID ) references head ( head_ID )\n)\n\nValid Operators:\nThe following operators are available for query decomposition:\n- Scan: Direct table access with no sub-questions\n- Filter: Selection based on conditions\n- Aggregate: Group and compute aggregations\n- Sort: Order results\n- Topsort: Sort and limit results\n- Top: Limit results\n- Join: Combine two sub-queries\n- Except: Set difference between two sub-queries\n- Intersect: Set intersection between two sub-queries\n- Union: Set union of two sub-queries\n\nOperator Rules:\n1. Each decomposition MUST specify exactly one operator from the above list\n2. Operator constraints:\n - Scan: Cannot have sub-questions\n - Filter/Aggregate/Sort/Top/Topsort: Can have 1 sub-question\n - Join/Union/Intersect/Except: Must have exactly 2 sub-questions\n\nTask Description:\n1. You will receive a complex database question that needs to be decomposed\n2. For each question, you should:\n - First, determine the appropriate operator from the valid list\n - Then break it down into sub-questions according to the operator's rules\n - Explain how these sub-questions relate to the original question\n - Indicate the order in which these sub-questions should be answered\n\nResponse Format:\nFor each decomposition step, respond with this exact JSON format without any other text:\n{\n \"type\": \"object\",\n \"properties\": {\n \"index\": {\n \"type\": [\n \"integer\",\n \"null\"\n ]\n },\n \"question\": {\n \"type\": \"string\"\n },\n \"operator\": {\n \"type\": [\n \"string\",\n \"null\"\n ],\n \"enum\": [\n \"Scan\",\n \"Filter\",\n \"Aggregate\",\n \"Sort\",\n \"Top\",\n \"Join\",\n \"Union\",\n \"Intersect\",\n \"Except\",\n null\n ]\n },\n \"sub_questions\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#\"\n }\n }\n },\n \"required\": [\n \"index\",\n \"question\",\n \"operator\"\n ]\n}\n\nConversation Flow:\n1. User will provide the initial complex question\n2. You will:\n a. Choose an appropriate operator\n b. Decompose into sub-questions according to operator rules\n3. User will ask you to decompose one of the sub-questions if needed\n4. This process continues until we reach simple, directly answerable questions (Scan operations)\n\nImportant Rules:\n- Each decomposition MUST use exactly one operator from the valid list\n- Operator choice must be justified and appropriate for the question\n- Sub-questions must comply with the operator's requirements\n- Each sub-question should be simpler than the original question\n- Sub-questions should be clear and self-contained\n- Maintain context between decomposition steps\n- Use only tables and columns that exist in the provided schema\n",
"role": "system"
},
{
"content": "decompose the following question: List the secretary ids and born states of all heads.",
"role": "user"
},
{
"content": "{\"index\":1,\"question\":\"List the secretary ids and born states of all heads.\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
}
] |
05fa1d5719ed4259ca79420810514335c8c92d1a75f475ba25bbc8c7b9d36673_7
|
department_management
|
List the id of 'Treasury' department.
|
[
"#1 = Scan Table [ department ] Predicate [ Name = 'Treasury' ] Output [ Name , Department_ID ]"
] |
[
"List the id of 'Treasury' department."
] |
[
{
"content": "You are a question decomposition expert. You are given a database schema and a complex database input question in natural language, and your task is to break down the complex database input question into simpler sub-questions in a recursive way, like a tree. In each step you will be given a question to decompose, so that your answer will be the input for the next steps.\n\nInput Question:\nList the states where both the secretary of 'Treasury' department and the secretary of 'Homeland Security' were born.\n\nDatabase Name:\ndepartment_management\n\nDatabase Schema:\nCREATE TABLE department (\n\tDepartment_ID number,\n\tName text,\n\tCreation text,\n\tRanking number,\n\tBudget_in_Billions number,\n\tNum_Employees number,\n\tprimary key ( Department_ID )\n)\n\nCREATE TABLE head (\n\thead_ID number,\n\tname text,\n\tborn_state text,\n\tage number,\n\tprimary key ( head_ID )\n)\n\nCREATE TABLE management (\n\tdepartment_ID number,\n\thead_ID number,\n\ttemporary_acting text,\n\tprimary key ( department_ID , head_ID ),\n\tforeign key ( department_ID ) references department ( Department_ID ),\n\tforeign key ( head_ID ) references head ( head_ID )\n)\n\nValid Operators:\nThe following operators are available for query decomposition:\n- Scan: Direct table access with no sub-questions\n- Filter: Selection based on conditions\n- Aggregate: Group and compute aggregations\n- Sort: Order results\n- Topsort: Sort and limit results\n- Top: Limit results\n- Join: Combine two sub-queries\n- Except: Set difference between two sub-queries\n- Intersect: Set intersection between two sub-queries\n- Union: Set union of two sub-queries\n\nOperator Rules:\n1. Each decomposition MUST specify exactly one operator from the above list\n2. Operator constraints:\n - Scan: Cannot have sub-questions\n - Filter/Aggregate/Sort/Top/Topsort: Can have 1 sub-question\n - Join/Union/Intersect/Except: Must have exactly 2 sub-questions\n\nTask Description:\n1. You will receive a complex database question that needs to be decomposed\n2. For each question, you should:\n - First, determine the appropriate operator from the valid list\n - Then break it down into sub-questions according to the operator's rules\n - Explain how these sub-questions relate to the original question\n - Indicate the order in which these sub-questions should be answered\n\nResponse Format:\nFor each decomposition step, respond with this exact JSON format without any other text:\n{\n \"type\": \"object\",\n \"properties\": {\n \"index\": {\n \"type\": [\n \"integer\",\n \"null\"\n ]\n },\n \"question\": {\n \"type\": \"string\"\n },\n \"operator\": {\n \"type\": [\n \"string\",\n \"null\"\n ],\n \"enum\": [\n \"Scan\",\n \"Filter\",\n \"Aggregate\",\n \"Sort\",\n \"Top\",\n \"Join\",\n \"Union\",\n \"Intersect\",\n \"Except\",\n null\n ]\n },\n \"sub_questions\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#\"\n }\n }\n },\n \"required\": [\n \"index\",\n \"question\",\n \"operator\"\n ]\n}\n\nConversation Flow:\n1. User will provide the initial complex question\n2. You will:\n a. Choose an appropriate operator\n b. Decompose into sub-questions according to operator rules\n3. User will ask you to decompose one of the sub-questions if needed\n4. This process continues until we reach simple, directly answerable questions (Scan operations)\n\nImportant Rules:\n- Each decomposition MUST use exactly one operator from the valid list\n- Operator choice must be justified and appropriate for the question\n- Sub-questions must comply with the operator's requirements\n- Each sub-question should be simpler than the original question\n- Sub-questions should be clear and self-contained\n- Maintain context between decomposition steps\n- Use only tables and columns that exist in the provided schema\n",
"role": "system"
},
{
"content": "decompose the following question: List the id of 'Treasury' department.",
"role": "user"
},
{
"content": "{\"index\":1,\"question\":\"List the id of 'Treasury' department.\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
}
] |
05fa1d5719ed4259ca79420810514335c8c92d1a75f475ba25bbc8c7b9d36673_8
|
department_management
|
List the department ids and their secretary ids.
|
[
"#1 = Scan Table [ management ] Output [ head_ID , department_ID ]"
] |
[
"List the department ids and their secretary ids."
] |
[
{
"content": "You are a question decomposition expert. You are given a database schema and a complex database input question in natural language, and your task is to break down the complex database input question into simpler sub-questions in a recursive way, like a tree. In each step you will be given a question to decompose, so that your answer will be the input for the next steps.\n\nInput Question:\nList the states where both the secretary of 'Treasury' department and the secretary of 'Homeland Security' were born.\n\nDatabase Name:\ndepartment_management\n\nDatabase Schema:\nCREATE TABLE department (\n\tDepartment_ID number,\n\tName text,\n\tCreation text,\n\tRanking number,\n\tBudget_in_Billions number,\n\tNum_Employees number,\n\tprimary key ( Department_ID )\n)\n\nCREATE TABLE head (\n\thead_ID number,\n\tname text,\n\tborn_state text,\n\tage number,\n\tprimary key ( head_ID )\n)\n\nCREATE TABLE management (\n\tdepartment_ID number,\n\thead_ID number,\n\ttemporary_acting text,\n\tprimary key ( department_ID , head_ID ),\n\tforeign key ( department_ID ) references department ( Department_ID ),\n\tforeign key ( head_ID ) references head ( head_ID )\n)\n\nValid Operators:\nThe following operators are available for query decomposition:\n- Scan: Direct table access with no sub-questions\n- Filter: Selection based on conditions\n- Aggregate: Group and compute aggregations\n- Sort: Order results\n- Topsort: Sort and limit results\n- Top: Limit results\n- Join: Combine two sub-queries\n- Except: Set difference between two sub-queries\n- Intersect: Set intersection between two sub-queries\n- Union: Set union of two sub-queries\n\nOperator Rules:\n1. Each decomposition MUST specify exactly one operator from the above list\n2. Operator constraints:\n - Scan: Cannot have sub-questions\n - Filter/Aggregate/Sort/Top/Topsort: Can have 1 sub-question\n - Join/Union/Intersect/Except: Must have exactly 2 sub-questions\n\nTask Description:\n1. You will receive a complex database question that needs to be decomposed\n2. For each question, you should:\n - First, determine the appropriate operator from the valid list\n - Then break it down into sub-questions according to the operator's rules\n - Explain how these sub-questions relate to the original question\n - Indicate the order in which these sub-questions should be answered\n\nResponse Format:\nFor each decomposition step, respond with this exact JSON format without any other text:\n{\n \"type\": \"object\",\n \"properties\": {\n \"index\": {\n \"type\": [\n \"integer\",\n \"null\"\n ]\n },\n \"question\": {\n \"type\": \"string\"\n },\n \"operator\": {\n \"type\": [\n \"string\",\n \"null\"\n ],\n \"enum\": [\n \"Scan\",\n \"Filter\",\n \"Aggregate\",\n \"Sort\",\n \"Top\",\n \"Join\",\n \"Union\",\n \"Intersect\",\n \"Except\",\n null\n ]\n },\n \"sub_questions\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#\"\n }\n }\n },\n \"required\": [\n \"index\",\n \"question\",\n \"operator\"\n ]\n}\n\nConversation Flow:\n1. User will provide the initial complex question\n2. You will:\n a. Choose an appropriate operator\n b. Decompose into sub-questions according to operator rules\n3. User will ask you to decompose one of the sub-questions if needed\n4. This process continues until we reach simple, directly answerable questions (Scan operations)\n\nImportant Rules:\n- Each decomposition MUST use exactly one operator from the valid list\n- Operator choice must be justified and appropriate for the question\n- Sub-questions must comply with the operator's requirements\n- Each sub-question should be simpler than the original question\n- Sub-questions should be clear and self-contained\n- Maintain context between decomposition steps\n- Use only tables and columns that exist in the provided schema\n",
"role": "system"
},
{
"content": "decompose the following question: List the department ids and their secretary ids.",
"role": "user"
},
{
"content": "{\"index\":1,\"question\":\"List the department ids and their secretary ids.\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
}
] |
05fa1d5719ed4259ca79420810514335c8c92d1a75f475ba25bbc8c7b9d36673_9
|
department_management
|
List the id of 'Homeland Security' department.
|
[
"#1 = Scan Table [ department ] Predicate [ Name = 'Homeland Security' ] Output [ Name , Department_ID ]"
] |
[
"List the id of 'Homeland Security' department."
] |
[
{
"content": "You are a question decomposition expert. You are given a database schema and a complex database input question in natural language, and your task is to break down the complex database input question into simpler sub-questions in a recursive way, like a tree. In each step you will be given a question to decompose, so that your answer will be the input for the next steps.\n\nInput Question:\nList the states where both the secretary of 'Treasury' department and the secretary of 'Homeland Security' were born.\n\nDatabase Name:\ndepartment_management\n\nDatabase Schema:\nCREATE TABLE department (\n\tDepartment_ID number,\n\tName text,\n\tCreation text,\n\tRanking number,\n\tBudget_in_Billions number,\n\tNum_Employees number,\n\tprimary key ( Department_ID )\n)\n\nCREATE TABLE head (\n\thead_ID number,\n\tname text,\n\tborn_state text,\n\tage number,\n\tprimary key ( head_ID )\n)\n\nCREATE TABLE management (\n\tdepartment_ID number,\n\thead_ID number,\n\ttemporary_acting text,\n\tprimary key ( department_ID , head_ID ),\n\tforeign key ( department_ID ) references department ( Department_ID ),\n\tforeign key ( head_ID ) references head ( head_ID )\n)\n\nValid Operators:\nThe following operators are available for query decomposition:\n- Scan: Direct table access with no sub-questions\n- Filter: Selection based on conditions\n- Aggregate: Group and compute aggregations\n- Sort: Order results\n- Topsort: Sort and limit results\n- Top: Limit results\n- Join: Combine two sub-queries\n- Except: Set difference between two sub-queries\n- Intersect: Set intersection between two sub-queries\n- Union: Set union of two sub-queries\n\nOperator Rules:\n1. Each decomposition MUST specify exactly one operator from the above list\n2. Operator constraints:\n - Scan: Cannot have sub-questions\n - Filter/Aggregate/Sort/Top/Topsort: Can have 1 sub-question\n - Join/Union/Intersect/Except: Must have exactly 2 sub-questions\n\nTask Description:\n1. You will receive a complex database question that needs to be decomposed\n2. For each question, you should:\n - First, determine the appropriate operator from the valid list\n - Then break it down into sub-questions according to the operator's rules\n - Explain how these sub-questions relate to the original question\n - Indicate the order in which these sub-questions should be answered\n\nResponse Format:\nFor each decomposition step, respond with this exact JSON format without any other text:\n{\n \"type\": \"object\",\n \"properties\": {\n \"index\": {\n \"type\": [\n \"integer\",\n \"null\"\n ]\n },\n \"question\": {\n \"type\": \"string\"\n },\n \"operator\": {\n \"type\": [\n \"string\",\n \"null\"\n ],\n \"enum\": [\n \"Scan\",\n \"Filter\",\n \"Aggregate\",\n \"Sort\",\n \"Top\",\n \"Join\",\n \"Union\",\n \"Intersect\",\n \"Except\",\n null\n ]\n },\n \"sub_questions\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#\"\n }\n }\n },\n \"required\": [\n \"index\",\n \"question\",\n \"operator\"\n ]\n}\n\nConversation Flow:\n1. User will provide the initial complex question\n2. You will:\n a. Choose an appropriate operator\n b. Decompose into sub-questions according to operator rules\n3. User will ask you to decompose one of the sub-questions if needed\n4. This process continues until we reach simple, directly answerable questions (Scan operations)\n\nImportant Rules:\n- Each decomposition MUST use exactly one operator from the valid list\n- Operator choice must be justified and appropriate for the question\n- Sub-questions must comply with the operator's requirements\n- Each sub-question should be simpler than the original question\n- Sub-questions should be clear and self-contained\n- Maintain context between decomposition steps\n- Use only tables and columns that exist in the provided schema\n",
"role": "system"
},
{
"content": "decompose the following question: List the id of 'Homeland Security' department.",
"role": "user"
},
{
"content": "{\"index\":1,\"question\":\"List the id of 'Homeland Security' department.\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
}
] |
05fa1d5719ed4259ca79420810514335c8c92d1a75f475ba25bbc8c7b9d36673_10
|
department_management
|
List the department ids and their secretary ids.
|
[
"#1 = Scan Table [ management ] Output [ head_ID , department_ID ]"
] |
[
"List the department ids and their secretary ids."
] |
[
{
"content": "You are a question decomposition expert. You are given a database schema and a complex database input question in natural language, and your task is to break down the complex database input question into simpler sub-questions in a recursive way, like a tree. In each step you will be given a question to decompose, so that your answer will be the input for the next steps.\n\nInput Question:\nList the states where both the secretary of 'Treasury' department and the secretary of 'Homeland Security' were born.\n\nDatabase Name:\ndepartment_management\n\nDatabase Schema:\nCREATE TABLE department (\n\tDepartment_ID number,\n\tName text,\n\tCreation text,\n\tRanking number,\n\tBudget_in_Billions number,\n\tNum_Employees number,\n\tprimary key ( Department_ID )\n)\n\nCREATE TABLE head (\n\thead_ID number,\n\tname text,\n\tborn_state text,\n\tage number,\n\tprimary key ( head_ID )\n)\n\nCREATE TABLE management (\n\tdepartment_ID number,\n\thead_ID number,\n\ttemporary_acting text,\n\tprimary key ( department_ID , head_ID ),\n\tforeign key ( department_ID ) references department ( Department_ID ),\n\tforeign key ( head_ID ) references head ( head_ID )\n)\n\nValid Operators:\nThe following operators are available for query decomposition:\n- Scan: Direct table access with no sub-questions\n- Filter: Selection based on conditions\n- Aggregate: Group and compute aggregations\n- Sort: Order results\n- Topsort: Sort and limit results\n- Top: Limit results\n- Join: Combine two sub-queries\n- Except: Set difference between two sub-queries\n- Intersect: Set intersection between two sub-queries\n- Union: Set union of two sub-queries\n\nOperator Rules:\n1. Each decomposition MUST specify exactly one operator from the above list\n2. Operator constraints:\n - Scan: Cannot have sub-questions\n - Filter/Aggregate/Sort/Top/Topsort: Can have 1 sub-question\n - Join/Union/Intersect/Except: Must have exactly 2 sub-questions\n\nTask Description:\n1. You will receive a complex database question that needs to be decomposed\n2. For each question, you should:\n - First, determine the appropriate operator from the valid list\n - Then break it down into sub-questions according to the operator's rules\n - Explain how these sub-questions relate to the original question\n - Indicate the order in which these sub-questions should be answered\n\nResponse Format:\nFor each decomposition step, respond with this exact JSON format without any other text:\n{\n \"type\": \"object\",\n \"properties\": {\n \"index\": {\n \"type\": [\n \"integer\",\n \"null\"\n ]\n },\n \"question\": {\n \"type\": \"string\"\n },\n \"operator\": {\n \"type\": [\n \"string\",\n \"null\"\n ],\n \"enum\": [\n \"Scan\",\n \"Filter\",\n \"Aggregate\",\n \"Sort\",\n \"Top\",\n \"Join\",\n \"Union\",\n \"Intersect\",\n \"Except\",\n null\n ]\n },\n \"sub_questions\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#\"\n }\n }\n },\n \"required\": [\n \"index\",\n \"question\",\n \"operator\"\n ]\n}\n\nConversation Flow:\n1. User will provide the initial complex question\n2. You will:\n a. Choose an appropriate operator\n b. Decompose into sub-questions according to operator rules\n3. User will ask you to decompose one of the sub-questions if needed\n4. This process continues until we reach simple, directly answerable questions (Scan operations)\n\nImportant Rules:\n- Each decomposition MUST use exactly one operator from the valid list\n- Operator choice must be justified and appropriate for the question\n- Sub-questions must comply with the operator's requirements\n- Each sub-question should be simpler than the original question\n- Sub-questions should be clear and self-contained\n- Maintain context between decomposition steps\n- Use only tables and columns that exist in the provided schema\n",
"role": "system"
},
{
"content": "decompose the following question: List the department ids and their secretary ids.",
"role": "user"
},
{
"content": "{\"index\":1,\"question\":\"List the department ids and their secretary ids.\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
}
] |
8e18920291df2091510d1e6b8b5f5cc811f673c1d3aee970da4d23535b452dd0_0
|
department_management
|
Which head's name has the substring 'Ha'? List the id and name.
|
[
"#1 = Scan Table [ head ] Predicate [ name like '%Ha%' ] Output [ name , head_ID ]"
] |
[
"Which head's name has the substring 'Ha'? List the id and name."
] |
[
{
"content": "You are a question decomposition expert. You are given a database schema and a complex database input question in natural language, and your task is to break down the complex database input question into simpler sub-questions in a recursive way, like a tree. In each step you will be given a question to decompose, so that your answer will be the input for the next steps.\n\nInput Question:\nWhich head's name has the substring 'Ha'? List the id and name.\n\nDatabase Name:\ndepartment_management\n\nDatabase Schema:\nCREATE TABLE department (\n\tDepartment_ID number,\n\tName text,\n\tCreation text,\n\tRanking number,\n\tBudget_in_Billions number,\n\tNum_Employees number,\n\tprimary key ( Department_ID )\n)\n\nCREATE TABLE head (\n\thead_ID number,\n\tname text,\n\tborn_state text,\n\tage number,\n\tprimary key ( head_ID )\n)\n\nCREATE TABLE management (\n\tdepartment_ID number,\n\thead_ID number,\n\ttemporary_acting text,\n\tprimary key ( department_ID , head_ID ),\n\tforeign key ( department_ID ) references department ( Department_ID ),\n\tforeign key ( head_ID ) references head ( head_ID )\n)\n\nValid Operators:\nThe following operators are available for query decomposition:\n- Scan: Direct table access with no sub-questions\n- Filter: Selection based on conditions\n- Aggregate: Group and compute aggregations\n- Sort: Order results\n- Topsort: Sort and limit results\n- Top: Limit results\n- Join: Combine two sub-queries\n- Except: Set difference between two sub-queries\n- Intersect: Set intersection between two sub-queries\n- Union: Set union of two sub-queries\n\nOperator Rules:\n1. Each decomposition MUST specify exactly one operator from the above list\n2. Operator constraints:\n - Scan: Cannot have sub-questions\n - Filter/Aggregate/Sort/Top/Topsort: Can have 1 sub-question\n - Join/Union/Intersect/Except: Must have exactly 2 sub-questions\n\nTask Description:\n1. You will receive a complex database question that needs to be decomposed\n2. For each question, you should:\n - First, determine the appropriate operator from the valid list\n - Then break it down into sub-questions according to the operator's rules\n - Explain how these sub-questions relate to the original question\n - Indicate the order in which these sub-questions should be answered\n\nResponse Format:\nFor each decomposition step, respond with this exact JSON format without any other text:\n{\n \"type\": \"object\",\n \"properties\": {\n \"index\": {\n \"type\": [\n \"integer\",\n \"null\"\n ]\n },\n \"question\": {\n \"type\": \"string\"\n },\n \"operator\": {\n \"type\": [\n \"string\",\n \"null\"\n ],\n \"enum\": [\n \"Scan\",\n \"Filter\",\n \"Aggregate\",\n \"Sort\",\n \"Top\",\n \"Join\",\n \"Union\",\n \"Intersect\",\n \"Except\",\n null\n ]\n },\n \"sub_questions\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#\"\n }\n }\n },\n \"required\": [\n \"index\",\n \"question\",\n \"operator\"\n ]\n}\n\nConversation Flow:\n1. User will provide the initial complex question\n2. You will:\n a. Choose an appropriate operator\n b. Decompose into sub-questions according to operator rules\n3. User will ask you to decompose one of the sub-questions if needed\n4. This process continues until we reach simple, directly answerable questions (Scan operations)\n\nImportant Rules:\n- Each decomposition MUST use exactly one operator from the valid list\n- Operator choice must be justified and appropriate for the question\n- Sub-questions must comply with the operator's requirements\n- Each sub-question should be simpler than the original question\n- Sub-questions should be clear and self-contained\n- Maintain context between decomposition steps\n- Use only tables and columns that exist in the provided schema\n",
"role": "system"
},
{
"content": "decompose the following question: Which head's name has the substring 'Ha'? List the id and name.",
"role": "user"
},
{
"content": "{\"index\":1,\"question\":\"Which head's name has the substring 'Ha'? List the id and name.\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
}
] |
556c655f2737c1a29f0bba860349464a8eb70888488492fdaac7491258f059e5_0
|
farm
|
How many farms are there?
|
[
"#1 = Scan Table [ farm ] Output [ 1 AS One ]",
"#2 = Aggregate [ #1 ] Output [ countstar AS Count_Star ]"
] |
[
"List 1 for each farm.",
"How many farms are there?"
] |
[
{
"content": "You are a question decomposition expert. You are given a database schema and a complex database input question in natural language, and your task is to break down the complex database input question into simpler sub-questions in a recursive way, like a tree. In each step you will be given a question to decompose, so that your answer will be the input for the next steps.\n\nInput Question:\nHow many farms are there?\n\nDatabase Name:\nfarm\n\nDatabase Schema:\nCREATE TABLE city (\n\tCity_ID number,\n\tOfficial_Name text,\n\tStatus text,\n\tArea_km_2 number,\n\tPopulation number,\n\tCensus_Ranking text,\n\tprimary key ( City_ID )\n)\n\nCREATE TABLE farm (\n\tFarm_ID number,\n\tYear number,\n\tTotal_Horses number,\n\tWorking_Horses number,\n\tTotal_Cattle number,\n\tOxen number,\n\tBulls number,\n\tCows number,\n\tPigs number,\n\tSheep_and_Goats number,\n\tprimary key ( Farm_ID )\n)\n\nCREATE TABLE farm_competition (\n\tCompetition_ID number,\n\tYear number,\n\tTheme text,\n\tHost_city_ID number,\n\tHosts text,\n\tprimary key ( Competition_ID ),\n\tforeign key ( Host_city_ID ) references city ( City_ID )\n)\n\nCREATE TABLE competition_record (\n\tCompetition_ID number,\n\tFarm_ID number,\n\tRank number,\n\tprimary key ( Competition_ID , Farm_ID ),\n\tforeign key ( Farm_ID ) references farm ( Farm_ID ),\n\tforeign key ( Competition_ID ) references farm_competition ( Competition_ID )\n)\n\nValid Operators:\nThe following operators are available for query decomposition:\n- Scan: Direct table access with no sub-questions\n- Filter: Selection based on conditions\n- Aggregate: Group and compute aggregations\n- Sort: Order results\n- Topsort: Sort and limit results\n- Top: Limit results\n- Join: Combine two sub-queries\n- Except: Set difference between two sub-queries\n- Intersect: Set intersection between two sub-queries\n- Union: Set union of two sub-queries\n\nOperator Rules:\n1. Each decomposition MUST specify exactly one operator from the above list\n2. Operator constraints:\n - Scan: Cannot have sub-questions\n - Filter/Aggregate/Sort/Top/Topsort: Can have 1 sub-question\n - Join/Union/Intersect/Except: Must have exactly 2 sub-questions\n\nTask Description:\n1. You will receive a complex database question that needs to be decomposed\n2. For each question, you should:\n - First, determine the appropriate operator from the valid list\n - Then break it down into sub-questions according to the operator's rules\n - Explain how these sub-questions relate to the original question\n - Indicate the order in which these sub-questions should be answered\n\nResponse Format:\nFor each decomposition step, respond with this exact JSON format without any other text:\n{\n \"type\": \"object\",\n \"properties\": {\n \"index\": {\n \"type\": [\n \"integer\",\n \"null\"\n ]\n },\n \"question\": {\n \"type\": \"string\"\n },\n \"operator\": {\n \"type\": [\n \"string\",\n \"null\"\n ],\n \"enum\": [\n \"Scan\",\n \"Filter\",\n \"Aggregate\",\n \"Sort\",\n \"Top\",\n \"Join\",\n \"Union\",\n \"Intersect\",\n \"Except\",\n null\n ]\n },\n \"sub_questions\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#\"\n }\n }\n },\n \"required\": [\n \"index\",\n \"question\",\n \"operator\"\n ]\n}\n\nConversation Flow:\n1. User will provide the initial complex question\n2. You will:\n a. Choose an appropriate operator\n b. Decompose into sub-questions according to operator rules\n3. User will ask you to decompose one of the sub-questions if needed\n4. This process continues until we reach simple, directly answerable questions (Scan operations)\n\nImportant Rules:\n- Each decomposition MUST use exactly one operator from the valid list\n- Operator choice must be justified and appropriate for the question\n- Sub-questions must comply with the operator's requirements\n- Each sub-question should be simpler than the original question\n- Sub-questions should be clear and self-contained\n- Maintain context between decomposition steps\n- Use only tables and columns that exist in the provided schema\n",
"role": "system"
},
{
"content": "decompose the following question: How many farms are there?",
"role": "user"
},
{
"content": "{\"index\":1,\"question\":\"How many farms are there?\",\"operator\":\"Aggregate\",\"sub_questions\":[{\"index\":2,\"question\":\"List 1 for each farm.\",\"operator\":null,\"sub_questions\":[]}]}",
"role": "assistant"
},
{
"content": "given the decomposition: {\"index\":1,\"question\":\"How many farms are there?\",\"operator\":\"Aggregate\",\"sub_questions\":[{\"index\":2,\"question\":\"List 1 for each farm.\",\"operator\":null,\"sub_questions\":[]}]}\ndecompose the following question with index 2: List 1 for each farm.",
"role": "user"
},
{
"content": "{\"index\":2,\"question\":\"List 1 for each farm.\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
}
] |
556c655f2737c1a29f0bba860349464a8eb70888488492fdaac7491258f059e5_1
|
farm
|
List 1 for each farm.
|
[
"#1 = Scan Table [ farm ] Output [ 1 AS One ]"
] |
[
"List 1 for each farm."
] |
[
{
"content": "You are a question decomposition expert. You are given a database schema and a complex database input question in natural language, and your task is to break down the complex database input question into simpler sub-questions in a recursive way, like a tree. In each step you will be given a question to decompose, so that your answer will be the input for the next steps.\n\nInput Question:\nHow many farms are there?\n\nDatabase Name:\nfarm\n\nDatabase Schema:\nCREATE TABLE city (\n\tCity_ID number,\n\tOfficial_Name text,\n\tStatus text,\n\tArea_km_2 number,\n\tPopulation number,\n\tCensus_Ranking text,\n\tprimary key ( City_ID )\n)\n\nCREATE TABLE farm (\n\tFarm_ID number,\n\tYear number,\n\tTotal_Horses number,\n\tWorking_Horses number,\n\tTotal_Cattle number,\n\tOxen number,\n\tBulls number,\n\tCows number,\n\tPigs number,\n\tSheep_and_Goats number,\n\tprimary key ( Farm_ID )\n)\n\nCREATE TABLE farm_competition (\n\tCompetition_ID number,\n\tYear number,\n\tTheme text,\n\tHost_city_ID number,\n\tHosts text,\n\tprimary key ( Competition_ID ),\n\tforeign key ( Host_city_ID ) references city ( City_ID )\n)\n\nCREATE TABLE competition_record (\n\tCompetition_ID number,\n\tFarm_ID number,\n\tRank number,\n\tprimary key ( Competition_ID , Farm_ID ),\n\tforeign key ( Farm_ID ) references farm ( Farm_ID ),\n\tforeign key ( Competition_ID ) references farm_competition ( Competition_ID )\n)\n\nValid Operators:\nThe following operators are available for query decomposition:\n- Scan: Direct table access with no sub-questions\n- Filter: Selection based on conditions\n- Aggregate: Group and compute aggregations\n- Sort: Order results\n- Topsort: Sort and limit results\n- Top: Limit results\n- Join: Combine two sub-queries\n- Except: Set difference between two sub-queries\n- Intersect: Set intersection between two sub-queries\n- Union: Set union of two sub-queries\n\nOperator Rules:\n1. Each decomposition MUST specify exactly one operator from the above list\n2. Operator constraints:\n - Scan: Cannot have sub-questions\n - Filter/Aggregate/Sort/Top/Topsort: Can have 1 sub-question\n - Join/Union/Intersect/Except: Must have exactly 2 sub-questions\n\nTask Description:\n1. You will receive a complex database question that needs to be decomposed\n2. For each question, you should:\n - First, determine the appropriate operator from the valid list\n - Then break it down into sub-questions according to the operator's rules\n - Explain how these sub-questions relate to the original question\n - Indicate the order in which these sub-questions should be answered\n\nResponse Format:\nFor each decomposition step, respond with this exact JSON format without any other text:\n{\n \"type\": \"object\",\n \"properties\": {\n \"index\": {\n \"type\": [\n \"integer\",\n \"null\"\n ]\n },\n \"question\": {\n \"type\": \"string\"\n },\n \"operator\": {\n \"type\": [\n \"string\",\n \"null\"\n ],\n \"enum\": [\n \"Scan\",\n \"Filter\",\n \"Aggregate\",\n \"Sort\",\n \"Top\",\n \"Join\",\n \"Union\",\n \"Intersect\",\n \"Except\",\n null\n ]\n },\n \"sub_questions\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#\"\n }\n }\n },\n \"required\": [\n \"index\",\n \"question\",\n \"operator\"\n ]\n}\n\nConversation Flow:\n1. User will provide the initial complex question\n2. You will:\n a. Choose an appropriate operator\n b. Decompose into sub-questions according to operator rules\n3. User will ask you to decompose one of the sub-questions if needed\n4. This process continues until we reach simple, directly answerable questions (Scan operations)\n\nImportant Rules:\n- Each decomposition MUST use exactly one operator from the valid list\n- Operator choice must be justified and appropriate for the question\n- Sub-questions must comply with the operator's requirements\n- Each sub-question should be simpler than the original question\n- Sub-questions should be clear and self-contained\n- Maintain context between decomposition steps\n- Use only tables and columns that exist in the provided schema\n",
"role": "system"
},
{
"content": "decompose the following question: List 1 for each farm.",
"role": "user"
},
{
"content": "{\"index\":1,\"question\":\"List 1 for each farm.\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
}
] |
a7ab9c2cf6f8768915a14f47c4c677b0568c4329652a12f3130f49696bfeed71_0
|
farm
|
How many farms are there?
|
[
"#1 = Scan Table [ farm ] Output [ 1 AS One ]",
"#2 = Aggregate [ #1 ] Output [ countstar AS Count_Star ]"
] |
[
"List 1 for each farm.",
"How many farms are there?"
] |
[
{
"content": "You are a question decomposition expert. You are given a database schema and a complex database input question in natural language, and your task is to break down the complex database input question into simpler sub-questions in a recursive way, like a tree. In each step you will be given a question to decompose, so that your answer will be the input for the next steps.\n\nInput Question:\nCount the number of farms.\n\nDatabase Name:\nfarm\n\nDatabase Schema:\nCREATE TABLE city (\n\tCity_ID number,\n\tOfficial_Name text,\n\tStatus text,\n\tArea_km_2 number,\n\tPopulation number,\n\tCensus_Ranking text,\n\tprimary key ( City_ID )\n)\n\nCREATE TABLE farm (\n\tFarm_ID number,\n\tYear number,\n\tTotal_Horses number,\n\tWorking_Horses number,\n\tTotal_Cattle number,\n\tOxen number,\n\tBulls number,\n\tCows number,\n\tPigs number,\n\tSheep_and_Goats number,\n\tprimary key ( Farm_ID )\n)\n\nCREATE TABLE farm_competition (\n\tCompetition_ID number,\n\tYear number,\n\tTheme text,\n\tHost_city_ID number,\n\tHosts text,\n\tprimary key ( Competition_ID ),\n\tforeign key ( Host_city_ID ) references city ( City_ID )\n)\n\nCREATE TABLE competition_record (\n\tCompetition_ID number,\n\tFarm_ID number,\n\tRank number,\n\tprimary key ( Competition_ID , Farm_ID ),\n\tforeign key ( Farm_ID ) references farm ( Farm_ID ),\n\tforeign key ( Competition_ID ) references farm_competition ( Competition_ID )\n)\n\nValid Operators:\nThe following operators are available for query decomposition:\n- Scan: Direct table access with no sub-questions\n- Filter: Selection based on conditions\n- Aggregate: Group and compute aggregations\n- Sort: Order results\n- Topsort: Sort and limit results\n- Top: Limit results\n- Join: Combine two sub-queries\n- Except: Set difference between two sub-queries\n- Intersect: Set intersection between two sub-queries\n- Union: Set union of two sub-queries\n\nOperator Rules:\n1. Each decomposition MUST specify exactly one operator from the above list\n2. Operator constraints:\n - Scan: Cannot have sub-questions\n - Filter/Aggregate/Sort/Top/Topsort: Can have 1 sub-question\n - Join/Union/Intersect/Except: Must have exactly 2 sub-questions\n\nTask Description:\n1. You will receive a complex database question that needs to be decomposed\n2. For each question, you should:\n - First, determine the appropriate operator from the valid list\n - Then break it down into sub-questions according to the operator's rules\n - Explain how these sub-questions relate to the original question\n - Indicate the order in which these sub-questions should be answered\n\nResponse Format:\nFor each decomposition step, respond with this exact JSON format without any other text:\n{\n \"type\": \"object\",\n \"properties\": {\n \"index\": {\n \"type\": [\n \"integer\",\n \"null\"\n ]\n },\n \"question\": {\n \"type\": \"string\"\n },\n \"operator\": {\n \"type\": [\n \"string\",\n \"null\"\n ],\n \"enum\": [\n \"Scan\",\n \"Filter\",\n \"Aggregate\",\n \"Sort\",\n \"Top\",\n \"Join\",\n \"Union\",\n \"Intersect\",\n \"Except\",\n null\n ]\n },\n \"sub_questions\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#\"\n }\n }\n },\n \"required\": [\n \"index\",\n \"question\",\n \"operator\"\n ]\n}\n\nConversation Flow:\n1. User will provide the initial complex question\n2. You will:\n a. Choose an appropriate operator\n b. Decompose into sub-questions according to operator rules\n3. User will ask you to decompose one of the sub-questions if needed\n4. This process continues until we reach simple, directly answerable questions (Scan operations)\n\nImportant Rules:\n- Each decomposition MUST use exactly one operator from the valid list\n- Operator choice must be justified and appropriate for the question\n- Sub-questions must comply with the operator's requirements\n- Each sub-question should be simpler than the original question\n- Sub-questions should be clear and self-contained\n- Maintain context between decomposition steps\n- Use only tables and columns that exist in the provided schema\n",
"role": "system"
},
{
"content": "decompose the following question: How many farms are there?",
"role": "user"
},
{
"content": "{\"index\":1,\"question\":\"How many farms are there?\",\"operator\":\"Aggregate\",\"sub_questions\":[{\"index\":2,\"question\":\"List 1 for each farm.\",\"operator\":null,\"sub_questions\":[]}]}",
"role": "assistant"
},
{
"content": "given the decomposition: {\"index\":1,\"question\":\"How many farms are there?\",\"operator\":\"Aggregate\",\"sub_questions\":[{\"index\":2,\"question\":\"List 1 for each farm.\",\"operator\":null,\"sub_questions\":[]}]}\ndecompose the following question with index 2: List 1 for each farm.",
"role": "user"
},
{
"content": "{\"index\":2,\"question\":\"List 1 for each farm.\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
}
] |
a7ab9c2cf6f8768915a14f47c4c677b0568c4329652a12f3130f49696bfeed71_1
|
farm
|
List 1 for each farm.
|
[
"#1 = Scan Table [ farm ] Output [ 1 AS One ]"
] |
[
"List 1 for each farm."
] |
[
{
"content": "You are a question decomposition expert. You are given a database schema and a complex database input question in natural language, and your task is to break down the complex database input question into simpler sub-questions in a recursive way, like a tree. In each step you will be given a question to decompose, so that your answer will be the input for the next steps.\n\nInput Question:\nCount the number of farms.\n\nDatabase Name:\nfarm\n\nDatabase Schema:\nCREATE TABLE city (\n\tCity_ID number,\n\tOfficial_Name text,\n\tStatus text,\n\tArea_km_2 number,\n\tPopulation number,\n\tCensus_Ranking text,\n\tprimary key ( City_ID )\n)\n\nCREATE TABLE farm (\n\tFarm_ID number,\n\tYear number,\n\tTotal_Horses number,\n\tWorking_Horses number,\n\tTotal_Cattle number,\n\tOxen number,\n\tBulls number,\n\tCows number,\n\tPigs number,\n\tSheep_and_Goats number,\n\tprimary key ( Farm_ID )\n)\n\nCREATE TABLE farm_competition (\n\tCompetition_ID number,\n\tYear number,\n\tTheme text,\n\tHost_city_ID number,\n\tHosts text,\n\tprimary key ( Competition_ID ),\n\tforeign key ( Host_city_ID ) references city ( City_ID )\n)\n\nCREATE TABLE competition_record (\n\tCompetition_ID number,\n\tFarm_ID number,\n\tRank number,\n\tprimary key ( Competition_ID , Farm_ID ),\n\tforeign key ( Farm_ID ) references farm ( Farm_ID ),\n\tforeign key ( Competition_ID ) references farm_competition ( Competition_ID )\n)\n\nValid Operators:\nThe following operators are available for query decomposition:\n- Scan: Direct table access with no sub-questions\n- Filter: Selection based on conditions\n- Aggregate: Group and compute aggregations\n- Sort: Order results\n- Topsort: Sort and limit results\n- Top: Limit results\n- Join: Combine two sub-queries\n- Except: Set difference between two sub-queries\n- Intersect: Set intersection between two sub-queries\n- Union: Set union of two sub-queries\n\nOperator Rules:\n1. Each decomposition MUST specify exactly one operator from the above list\n2. Operator constraints:\n - Scan: Cannot have sub-questions\n - Filter/Aggregate/Sort/Top/Topsort: Can have 1 sub-question\n - Join/Union/Intersect/Except: Must have exactly 2 sub-questions\n\nTask Description:\n1. You will receive a complex database question that needs to be decomposed\n2. For each question, you should:\n - First, determine the appropriate operator from the valid list\n - Then break it down into sub-questions according to the operator's rules\n - Explain how these sub-questions relate to the original question\n - Indicate the order in which these sub-questions should be answered\n\nResponse Format:\nFor each decomposition step, respond with this exact JSON format without any other text:\n{\n \"type\": \"object\",\n \"properties\": {\n \"index\": {\n \"type\": [\n \"integer\",\n \"null\"\n ]\n },\n \"question\": {\n \"type\": \"string\"\n },\n \"operator\": {\n \"type\": [\n \"string\",\n \"null\"\n ],\n \"enum\": [\n \"Scan\",\n \"Filter\",\n \"Aggregate\",\n \"Sort\",\n \"Top\",\n \"Join\",\n \"Union\",\n \"Intersect\",\n \"Except\",\n null\n ]\n },\n \"sub_questions\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#\"\n }\n }\n },\n \"required\": [\n \"index\",\n \"question\",\n \"operator\"\n ]\n}\n\nConversation Flow:\n1. User will provide the initial complex question\n2. You will:\n a. Choose an appropriate operator\n b. Decompose into sub-questions according to operator rules\n3. User will ask you to decompose one of the sub-questions if needed\n4. This process continues until we reach simple, directly answerable questions (Scan operations)\n\nImportant Rules:\n- Each decomposition MUST use exactly one operator from the valid list\n- Operator choice must be justified and appropriate for the question\n- Sub-questions must comply with the operator's requirements\n- Each sub-question should be simpler than the original question\n- Sub-questions should be clear and self-contained\n- Maintain context between decomposition steps\n- Use only tables and columns that exist in the provided schema\n",
"role": "system"
},
{
"content": "decompose the following question: List 1 for each farm.",
"role": "user"
},
{
"content": "{\"index\":1,\"question\":\"List 1 for each farm.\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
}
] |
c43419466758786be8086a3a83c28e3a6e9c67af4e04b843bba7e8f807af0cc8_0
|
farm
|
List the total number of horses on farms in ascending order.
|
[
"#1 = Scan Table [ farm ] Output [ Total_Horses ]",
"#2 = Sort [ #1 ] OrderBy [ Total_Horses ASC ] Output [ Total_Horses ]"
] |
[
"List the total number of horses of all farms.",
"List the total number of horses on farms in ascending order."
] |
[
{
"content": "You are a question decomposition expert. You are given a database schema and a complex database input question in natural language, and your task is to break down the complex database input question into simpler sub-questions in a recursive way, like a tree. In each step you will be given a question to decompose, so that your answer will be the input for the next steps.\n\nInput Question:\nList the total number of horses on farms in ascending order.\n\nDatabase Name:\nfarm\n\nDatabase Schema:\nCREATE TABLE city (\n\tCity_ID number,\n\tOfficial_Name text,\n\tStatus text,\n\tArea_km_2 number,\n\tPopulation number,\n\tCensus_Ranking text,\n\tprimary key ( City_ID )\n)\n\nCREATE TABLE farm (\n\tFarm_ID number,\n\tYear number,\n\tTotal_Horses number,\n\tWorking_Horses number,\n\tTotal_Cattle number,\n\tOxen number,\n\tBulls number,\n\tCows number,\n\tPigs number,\n\tSheep_and_Goats number,\n\tprimary key ( Farm_ID )\n)\n\nCREATE TABLE farm_competition (\n\tCompetition_ID number,\n\tYear number,\n\tTheme text,\n\tHost_city_ID number,\n\tHosts text,\n\tprimary key ( Competition_ID ),\n\tforeign key ( Host_city_ID ) references city ( City_ID )\n)\n\nCREATE TABLE competition_record (\n\tCompetition_ID number,\n\tFarm_ID number,\n\tRank number,\n\tprimary key ( Competition_ID , Farm_ID ),\n\tforeign key ( Farm_ID ) references farm ( Farm_ID ),\n\tforeign key ( Competition_ID ) references farm_competition ( Competition_ID )\n)\n\nValid Operators:\nThe following operators are available for query decomposition:\n- Scan: Direct table access with no sub-questions\n- Filter: Selection based on conditions\n- Aggregate: Group and compute aggregations\n- Sort: Order results\n- Topsort: Sort and limit results\n- Top: Limit results\n- Join: Combine two sub-queries\n- Except: Set difference between two sub-queries\n- Intersect: Set intersection between two sub-queries\n- Union: Set union of two sub-queries\n\nOperator Rules:\n1. Each decomposition MUST specify exactly one operator from the above list\n2. Operator constraints:\n - Scan: Cannot have sub-questions\n - Filter/Aggregate/Sort/Top/Topsort: Can have 1 sub-question\n - Join/Union/Intersect/Except: Must have exactly 2 sub-questions\n\nTask Description:\n1. You will receive a complex database question that needs to be decomposed\n2. For each question, you should:\n - First, determine the appropriate operator from the valid list\n - Then break it down into sub-questions according to the operator's rules\n - Explain how these sub-questions relate to the original question\n - Indicate the order in which these sub-questions should be answered\n\nResponse Format:\nFor each decomposition step, respond with this exact JSON format without any other text:\n{\n \"type\": \"object\",\n \"properties\": {\n \"index\": {\n \"type\": [\n \"integer\",\n \"null\"\n ]\n },\n \"question\": {\n \"type\": \"string\"\n },\n \"operator\": {\n \"type\": [\n \"string\",\n \"null\"\n ],\n \"enum\": [\n \"Scan\",\n \"Filter\",\n \"Aggregate\",\n \"Sort\",\n \"Top\",\n \"Join\",\n \"Union\",\n \"Intersect\",\n \"Except\",\n null\n ]\n },\n \"sub_questions\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#\"\n }\n }\n },\n \"required\": [\n \"index\",\n \"question\",\n \"operator\"\n ]\n}\n\nConversation Flow:\n1. User will provide the initial complex question\n2. You will:\n a. Choose an appropriate operator\n b. Decompose into sub-questions according to operator rules\n3. User will ask you to decompose one of the sub-questions if needed\n4. This process continues until we reach simple, directly answerable questions (Scan operations)\n\nImportant Rules:\n- Each decomposition MUST use exactly one operator from the valid list\n- Operator choice must be justified and appropriate for the question\n- Sub-questions must comply with the operator's requirements\n- Each sub-question should be simpler than the original question\n- Sub-questions should be clear and self-contained\n- Maintain context between decomposition steps\n- Use only tables and columns that exist in the provided schema\n",
"role": "system"
},
{
"content": "decompose the following question: List the total number of horses on farms in ascending order.",
"role": "user"
},
{
"content": "{\"index\":1,\"question\":\"List the total number of horses on farms in ascending order.\",\"operator\":\"Sort\",\"sub_questions\":[{\"index\":2,\"question\":\"List the total number of horses of all farms.\",\"operator\":null,\"sub_questions\":[]}]}",
"role": "assistant"
},
{
"content": "given the decomposition: {\"index\":1,\"question\":\"List the total number of horses on farms in ascending order.\",\"operator\":\"Sort\",\"sub_questions\":[{\"index\":2,\"question\":\"List the total number of horses of all farms.\",\"operator\":null,\"sub_questions\":[]}]}\ndecompose the following question with index 2: List the total number of horses of all farms.",
"role": "user"
},
{
"content": "{\"index\":2,\"question\":\"List the total number of horses of all farms.\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
}
] |
c43419466758786be8086a3a83c28e3a6e9c67af4e04b843bba7e8f807af0cc8_1
|
farm
|
List the total number of horses of all farms.
|
[
"#1 = Scan Table [ farm ] Output [ Total_Horses ]"
] |
[
"List the total number of horses of all farms."
] |
[
{
"content": "You are a question decomposition expert. You are given a database schema and a complex database input question in natural language, and your task is to break down the complex database input question into simpler sub-questions in a recursive way, like a tree. In each step you will be given a question to decompose, so that your answer will be the input for the next steps.\n\nInput Question:\nList the total number of horses on farms in ascending order.\n\nDatabase Name:\nfarm\n\nDatabase Schema:\nCREATE TABLE city (\n\tCity_ID number,\n\tOfficial_Name text,\n\tStatus text,\n\tArea_km_2 number,\n\tPopulation number,\n\tCensus_Ranking text,\n\tprimary key ( City_ID )\n)\n\nCREATE TABLE farm (\n\tFarm_ID number,\n\tYear number,\n\tTotal_Horses number,\n\tWorking_Horses number,\n\tTotal_Cattle number,\n\tOxen number,\n\tBulls number,\n\tCows number,\n\tPigs number,\n\tSheep_and_Goats number,\n\tprimary key ( Farm_ID )\n)\n\nCREATE TABLE farm_competition (\n\tCompetition_ID number,\n\tYear number,\n\tTheme text,\n\tHost_city_ID number,\n\tHosts text,\n\tprimary key ( Competition_ID ),\n\tforeign key ( Host_city_ID ) references city ( City_ID )\n)\n\nCREATE TABLE competition_record (\n\tCompetition_ID number,\n\tFarm_ID number,\n\tRank number,\n\tprimary key ( Competition_ID , Farm_ID ),\n\tforeign key ( Farm_ID ) references farm ( Farm_ID ),\n\tforeign key ( Competition_ID ) references farm_competition ( Competition_ID )\n)\n\nValid Operators:\nThe following operators are available for query decomposition:\n- Scan: Direct table access with no sub-questions\n- Filter: Selection based on conditions\n- Aggregate: Group and compute aggregations\n- Sort: Order results\n- Topsort: Sort and limit results\n- Top: Limit results\n- Join: Combine two sub-queries\n- Except: Set difference between two sub-queries\n- Intersect: Set intersection between two sub-queries\n- Union: Set union of two sub-queries\n\nOperator Rules:\n1. Each decomposition MUST specify exactly one operator from the above list\n2. Operator constraints:\n - Scan: Cannot have sub-questions\n - Filter/Aggregate/Sort/Top/Topsort: Can have 1 sub-question\n - Join/Union/Intersect/Except: Must have exactly 2 sub-questions\n\nTask Description:\n1. You will receive a complex database question that needs to be decomposed\n2. For each question, you should:\n - First, determine the appropriate operator from the valid list\n - Then break it down into sub-questions according to the operator's rules\n - Explain how these sub-questions relate to the original question\n - Indicate the order in which these sub-questions should be answered\n\nResponse Format:\nFor each decomposition step, respond with this exact JSON format without any other text:\n{\n \"type\": \"object\",\n \"properties\": {\n \"index\": {\n \"type\": [\n \"integer\",\n \"null\"\n ]\n },\n \"question\": {\n \"type\": \"string\"\n },\n \"operator\": {\n \"type\": [\n \"string\",\n \"null\"\n ],\n \"enum\": [\n \"Scan\",\n \"Filter\",\n \"Aggregate\",\n \"Sort\",\n \"Top\",\n \"Join\",\n \"Union\",\n \"Intersect\",\n \"Except\",\n null\n ]\n },\n \"sub_questions\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#\"\n }\n }\n },\n \"required\": [\n \"index\",\n \"question\",\n \"operator\"\n ]\n}\n\nConversation Flow:\n1. User will provide the initial complex question\n2. You will:\n a. Choose an appropriate operator\n b. Decompose into sub-questions according to operator rules\n3. User will ask you to decompose one of the sub-questions if needed\n4. This process continues until we reach simple, directly answerable questions (Scan operations)\n\nImportant Rules:\n- Each decomposition MUST use exactly one operator from the valid list\n- Operator choice must be justified and appropriate for the question\n- Sub-questions must comply with the operator's requirements\n- Each sub-question should be simpler than the original question\n- Sub-questions should be clear and self-contained\n- Maintain context between decomposition steps\n- Use only tables and columns that exist in the provided schema\n",
"role": "system"
},
{
"content": "decompose the following question: List the total number of horses of all farms.",
"role": "user"
},
{
"content": "{\"index\":1,\"question\":\"List the total number of horses of all farms.\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
}
] |
fd4ec0ecb8ae1c200f37726477316bf3acd23ee83a350beb5a7dd38cc37bfede_0
|
farm
|
List the total number of horses on farms in ascending order.
|
[
"#1 = Scan Table [ farm ] Output [ Total_Horses ]",
"#2 = Sort [ #1 ] OrderBy [ Total_Horses ASC ] Output [ Total_Horses ]"
] |
[
"List the total number of horses of all farms.",
"List the total number of horses on farms in ascending order."
] |
[
{
"content": "You are a question decomposition expert. You are given a database schema and a complex database input question in natural language, and your task is to break down the complex database input question into simpler sub-questions in a recursive way, like a tree. In each step you will be given a question to decompose, so that your answer will be the input for the next steps.\n\nInput Question:\nWhat is the total horses record for each farm, sorted ascending?\n\nDatabase Name:\nfarm\n\nDatabase Schema:\nCREATE TABLE city (\n\tCity_ID number,\n\tOfficial_Name text,\n\tStatus text,\n\tArea_km_2 number,\n\tPopulation number,\n\tCensus_Ranking text,\n\tprimary key ( City_ID )\n)\n\nCREATE TABLE farm (\n\tFarm_ID number,\n\tYear number,\n\tTotal_Horses number,\n\tWorking_Horses number,\n\tTotal_Cattle number,\n\tOxen number,\n\tBulls number,\n\tCows number,\n\tPigs number,\n\tSheep_and_Goats number,\n\tprimary key ( Farm_ID )\n)\n\nCREATE TABLE farm_competition (\n\tCompetition_ID number,\n\tYear number,\n\tTheme text,\n\tHost_city_ID number,\n\tHosts text,\n\tprimary key ( Competition_ID ),\n\tforeign key ( Host_city_ID ) references city ( City_ID )\n)\n\nCREATE TABLE competition_record (\n\tCompetition_ID number,\n\tFarm_ID number,\n\tRank number,\n\tprimary key ( Competition_ID , Farm_ID ),\n\tforeign key ( Farm_ID ) references farm ( Farm_ID ),\n\tforeign key ( Competition_ID ) references farm_competition ( Competition_ID )\n)\n\nValid Operators:\nThe following operators are available for query decomposition:\n- Scan: Direct table access with no sub-questions\n- Filter: Selection based on conditions\n- Aggregate: Group and compute aggregations\n- Sort: Order results\n- Topsort: Sort and limit results\n- Top: Limit results\n- Join: Combine two sub-queries\n- Except: Set difference between two sub-queries\n- Intersect: Set intersection between two sub-queries\n- Union: Set union of two sub-queries\n\nOperator Rules:\n1. Each decomposition MUST specify exactly one operator from the above list\n2. Operator constraints:\n - Scan: Cannot have sub-questions\n - Filter/Aggregate/Sort/Top/Topsort: Can have 1 sub-question\n - Join/Union/Intersect/Except: Must have exactly 2 sub-questions\n\nTask Description:\n1. You will receive a complex database question that needs to be decomposed\n2. For each question, you should:\n - First, determine the appropriate operator from the valid list\n - Then break it down into sub-questions according to the operator's rules\n - Explain how these sub-questions relate to the original question\n - Indicate the order in which these sub-questions should be answered\n\nResponse Format:\nFor each decomposition step, respond with this exact JSON format without any other text:\n{\n \"type\": \"object\",\n \"properties\": {\n \"index\": {\n \"type\": [\n \"integer\",\n \"null\"\n ]\n },\n \"question\": {\n \"type\": \"string\"\n },\n \"operator\": {\n \"type\": [\n \"string\",\n \"null\"\n ],\n \"enum\": [\n \"Scan\",\n \"Filter\",\n \"Aggregate\",\n \"Sort\",\n \"Top\",\n \"Join\",\n \"Union\",\n \"Intersect\",\n \"Except\",\n null\n ]\n },\n \"sub_questions\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#\"\n }\n }\n },\n \"required\": [\n \"index\",\n \"question\",\n \"operator\"\n ]\n}\n\nConversation Flow:\n1. User will provide the initial complex question\n2. You will:\n a. Choose an appropriate operator\n b. Decompose into sub-questions according to operator rules\n3. User will ask you to decompose one of the sub-questions if needed\n4. This process continues until we reach simple, directly answerable questions (Scan operations)\n\nImportant Rules:\n- Each decomposition MUST use exactly one operator from the valid list\n- Operator choice must be justified and appropriate for the question\n- Sub-questions must comply with the operator's requirements\n- Each sub-question should be simpler than the original question\n- Sub-questions should be clear and self-contained\n- Maintain context between decomposition steps\n- Use only tables and columns that exist in the provided schema\n",
"role": "system"
},
{
"content": "decompose the following question: List the total number of horses on farms in ascending order.",
"role": "user"
},
{
"content": "{\"index\":1,\"question\":\"List the total number of horses on farms in ascending order.\",\"operator\":\"Sort\",\"sub_questions\":[{\"index\":2,\"question\":\"List the total number of horses of all farms.\",\"operator\":null,\"sub_questions\":[]}]}",
"role": "assistant"
},
{
"content": "given the decomposition: {\"index\":1,\"question\":\"List the total number of horses on farms in ascending order.\",\"operator\":\"Sort\",\"sub_questions\":[{\"index\":2,\"question\":\"List the total number of horses of all farms.\",\"operator\":null,\"sub_questions\":[]}]}\ndecompose the following question with index 2: List the total number of horses of all farms.",
"role": "user"
},
{
"content": "{\"index\":2,\"question\":\"List the total number of horses of all farms.\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
}
] |
fd4ec0ecb8ae1c200f37726477316bf3acd23ee83a350beb5a7dd38cc37bfede_1
|
farm
|
List the total number of horses of all farms.
|
[
"#1 = Scan Table [ farm ] Output [ Total_Horses ]"
] |
[
"List the total number of horses of all farms."
] |
[
{
"content": "You are a question decomposition expert. You are given a database schema and a complex database input question in natural language, and your task is to break down the complex database input question into simpler sub-questions in a recursive way, like a tree. In each step you will be given a question to decompose, so that your answer will be the input for the next steps.\n\nInput Question:\nWhat is the total horses record for each farm, sorted ascending?\n\nDatabase Name:\nfarm\n\nDatabase Schema:\nCREATE TABLE city (\n\tCity_ID number,\n\tOfficial_Name text,\n\tStatus text,\n\tArea_km_2 number,\n\tPopulation number,\n\tCensus_Ranking text,\n\tprimary key ( City_ID )\n)\n\nCREATE TABLE farm (\n\tFarm_ID number,\n\tYear number,\n\tTotal_Horses number,\n\tWorking_Horses number,\n\tTotal_Cattle number,\n\tOxen number,\n\tBulls number,\n\tCows number,\n\tPigs number,\n\tSheep_and_Goats number,\n\tprimary key ( Farm_ID )\n)\n\nCREATE TABLE farm_competition (\n\tCompetition_ID number,\n\tYear number,\n\tTheme text,\n\tHost_city_ID number,\n\tHosts text,\n\tprimary key ( Competition_ID ),\n\tforeign key ( Host_city_ID ) references city ( City_ID )\n)\n\nCREATE TABLE competition_record (\n\tCompetition_ID number,\n\tFarm_ID number,\n\tRank number,\n\tprimary key ( Competition_ID , Farm_ID ),\n\tforeign key ( Farm_ID ) references farm ( Farm_ID ),\n\tforeign key ( Competition_ID ) references farm_competition ( Competition_ID )\n)\n\nValid Operators:\nThe following operators are available for query decomposition:\n- Scan: Direct table access with no sub-questions\n- Filter: Selection based on conditions\n- Aggregate: Group and compute aggregations\n- Sort: Order results\n- Topsort: Sort and limit results\n- Top: Limit results\n- Join: Combine two sub-queries\n- Except: Set difference between two sub-queries\n- Intersect: Set intersection between two sub-queries\n- Union: Set union of two sub-queries\n\nOperator Rules:\n1. Each decomposition MUST specify exactly one operator from the above list\n2. Operator constraints:\n - Scan: Cannot have sub-questions\n - Filter/Aggregate/Sort/Top/Topsort: Can have 1 sub-question\n - Join/Union/Intersect/Except: Must have exactly 2 sub-questions\n\nTask Description:\n1. You will receive a complex database question that needs to be decomposed\n2. For each question, you should:\n - First, determine the appropriate operator from the valid list\n - Then break it down into sub-questions according to the operator's rules\n - Explain how these sub-questions relate to the original question\n - Indicate the order in which these sub-questions should be answered\n\nResponse Format:\nFor each decomposition step, respond with this exact JSON format without any other text:\n{\n \"type\": \"object\",\n \"properties\": {\n \"index\": {\n \"type\": [\n \"integer\",\n \"null\"\n ]\n },\n \"question\": {\n \"type\": \"string\"\n },\n \"operator\": {\n \"type\": [\n \"string\",\n \"null\"\n ],\n \"enum\": [\n \"Scan\",\n \"Filter\",\n \"Aggregate\",\n \"Sort\",\n \"Top\",\n \"Join\",\n \"Union\",\n \"Intersect\",\n \"Except\",\n null\n ]\n },\n \"sub_questions\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#\"\n }\n }\n },\n \"required\": [\n \"index\",\n \"question\",\n \"operator\"\n ]\n}\n\nConversation Flow:\n1. User will provide the initial complex question\n2. You will:\n a. Choose an appropriate operator\n b. Decompose into sub-questions according to operator rules\n3. User will ask you to decompose one of the sub-questions if needed\n4. This process continues until we reach simple, directly answerable questions (Scan operations)\n\nImportant Rules:\n- Each decomposition MUST use exactly one operator from the valid list\n- Operator choice must be justified and appropriate for the question\n- Sub-questions must comply with the operator's requirements\n- Each sub-question should be simpler than the original question\n- Sub-questions should be clear and self-contained\n- Maintain context between decomposition steps\n- Use only tables and columns that exist in the provided schema\n",
"role": "system"
},
{
"content": "decompose the following question: List the total number of horses of all farms.",
"role": "user"
},
{
"content": "{\"index\":1,\"question\":\"List the total number of horses of all farms.\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
}
] |
cec687ff47e0a5fc41502c04b474cc537872fae82c18b6498e139715aac854e3_0
|
farm
|
What are the hosts of competitions whose theme is not "Aliens"?
|
[
"#1 = Scan Table [ farm_competition ] Predicate [ Theme <> 'Aliens' ] Output [ Hosts , Theme ]"
] |
[
"What are the hosts of competitions whose theme is not \"Aliens\"?"
] |
[
{
"content": "You are a question decomposition expert. You are given a database schema and a complex database input question in natural language, and your task is to break down the complex database input question into simpler sub-questions in a recursive way, like a tree. In each step you will be given a question to decompose, so that your answer will be the input for the next steps.\n\nInput Question:\nWhat are the hosts of competitions whose theme is not \"Aliens\"?\n\nDatabase Name:\nfarm\n\nDatabase Schema:\nCREATE TABLE city (\n\tCity_ID number,\n\tOfficial_Name text,\n\tStatus text,\n\tArea_km_2 number,\n\tPopulation number,\n\tCensus_Ranking text,\n\tprimary key ( City_ID )\n)\n\nCREATE TABLE farm (\n\tFarm_ID number,\n\tYear number,\n\tTotal_Horses number,\n\tWorking_Horses number,\n\tTotal_Cattle number,\n\tOxen number,\n\tBulls number,\n\tCows number,\n\tPigs number,\n\tSheep_and_Goats number,\n\tprimary key ( Farm_ID )\n)\n\nCREATE TABLE farm_competition (\n\tCompetition_ID number,\n\tYear number,\n\tTheme text,\n\tHost_city_ID number,\n\tHosts text,\n\tprimary key ( Competition_ID ),\n\tforeign key ( Host_city_ID ) references city ( City_ID )\n)\n\nCREATE TABLE competition_record (\n\tCompetition_ID number,\n\tFarm_ID number,\n\tRank number,\n\tprimary key ( Competition_ID , Farm_ID ),\n\tforeign key ( Farm_ID ) references farm ( Farm_ID ),\n\tforeign key ( Competition_ID ) references farm_competition ( Competition_ID )\n)\n\nValid Operators:\nThe following operators are available for query decomposition:\n- Scan: Direct table access with no sub-questions\n- Filter: Selection based on conditions\n- Aggregate: Group and compute aggregations\n- Sort: Order results\n- Topsort: Sort and limit results\n- Top: Limit results\n- Join: Combine two sub-queries\n- Except: Set difference between two sub-queries\n- Intersect: Set intersection between two sub-queries\n- Union: Set union of two sub-queries\n\nOperator Rules:\n1. Each decomposition MUST specify exactly one operator from the above list\n2. Operator constraints:\n - Scan: Cannot have sub-questions\n - Filter/Aggregate/Sort/Top/Topsort: Can have 1 sub-question\n - Join/Union/Intersect/Except: Must have exactly 2 sub-questions\n\nTask Description:\n1. You will receive a complex database question that needs to be decomposed\n2. For each question, you should:\n - First, determine the appropriate operator from the valid list\n - Then break it down into sub-questions according to the operator's rules\n - Explain how these sub-questions relate to the original question\n - Indicate the order in which these sub-questions should be answered\n\nResponse Format:\nFor each decomposition step, respond with this exact JSON format without any other text:\n{\n \"type\": \"object\",\n \"properties\": {\n \"index\": {\n \"type\": [\n \"integer\",\n \"null\"\n ]\n },\n \"question\": {\n \"type\": \"string\"\n },\n \"operator\": {\n \"type\": [\n \"string\",\n \"null\"\n ],\n \"enum\": [\n \"Scan\",\n \"Filter\",\n \"Aggregate\",\n \"Sort\",\n \"Top\",\n \"Join\",\n \"Union\",\n \"Intersect\",\n \"Except\",\n null\n ]\n },\n \"sub_questions\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#\"\n }\n }\n },\n \"required\": [\n \"index\",\n \"question\",\n \"operator\"\n ]\n}\n\nConversation Flow:\n1. User will provide the initial complex question\n2. You will:\n a. Choose an appropriate operator\n b. Decompose into sub-questions according to operator rules\n3. User will ask you to decompose one of the sub-questions if needed\n4. This process continues until we reach simple, directly answerable questions (Scan operations)\n\nImportant Rules:\n- Each decomposition MUST use exactly one operator from the valid list\n- Operator choice must be justified and appropriate for the question\n- Sub-questions must comply with the operator's requirements\n- Each sub-question should be simpler than the original question\n- Sub-questions should be clear and self-contained\n- Maintain context between decomposition steps\n- Use only tables and columns that exist in the provided schema\n",
"role": "system"
},
{
"content": "decompose the following question: What are the hosts of competitions whose theme is not \"Aliens\"?",
"role": "user"
},
{
"content": "{\"index\":1,\"question\":\"What are the hosts of competitions whose theme is not \\\"Aliens\\\"?\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
}
] |
bf82cd940e88cb823a297867749a11a54f3fc9751b5320c05f29695c985133ff_0
|
farm
|
Return the hosts of competitions for which the theme is not Aliens?
|
[
"#1 = Scan Table [ farm_competition ] Predicate [ Theme <> 'Aliens' ] Output [ Hosts , Theme ]"
] |
[
"Return the hosts of competitions for which the theme is not Aliens?"
] |
[
{
"content": "You are a question decomposition expert. You are given a database schema and a complex database input question in natural language, and your task is to break down the complex database input question into simpler sub-questions in a recursive way, like a tree. In each step you will be given a question to decompose, so that your answer will be the input for the next steps.\n\nInput Question:\nReturn the hosts of competitions for which the theme is not Aliens?\n\nDatabase Name:\nfarm\n\nDatabase Schema:\nCREATE TABLE city (\n\tCity_ID number,\n\tOfficial_Name text,\n\tStatus text,\n\tArea_km_2 number,\n\tPopulation number,\n\tCensus_Ranking text,\n\tprimary key ( City_ID )\n)\n\nCREATE TABLE farm (\n\tFarm_ID number,\n\tYear number,\n\tTotal_Horses number,\n\tWorking_Horses number,\n\tTotal_Cattle number,\n\tOxen number,\n\tBulls number,\n\tCows number,\n\tPigs number,\n\tSheep_and_Goats number,\n\tprimary key ( Farm_ID )\n)\n\nCREATE TABLE farm_competition (\n\tCompetition_ID number,\n\tYear number,\n\tTheme text,\n\tHost_city_ID number,\n\tHosts text,\n\tprimary key ( Competition_ID ),\n\tforeign key ( Host_city_ID ) references city ( City_ID )\n)\n\nCREATE TABLE competition_record (\n\tCompetition_ID number,\n\tFarm_ID number,\n\tRank number,\n\tprimary key ( Competition_ID , Farm_ID ),\n\tforeign key ( Farm_ID ) references farm ( Farm_ID ),\n\tforeign key ( Competition_ID ) references farm_competition ( Competition_ID )\n)\n\nValid Operators:\nThe following operators are available for query decomposition:\n- Scan: Direct table access with no sub-questions\n- Filter: Selection based on conditions\n- Aggregate: Group and compute aggregations\n- Sort: Order results\n- Topsort: Sort and limit results\n- Top: Limit results\n- Join: Combine two sub-queries\n- Except: Set difference between two sub-queries\n- Intersect: Set intersection between two sub-queries\n- Union: Set union of two sub-queries\n\nOperator Rules:\n1. Each decomposition MUST specify exactly one operator from the above list\n2. Operator constraints:\n - Scan: Cannot have sub-questions\n - Filter/Aggregate/Sort/Top/Topsort: Can have 1 sub-question\n - Join/Union/Intersect/Except: Must have exactly 2 sub-questions\n\nTask Description:\n1. You will receive a complex database question that needs to be decomposed\n2. For each question, you should:\n - First, determine the appropriate operator from the valid list\n - Then break it down into sub-questions according to the operator's rules\n - Explain how these sub-questions relate to the original question\n - Indicate the order in which these sub-questions should be answered\n\nResponse Format:\nFor each decomposition step, respond with this exact JSON format without any other text:\n{\n \"type\": \"object\",\n \"properties\": {\n \"index\": {\n \"type\": [\n \"integer\",\n \"null\"\n ]\n },\n \"question\": {\n \"type\": \"string\"\n },\n \"operator\": {\n \"type\": [\n \"string\",\n \"null\"\n ],\n \"enum\": [\n \"Scan\",\n \"Filter\",\n \"Aggregate\",\n \"Sort\",\n \"Top\",\n \"Join\",\n \"Union\",\n \"Intersect\",\n \"Except\",\n null\n ]\n },\n \"sub_questions\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#\"\n }\n }\n },\n \"required\": [\n \"index\",\n \"question\",\n \"operator\"\n ]\n}\n\nConversation Flow:\n1. User will provide the initial complex question\n2. You will:\n a. Choose an appropriate operator\n b. Decompose into sub-questions according to operator rules\n3. User will ask you to decompose one of the sub-questions if needed\n4. This process continues until we reach simple, directly answerable questions (Scan operations)\n\nImportant Rules:\n- Each decomposition MUST use exactly one operator from the valid list\n- Operator choice must be justified and appropriate for the question\n- Sub-questions must comply with the operator's requirements\n- Each sub-question should be simpler than the original question\n- Sub-questions should be clear and self-contained\n- Maintain context between decomposition steps\n- Use only tables and columns that exist in the provided schema\n",
"role": "system"
},
{
"content": "decompose the following question: Return the hosts of competitions for which the theme is not Aliens?",
"role": "user"
},
{
"content": "{\"index\":1,\"question\":\"Return the hosts of competitions for which the theme is not Aliens?\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
}
] |
bd2f7e288dd397a9b8ab4642f9ac04c5e77b47ffa2db052329487c7cbdcff76f_0
|
farm
|
What are the themes of farm competitions sorted by year in ascending order?
|
[
"#1 = Scan Table [ farm_competition ] Output [ Theme , Year ]",
"#2 = Sort [ #1 ] OrderBy [ Year ASC ] Output [ Theme , Year ]"
] |
[
"What are the themes and years of all farm competitions?",
"What are the themes of farm competitions sorted by year in ascending order?"
] |
[
{
"content": "You are a question decomposition expert. You are given a database schema and a complex database input question in natural language, and your task is to break down the complex database input question into simpler sub-questions in a recursive way, like a tree. In each step you will be given a question to decompose, so that your answer will be the input for the next steps.\n\nInput Question:\nWhat are the themes of farm competitions sorted by year in ascending order?\n\nDatabase Name:\nfarm\n\nDatabase Schema:\nCREATE TABLE city (\n\tCity_ID number,\n\tOfficial_Name text,\n\tStatus text,\n\tArea_km_2 number,\n\tPopulation number,\n\tCensus_Ranking text,\n\tprimary key ( City_ID )\n)\n\nCREATE TABLE farm (\n\tFarm_ID number,\n\tYear number,\n\tTotal_Horses number,\n\tWorking_Horses number,\n\tTotal_Cattle number,\n\tOxen number,\n\tBulls number,\n\tCows number,\n\tPigs number,\n\tSheep_and_Goats number,\n\tprimary key ( Farm_ID )\n)\n\nCREATE TABLE farm_competition (\n\tCompetition_ID number,\n\tYear number,\n\tTheme text,\n\tHost_city_ID number,\n\tHosts text,\n\tprimary key ( Competition_ID ),\n\tforeign key ( Host_city_ID ) references city ( City_ID )\n)\n\nCREATE TABLE competition_record (\n\tCompetition_ID number,\n\tFarm_ID number,\n\tRank number,\n\tprimary key ( Competition_ID , Farm_ID ),\n\tforeign key ( Farm_ID ) references farm ( Farm_ID ),\n\tforeign key ( Competition_ID ) references farm_competition ( Competition_ID )\n)\n\nValid Operators:\nThe following operators are available for query decomposition:\n- Scan: Direct table access with no sub-questions\n- Filter: Selection based on conditions\n- Aggregate: Group and compute aggregations\n- Sort: Order results\n- Topsort: Sort and limit results\n- Top: Limit results\n- Join: Combine two sub-queries\n- Except: Set difference between two sub-queries\n- Intersect: Set intersection between two sub-queries\n- Union: Set union of two sub-queries\n\nOperator Rules:\n1. Each decomposition MUST specify exactly one operator from the above list\n2. Operator constraints:\n - Scan: Cannot have sub-questions\n - Filter/Aggregate/Sort/Top/Topsort: Can have 1 sub-question\n - Join/Union/Intersect/Except: Must have exactly 2 sub-questions\n\nTask Description:\n1. You will receive a complex database question that needs to be decomposed\n2. For each question, you should:\n - First, determine the appropriate operator from the valid list\n - Then break it down into sub-questions according to the operator's rules\n - Explain how these sub-questions relate to the original question\n - Indicate the order in which these sub-questions should be answered\n\nResponse Format:\nFor each decomposition step, respond with this exact JSON format without any other text:\n{\n \"type\": \"object\",\n \"properties\": {\n \"index\": {\n \"type\": [\n \"integer\",\n \"null\"\n ]\n },\n \"question\": {\n \"type\": \"string\"\n },\n \"operator\": {\n \"type\": [\n \"string\",\n \"null\"\n ],\n \"enum\": [\n \"Scan\",\n \"Filter\",\n \"Aggregate\",\n \"Sort\",\n \"Top\",\n \"Join\",\n \"Union\",\n \"Intersect\",\n \"Except\",\n null\n ]\n },\n \"sub_questions\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#\"\n }\n }\n },\n \"required\": [\n \"index\",\n \"question\",\n \"operator\"\n ]\n}\n\nConversation Flow:\n1. User will provide the initial complex question\n2. You will:\n a. Choose an appropriate operator\n b. Decompose into sub-questions according to operator rules\n3. User will ask you to decompose one of the sub-questions if needed\n4. This process continues until we reach simple, directly answerable questions (Scan operations)\n\nImportant Rules:\n- Each decomposition MUST use exactly one operator from the valid list\n- Operator choice must be justified and appropriate for the question\n- Sub-questions must comply with the operator's requirements\n- Each sub-question should be simpler than the original question\n- Sub-questions should be clear and self-contained\n- Maintain context between decomposition steps\n- Use only tables and columns that exist in the provided schema\n",
"role": "system"
},
{
"content": "decompose the following question: What are the themes of farm competitions sorted by year in ascending order?",
"role": "user"
},
{
"content": "{\"index\":1,\"question\":\"What are the themes of farm competitions sorted by year in ascending order?\",\"operator\":\"Sort\",\"sub_questions\":[{\"index\":2,\"question\":\"What are the themes and years of all farm competitions?\",\"operator\":null,\"sub_questions\":[]}]}",
"role": "assistant"
},
{
"content": "given the decomposition: {\"index\":1,\"question\":\"What are the themes of farm competitions sorted by year in ascending order?\",\"operator\":\"Sort\",\"sub_questions\":[{\"index\":2,\"question\":\"What are the themes and years of all farm competitions?\",\"operator\":null,\"sub_questions\":[]}]}\ndecompose the following question with index 2: What are the themes and years of all farm competitions?",
"role": "user"
},
{
"content": "{\"index\":2,\"question\":\"What are the themes and years of all farm competitions?\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
}
] |
bd2f7e288dd397a9b8ab4642f9ac04c5e77b47ffa2db052329487c7cbdcff76f_1
|
farm
|
What are the themes and years of all farm competitions?
|
[
"#1 = Scan Table [ farm_competition ] Output [ Theme , Year ]"
] |
[
"What are the themes and years of all farm competitions?"
] |
[
{
"content": "You are a question decomposition expert. You are given a database schema and a complex database input question in natural language, and your task is to break down the complex database input question into simpler sub-questions in a recursive way, like a tree. In each step you will be given a question to decompose, so that your answer will be the input for the next steps.\n\nInput Question:\nWhat are the themes of farm competitions sorted by year in ascending order?\n\nDatabase Name:\nfarm\n\nDatabase Schema:\nCREATE TABLE city (\n\tCity_ID number,\n\tOfficial_Name text,\n\tStatus text,\n\tArea_km_2 number,\n\tPopulation number,\n\tCensus_Ranking text,\n\tprimary key ( City_ID )\n)\n\nCREATE TABLE farm (\n\tFarm_ID number,\n\tYear number,\n\tTotal_Horses number,\n\tWorking_Horses number,\n\tTotal_Cattle number,\n\tOxen number,\n\tBulls number,\n\tCows number,\n\tPigs number,\n\tSheep_and_Goats number,\n\tprimary key ( Farm_ID )\n)\n\nCREATE TABLE farm_competition (\n\tCompetition_ID number,\n\tYear number,\n\tTheme text,\n\tHost_city_ID number,\n\tHosts text,\n\tprimary key ( Competition_ID ),\n\tforeign key ( Host_city_ID ) references city ( City_ID )\n)\n\nCREATE TABLE competition_record (\n\tCompetition_ID number,\n\tFarm_ID number,\n\tRank number,\n\tprimary key ( Competition_ID , Farm_ID ),\n\tforeign key ( Farm_ID ) references farm ( Farm_ID ),\n\tforeign key ( Competition_ID ) references farm_competition ( Competition_ID )\n)\n\nValid Operators:\nThe following operators are available for query decomposition:\n- Scan: Direct table access with no sub-questions\n- Filter: Selection based on conditions\n- Aggregate: Group and compute aggregations\n- Sort: Order results\n- Topsort: Sort and limit results\n- Top: Limit results\n- Join: Combine two sub-queries\n- Except: Set difference between two sub-queries\n- Intersect: Set intersection between two sub-queries\n- Union: Set union of two sub-queries\n\nOperator Rules:\n1. Each decomposition MUST specify exactly one operator from the above list\n2. Operator constraints:\n - Scan: Cannot have sub-questions\n - Filter/Aggregate/Sort/Top/Topsort: Can have 1 sub-question\n - Join/Union/Intersect/Except: Must have exactly 2 sub-questions\n\nTask Description:\n1. You will receive a complex database question that needs to be decomposed\n2. For each question, you should:\n - First, determine the appropriate operator from the valid list\n - Then break it down into sub-questions according to the operator's rules\n - Explain how these sub-questions relate to the original question\n - Indicate the order in which these sub-questions should be answered\n\nResponse Format:\nFor each decomposition step, respond with this exact JSON format without any other text:\n{\n \"type\": \"object\",\n \"properties\": {\n \"index\": {\n \"type\": [\n \"integer\",\n \"null\"\n ]\n },\n \"question\": {\n \"type\": \"string\"\n },\n \"operator\": {\n \"type\": [\n \"string\",\n \"null\"\n ],\n \"enum\": [\n \"Scan\",\n \"Filter\",\n \"Aggregate\",\n \"Sort\",\n \"Top\",\n \"Join\",\n \"Union\",\n \"Intersect\",\n \"Except\",\n null\n ]\n },\n \"sub_questions\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#\"\n }\n }\n },\n \"required\": [\n \"index\",\n \"question\",\n \"operator\"\n ]\n}\n\nConversation Flow:\n1. User will provide the initial complex question\n2. You will:\n a. Choose an appropriate operator\n b. Decompose into sub-questions according to operator rules\n3. User will ask you to decompose one of the sub-questions if needed\n4. This process continues until we reach simple, directly answerable questions (Scan operations)\n\nImportant Rules:\n- Each decomposition MUST use exactly one operator from the valid list\n- Operator choice must be justified and appropriate for the question\n- Sub-questions must comply with the operator's requirements\n- Each sub-question should be simpler than the original question\n- Sub-questions should be clear and self-contained\n- Maintain context between decomposition steps\n- Use only tables and columns that exist in the provided schema\n",
"role": "system"
},
{
"content": "decompose the following question: What are the themes and years of all farm competitions?",
"role": "user"
},
{
"content": "{\"index\":1,\"question\":\"What are the themes and years of all farm competitions?\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
}
] |
b11ab9fef1792c41e96078d4abe87b7d9398d6579a7cf4309d7c4bb54d6d0e34_0
|
farm
|
What are the themes of farm competitions sorted by year in ascending order?
|
[
"#1 = Scan Table [ farm_competition ] Output [ Theme , Year ]",
"#2 = Sort [ #1 ] OrderBy [ Year ASC ] Output [ Theme , Year ]"
] |
[
"What are the themes and years of all farm competitions?",
"What are the themes of farm competitions sorted by year in ascending order?"
] |
[
{
"content": "You are a question decomposition expert. You are given a database schema and a complex database input question in natural language, and your task is to break down the complex database input question into simpler sub-questions in a recursive way, like a tree. In each step you will be given a question to decompose, so that your answer will be the input for the next steps.\n\nInput Question:\nReturn the themes of farm competitions, sorted by year ascending.\n\nDatabase Name:\nfarm\n\nDatabase Schema:\nCREATE TABLE city (\n\tCity_ID number,\n\tOfficial_Name text,\n\tStatus text,\n\tArea_km_2 number,\n\tPopulation number,\n\tCensus_Ranking text,\n\tprimary key ( City_ID )\n)\n\nCREATE TABLE farm (\n\tFarm_ID number,\n\tYear number,\n\tTotal_Horses number,\n\tWorking_Horses number,\n\tTotal_Cattle number,\n\tOxen number,\n\tBulls number,\n\tCows number,\n\tPigs number,\n\tSheep_and_Goats number,\n\tprimary key ( Farm_ID )\n)\n\nCREATE TABLE farm_competition (\n\tCompetition_ID number,\n\tYear number,\n\tTheme text,\n\tHost_city_ID number,\n\tHosts text,\n\tprimary key ( Competition_ID ),\n\tforeign key ( Host_city_ID ) references city ( City_ID )\n)\n\nCREATE TABLE competition_record (\n\tCompetition_ID number,\n\tFarm_ID number,\n\tRank number,\n\tprimary key ( Competition_ID , Farm_ID ),\n\tforeign key ( Farm_ID ) references farm ( Farm_ID ),\n\tforeign key ( Competition_ID ) references farm_competition ( Competition_ID )\n)\n\nValid Operators:\nThe following operators are available for query decomposition:\n- Scan: Direct table access with no sub-questions\n- Filter: Selection based on conditions\n- Aggregate: Group and compute aggregations\n- Sort: Order results\n- Topsort: Sort and limit results\n- Top: Limit results\n- Join: Combine two sub-queries\n- Except: Set difference between two sub-queries\n- Intersect: Set intersection between two sub-queries\n- Union: Set union of two sub-queries\n\nOperator Rules:\n1. Each decomposition MUST specify exactly one operator from the above list\n2. Operator constraints:\n - Scan: Cannot have sub-questions\n - Filter/Aggregate/Sort/Top/Topsort: Can have 1 sub-question\n - Join/Union/Intersect/Except: Must have exactly 2 sub-questions\n\nTask Description:\n1. You will receive a complex database question that needs to be decomposed\n2. For each question, you should:\n - First, determine the appropriate operator from the valid list\n - Then break it down into sub-questions according to the operator's rules\n - Explain how these sub-questions relate to the original question\n - Indicate the order in which these sub-questions should be answered\n\nResponse Format:\nFor each decomposition step, respond with this exact JSON format without any other text:\n{\n \"type\": \"object\",\n \"properties\": {\n \"index\": {\n \"type\": [\n \"integer\",\n \"null\"\n ]\n },\n \"question\": {\n \"type\": \"string\"\n },\n \"operator\": {\n \"type\": [\n \"string\",\n \"null\"\n ],\n \"enum\": [\n \"Scan\",\n \"Filter\",\n \"Aggregate\",\n \"Sort\",\n \"Top\",\n \"Join\",\n \"Union\",\n \"Intersect\",\n \"Except\",\n null\n ]\n },\n \"sub_questions\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#\"\n }\n }\n },\n \"required\": [\n \"index\",\n \"question\",\n \"operator\"\n ]\n}\n\nConversation Flow:\n1. User will provide the initial complex question\n2. You will:\n a. Choose an appropriate operator\n b. Decompose into sub-questions according to operator rules\n3. User will ask you to decompose one of the sub-questions if needed\n4. This process continues until we reach simple, directly answerable questions (Scan operations)\n\nImportant Rules:\n- Each decomposition MUST use exactly one operator from the valid list\n- Operator choice must be justified and appropriate for the question\n- Sub-questions must comply with the operator's requirements\n- Each sub-question should be simpler than the original question\n- Sub-questions should be clear and self-contained\n- Maintain context between decomposition steps\n- Use only tables and columns that exist in the provided schema\n",
"role": "system"
},
{
"content": "decompose the following question: What are the themes of farm competitions sorted by year in ascending order?",
"role": "user"
},
{
"content": "{\"index\":1,\"question\":\"What are the themes of farm competitions sorted by year in ascending order?\",\"operator\":\"Sort\",\"sub_questions\":[{\"index\":2,\"question\":\"What are the themes and years of all farm competitions?\",\"operator\":null,\"sub_questions\":[]}]}",
"role": "assistant"
},
{
"content": "given the decomposition: {\"index\":1,\"question\":\"What are the themes of farm competitions sorted by year in ascending order?\",\"operator\":\"Sort\",\"sub_questions\":[{\"index\":2,\"question\":\"What are the themes and years of all farm competitions?\",\"operator\":null,\"sub_questions\":[]}]}\ndecompose the following question with index 2: What are the themes and years of all farm competitions?",
"role": "user"
},
{
"content": "{\"index\":2,\"question\":\"What are the themes and years of all farm competitions?\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
}
] |
b11ab9fef1792c41e96078d4abe87b7d9398d6579a7cf4309d7c4bb54d6d0e34_1
|
farm
|
What are the themes and years of all farm competitions?
|
[
"#1 = Scan Table [ farm_competition ] Output [ Theme , Year ]"
] |
[
"What are the themes and years of all farm competitions?"
] |
[
{
"content": "You are a question decomposition expert. You are given a database schema and a complex database input question in natural language, and your task is to break down the complex database input question into simpler sub-questions in a recursive way, like a tree. In each step you will be given a question to decompose, so that your answer will be the input for the next steps.\n\nInput Question:\nReturn the themes of farm competitions, sorted by year ascending.\n\nDatabase Name:\nfarm\n\nDatabase Schema:\nCREATE TABLE city (\n\tCity_ID number,\n\tOfficial_Name text,\n\tStatus text,\n\tArea_km_2 number,\n\tPopulation number,\n\tCensus_Ranking text,\n\tprimary key ( City_ID )\n)\n\nCREATE TABLE farm (\n\tFarm_ID number,\n\tYear number,\n\tTotal_Horses number,\n\tWorking_Horses number,\n\tTotal_Cattle number,\n\tOxen number,\n\tBulls number,\n\tCows number,\n\tPigs number,\n\tSheep_and_Goats number,\n\tprimary key ( Farm_ID )\n)\n\nCREATE TABLE farm_competition (\n\tCompetition_ID number,\n\tYear number,\n\tTheme text,\n\tHost_city_ID number,\n\tHosts text,\n\tprimary key ( Competition_ID ),\n\tforeign key ( Host_city_ID ) references city ( City_ID )\n)\n\nCREATE TABLE competition_record (\n\tCompetition_ID number,\n\tFarm_ID number,\n\tRank number,\n\tprimary key ( Competition_ID , Farm_ID ),\n\tforeign key ( Farm_ID ) references farm ( Farm_ID ),\n\tforeign key ( Competition_ID ) references farm_competition ( Competition_ID )\n)\n\nValid Operators:\nThe following operators are available for query decomposition:\n- Scan: Direct table access with no sub-questions\n- Filter: Selection based on conditions\n- Aggregate: Group and compute aggregations\n- Sort: Order results\n- Topsort: Sort and limit results\n- Top: Limit results\n- Join: Combine two sub-queries\n- Except: Set difference between two sub-queries\n- Intersect: Set intersection between two sub-queries\n- Union: Set union of two sub-queries\n\nOperator Rules:\n1. Each decomposition MUST specify exactly one operator from the above list\n2. Operator constraints:\n - Scan: Cannot have sub-questions\n - Filter/Aggregate/Sort/Top/Topsort: Can have 1 sub-question\n - Join/Union/Intersect/Except: Must have exactly 2 sub-questions\n\nTask Description:\n1. You will receive a complex database question that needs to be decomposed\n2. For each question, you should:\n - First, determine the appropriate operator from the valid list\n - Then break it down into sub-questions according to the operator's rules\n - Explain how these sub-questions relate to the original question\n - Indicate the order in which these sub-questions should be answered\n\nResponse Format:\nFor each decomposition step, respond with this exact JSON format without any other text:\n{\n \"type\": \"object\",\n \"properties\": {\n \"index\": {\n \"type\": [\n \"integer\",\n \"null\"\n ]\n },\n \"question\": {\n \"type\": \"string\"\n },\n \"operator\": {\n \"type\": [\n \"string\",\n \"null\"\n ],\n \"enum\": [\n \"Scan\",\n \"Filter\",\n \"Aggregate\",\n \"Sort\",\n \"Top\",\n \"Join\",\n \"Union\",\n \"Intersect\",\n \"Except\",\n null\n ]\n },\n \"sub_questions\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#\"\n }\n }\n },\n \"required\": [\n \"index\",\n \"question\",\n \"operator\"\n ]\n}\n\nConversation Flow:\n1. User will provide the initial complex question\n2. You will:\n a. Choose an appropriate operator\n b. Decompose into sub-questions according to operator rules\n3. User will ask you to decompose one of the sub-questions if needed\n4. This process continues until we reach simple, directly answerable questions (Scan operations)\n\nImportant Rules:\n- Each decomposition MUST use exactly one operator from the valid list\n- Operator choice must be justified and appropriate for the question\n- Sub-questions must comply with the operator's requirements\n- Each sub-question should be simpler than the original question\n- Sub-questions should be clear and self-contained\n- Maintain context between decomposition steps\n- Use only tables and columns that exist in the provided schema\n",
"role": "system"
},
{
"content": "decompose the following question: What are the themes and years of all farm competitions?",
"role": "user"
},
{
"content": "{\"index\":1,\"question\":\"What are the themes and years of all farm competitions?\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
}
] |
dae782b20de5b18242610c758f4beb375baecff971e5b07ed80f18373ff1eca2_0
|
farm
|
Give the average number of working horses on farms with more than 5000 total horses.
|
[
"#1 = Scan Table [ farm ] Predicate [ Total_Horses > 5000.0 ] Output [ Total_Horses , Working_Horses ]",
"#2 = Aggregate [ #1 ] Output [ AVG(Working_Horses) AS Avg_Working_Horses ]"
] |
[
"Give the number of working horses on farms with more than 5000 total horses.",
"Give the average number of working horses on farms with more than 5000 total horses."
] |
[
{
"content": "You are a question decomposition expert. You are given a database schema and a complex database input question in natural language, and your task is to break down the complex database input question into simpler sub-questions in a recursive way, like a tree. In each step you will be given a question to decompose, so that your answer will be the input for the next steps.\n\nInput Question:\nGive the average number of working horses on farms with more than 5000 total horses.\n\nDatabase Name:\nfarm\n\nDatabase Schema:\nCREATE TABLE city (\n\tCity_ID number,\n\tOfficial_Name text,\n\tStatus text,\n\tArea_km_2 number,\n\tPopulation number,\n\tCensus_Ranking text,\n\tprimary key ( City_ID )\n)\n\nCREATE TABLE farm (\n\tFarm_ID number,\n\tYear number,\n\tTotal_Horses number,\n\tWorking_Horses number,\n\tTotal_Cattle number,\n\tOxen number,\n\tBulls number,\n\tCows number,\n\tPigs number,\n\tSheep_and_Goats number,\n\tprimary key ( Farm_ID )\n)\n\nCREATE TABLE farm_competition (\n\tCompetition_ID number,\n\tYear number,\n\tTheme text,\n\tHost_city_ID number,\n\tHosts text,\n\tprimary key ( Competition_ID ),\n\tforeign key ( Host_city_ID ) references city ( City_ID )\n)\n\nCREATE TABLE competition_record (\n\tCompetition_ID number,\n\tFarm_ID number,\n\tRank number,\n\tprimary key ( Competition_ID , Farm_ID ),\n\tforeign key ( Farm_ID ) references farm ( Farm_ID ),\n\tforeign key ( Competition_ID ) references farm_competition ( Competition_ID )\n)\n\nValid Operators:\nThe following operators are available for query decomposition:\n- Scan: Direct table access with no sub-questions\n- Filter: Selection based on conditions\n- Aggregate: Group and compute aggregations\n- Sort: Order results\n- Topsort: Sort and limit results\n- Top: Limit results\n- Join: Combine two sub-queries\n- Except: Set difference between two sub-queries\n- Intersect: Set intersection between two sub-queries\n- Union: Set union of two sub-queries\n\nOperator Rules:\n1. Each decomposition MUST specify exactly one operator from the above list\n2. Operator constraints:\n - Scan: Cannot have sub-questions\n - Filter/Aggregate/Sort/Top/Topsort: Can have 1 sub-question\n - Join/Union/Intersect/Except: Must have exactly 2 sub-questions\n\nTask Description:\n1. You will receive a complex database question that needs to be decomposed\n2. For each question, you should:\n - First, determine the appropriate operator from the valid list\n - Then break it down into sub-questions according to the operator's rules\n - Explain how these sub-questions relate to the original question\n - Indicate the order in which these sub-questions should be answered\n\nResponse Format:\nFor each decomposition step, respond with this exact JSON format without any other text:\n{\n \"type\": \"object\",\n \"properties\": {\n \"index\": {\n \"type\": [\n \"integer\",\n \"null\"\n ]\n },\n \"question\": {\n \"type\": \"string\"\n },\n \"operator\": {\n \"type\": [\n \"string\",\n \"null\"\n ],\n \"enum\": [\n \"Scan\",\n \"Filter\",\n \"Aggregate\",\n \"Sort\",\n \"Top\",\n \"Join\",\n \"Union\",\n \"Intersect\",\n \"Except\",\n null\n ]\n },\n \"sub_questions\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#\"\n }\n }\n },\n \"required\": [\n \"index\",\n \"question\",\n \"operator\"\n ]\n}\n\nConversation Flow:\n1. User will provide the initial complex question\n2. You will:\n a. Choose an appropriate operator\n b. Decompose into sub-questions according to operator rules\n3. User will ask you to decompose one of the sub-questions if needed\n4. This process continues until we reach simple, directly answerable questions (Scan operations)\n\nImportant Rules:\n- Each decomposition MUST use exactly one operator from the valid list\n- Operator choice must be justified and appropriate for the question\n- Sub-questions must comply with the operator's requirements\n- Each sub-question should be simpler than the original question\n- Sub-questions should be clear and self-contained\n- Maintain context between decomposition steps\n- Use only tables and columns that exist in the provided schema\n",
"role": "system"
},
{
"content": "decompose the following question: Give the average number of working horses on farms with more than 5000 total horses.",
"role": "user"
},
{
"content": "{\"index\":1,\"question\":\"Give the average number of working horses on farms with more than 5000 total horses.\",\"operator\":\"Aggregate\",\"sub_questions\":[{\"index\":2,\"question\":\"Give the number of working horses on farms with more than 5000 total horses.\",\"operator\":null,\"sub_questions\":[]}]}",
"role": "assistant"
},
{
"content": "given the decomposition: {\"index\":1,\"question\":\"Give the average number of working horses on farms with more than 5000 total horses.\",\"operator\":\"Aggregate\",\"sub_questions\":[{\"index\":2,\"question\":\"Give the number of working horses on farms with more than 5000 total horses.\",\"operator\":null,\"sub_questions\":[]}]}\ndecompose the following question with index 2: Give the number of working horses on farms with more than 5000 total horses.",
"role": "user"
},
{
"content": "{\"index\":2,\"question\":\"Give the number of working horses on farms with more than 5000 total horses.\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
}
] |
dae782b20de5b18242610c758f4beb375baecff971e5b07ed80f18373ff1eca2_1
|
farm
|
Give the number of working horses on farms with more than 5000 total horses.
|
[
"#1 = Scan Table [ farm ] Predicate [ Total_Horses > 5000.0 ] Output [ Total_Horses , Working_Horses ]"
] |
[
"Give the number of working horses on farms with more than 5000 total horses."
] |
[
{
"content": "You are a question decomposition expert. You are given a database schema and a complex database input question in natural language, and your task is to break down the complex database input question into simpler sub-questions in a recursive way, like a tree. In each step you will be given a question to decompose, so that your answer will be the input for the next steps.\n\nInput Question:\nGive the average number of working horses on farms with more than 5000 total horses.\n\nDatabase Name:\nfarm\n\nDatabase Schema:\nCREATE TABLE city (\n\tCity_ID number,\n\tOfficial_Name text,\n\tStatus text,\n\tArea_km_2 number,\n\tPopulation number,\n\tCensus_Ranking text,\n\tprimary key ( City_ID )\n)\n\nCREATE TABLE farm (\n\tFarm_ID number,\n\tYear number,\n\tTotal_Horses number,\n\tWorking_Horses number,\n\tTotal_Cattle number,\n\tOxen number,\n\tBulls number,\n\tCows number,\n\tPigs number,\n\tSheep_and_Goats number,\n\tprimary key ( Farm_ID )\n)\n\nCREATE TABLE farm_competition (\n\tCompetition_ID number,\n\tYear number,\n\tTheme text,\n\tHost_city_ID number,\n\tHosts text,\n\tprimary key ( Competition_ID ),\n\tforeign key ( Host_city_ID ) references city ( City_ID )\n)\n\nCREATE TABLE competition_record (\n\tCompetition_ID number,\n\tFarm_ID number,\n\tRank number,\n\tprimary key ( Competition_ID , Farm_ID ),\n\tforeign key ( Farm_ID ) references farm ( Farm_ID ),\n\tforeign key ( Competition_ID ) references farm_competition ( Competition_ID )\n)\n\nValid Operators:\nThe following operators are available for query decomposition:\n- Scan: Direct table access with no sub-questions\n- Filter: Selection based on conditions\n- Aggregate: Group and compute aggregations\n- Sort: Order results\n- Topsort: Sort and limit results\n- Top: Limit results\n- Join: Combine two sub-queries\n- Except: Set difference between two sub-queries\n- Intersect: Set intersection between two sub-queries\n- Union: Set union of two sub-queries\n\nOperator Rules:\n1. Each decomposition MUST specify exactly one operator from the above list\n2. Operator constraints:\n - Scan: Cannot have sub-questions\n - Filter/Aggregate/Sort/Top/Topsort: Can have 1 sub-question\n - Join/Union/Intersect/Except: Must have exactly 2 sub-questions\n\nTask Description:\n1. You will receive a complex database question that needs to be decomposed\n2. For each question, you should:\n - First, determine the appropriate operator from the valid list\n - Then break it down into sub-questions according to the operator's rules\n - Explain how these sub-questions relate to the original question\n - Indicate the order in which these sub-questions should be answered\n\nResponse Format:\nFor each decomposition step, respond with this exact JSON format without any other text:\n{\n \"type\": \"object\",\n \"properties\": {\n \"index\": {\n \"type\": [\n \"integer\",\n \"null\"\n ]\n },\n \"question\": {\n \"type\": \"string\"\n },\n \"operator\": {\n \"type\": [\n \"string\",\n \"null\"\n ],\n \"enum\": [\n \"Scan\",\n \"Filter\",\n \"Aggregate\",\n \"Sort\",\n \"Top\",\n \"Join\",\n \"Union\",\n \"Intersect\",\n \"Except\",\n null\n ]\n },\n \"sub_questions\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#\"\n }\n }\n },\n \"required\": [\n \"index\",\n \"question\",\n \"operator\"\n ]\n}\n\nConversation Flow:\n1. User will provide the initial complex question\n2. You will:\n a. Choose an appropriate operator\n b. Decompose into sub-questions according to operator rules\n3. User will ask you to decompose one of the sub-questions if needed\n4. This process continues until we reach simple, directly answerable questions (Scan operations)\n\nImportant Rules:\n- Each decomposition MUST use exactly one operator from the valid list\n- Operator choice must be justified and appropriate for the question\n- Sub-questions must comply with the operator's requirements\n- Each sub-question should be simpler than the original question\n- Sub-questions should be clear and self-contained\n- Maintain context between decomposition steps\n- Use only tables and columns that exist in the provided schema\n",
"role": "system"
},
{
"content": "decompose the following question: Give the number of working horses on farms with more than 5000 total horses.",
"role": "user"
},
{
"content": "{\"index\":1,\"question\":\"Give the number of working horses on farms with more than 5000 total horses.\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
}
] |
01bcb75c2f1501f234259b80ba0a38bd37b6978d7354f269f4fdb62537b74c5c_0
|
farm
|
Give the average number of working horses on farms with more than 5000 total horses.
|
[
"#1 = Scan Table [ farm ] Predicate [ Total_Horses > 5000.0 ] Output [ Total_Horses , Working_Horses ]",
"#2 = Aggregate [ #1 ] Output [ AVG(Working_Horses) AS Avg_Working_Horses ]"
] |
[
"Give the number of working horses on farms with more than 5000 total horses.",
"Give the average number of working horses on farms with more than 5000 total horses."
] |
[
{
"content": "You are a question decomposition expert. You are given a database schema and a complex database input question in natural language, and your task is to break down the complex database input question into simpler sub-questions in a recursive way, like a tree. In each step you will be given a question to decompose, so that your answer will be the input for the next steps.\n\nInput Question:\nWhat is the average number of working horses of farms with more than 5000 total number of horses?\n\nDatabase Name:\nfarm\n\nDatabase Schema:\nCREATE TABLE city (\n\tCity_ID number,\n\tOfficial_Name text,\n\tStatus text,\n\tArea_km_2 number,\n\tPopulation number,\n\tCensus_Ranking text,\n\tprimary key ( City_ID )\n)\n\nCREATE TABLE farm (\n\tFarm_ID number,\n\tYear number,\n\tTotal_Horses number,\n\tWorking_Horses number,\n\tTotal_Cattle number,\n\tOxen number,\n\tBulls number,\n\tCows number,\n\tPigs number,\n\tSheep_and_Goats number,\n\tprimary key ( Farm_ID )\n)\n\nCREATE TABLE farm_competition (\n\tCompetition_ID number,\n\tYear number,\n\tTheme text,\n\tHost_city_ID number,\n\tHosts text,\n\tprimary key ( Competition_ID ),\n\tforeign key ( Host_city_ID ) references city ( City_ID )\n)\n\nCREATE TABLE competition_record (\n\tCompetition_ID number,\n\tFarm_ID number,\n\tRank number,\n\tprimary key ( Competition_ID , Farm_ID ),\n\tforeign key ( Farm_ID ) references farm ( Farm_ID ),\n\tforeign key ( Competition_ID ) references farm_competition ( Competition_ID )\n)\n\nValid Operators:\nThe following operators are available for query decomposition:\n- Scan: Direct table access with no sub-questions\n- Filter: Selection based on conditions\n- Aggregate: Group and compute aggregations\n- Sort: Order results\n- Topsort: Sort and limit results\n- Top: Limit results\n- Join: Combine two sub-queries\n- Except: Set difference between two sub-queries\n- Intersect: Set intersection between two sub-queries\n- Union: Set union of two sub-queries\n\nOperator Rules:\n1. Each decomposition MUST specify exactly one operator from the above list\n2. Operator constraints:\n - Scan: Cannot have sub-questions\n - Filter/Aggregate/Sort/Top/Topsort: Can have 1 sub-question\n - Join/Union/Intersect/Except: Must have exactly 2 sub-questions\n\nTask Description:\n1. You will receive a complex database question that needs to be decomposed\n2. For each question, you should:\n - First, determine the appropriate operator from the valid list\n - Then break it down into sub-questions according to the operator's rules\n - Explain how these sub-questions relate to the original question\n - Indicate the order in which these sub-questions should be answered\n\nResponse Format:\nFor each decomposition step, respond with this exact JSON format without any other text:\n{\n \"type\": \"object\",\n \"properties\": {\n \"index\": {\n \"type\": [\n \"integer\",\n \"null\"\n ]\n },\n \"question\": {\n \"type\": \"string\"\n },\n \"operator\": {\n \"type\": [\n \"string\",\n \"null\"\n ],\n \"enum\": [\n \"Scan\",\n \"Filter\",\n \"Aggregate\",\n \"Sort\",\n \"Top\",\n \"Join\",\n \"Union\",\n \"Intersect\",\n \"Except\",\n null\n ]\n },\n \"sub_questions\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#\"\n }\n }\n },\n \"required\": [\n \"index\",\n \"question\",\n \"operator\"\n ]\n}\n\nConversation Flow:\n1. User will provide the initial complex question\n2. You will:\n a. Choose an appropriate operator\n b. Decompose into sub-questions according to operator rules\n3. User will ask you to decompose one of the sub-questions if needed\n4. This process continues until we reach simple, directly answerable questions (Scan operations)\n\nImportant Rules:\n- Each decomposition MUST use exactly one operator from the valid list\n- Operator choice must be justified and appropriate for the question\n- Sub-questions must comply with the operator's requirements\n- Each sub-question should be simpler than the original question\n- Sub-questions should be clear and self-contained\n- Maintain context between decomposition steps\n- Use only tables and columns that exist in the provided schema\n",
"role": "system"
},
{
"content": "decompose the following question: Give the average number of working horses on farms with more than 5000 total horses.",
"role": "user"
},
{
"content": "{\"index\":1,\"question\":\"Give the average number of working horses on farms with more than 5000 total horses.\",\"operator\":\"Aggregate\",\"sub_questions\":[{\"index\":2,\"question\":\"Give the number of working horses on farms with more than 5000 total horses.\",\"operator\":null,\"sub_questions\":[]}]}",
"role": "assistant"
},
{
"content": "given the decomposition: {\"index\":1,\"question\":\"Give the average number of working horses on farms with more than 5000 total horses.\",\"operator\":\"Aggregate\",\"sub_questions\":[{\"index\":2,\"question\":\"Give the number of working horses on farms with more than 5000 total horses.\",\"operator\":null,\"sub_questions\":[]}]}\ndecompose the following question with index 2: Give the number of working horses on farms with more than 5000 total horses.",
"role": "user"
},
{
"content": "{\"index\":2,\"question\":\"Give the number of working horses on farms with more than 5000 total horses.\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
}
] |
01bcb75c2f1501f234259b80ba0a38bd37b6978d7354f269f4fdb62537b74c5c_1
|
farm
|
Give the number of working horses on farms with more than 5000 total horses.
|
[
"#1 = Scan Table [ farm ] Predicate [ Total_Horses > 5000.0 ] Output [ Total_Horses , Working_Horses ]"
] |
[
"Give the number of working horses on farms with more than 5000 total horses."
] |
[
{
"content": "You are a question decomposition expert. You are given a database schema and a complex database input question in natural language, and your task is to break down the complex database input question into simpler sub-questions in a recursive way, like a tree. In each step you will be given a question to decompose, so that your answer will be the input for the next steps.\n\nInput Question:\nWhat is the average number of working horses of farms with more than 5000 total number of horses?\n\nDatabase Name:\nfarm\n\nDatabase Schema:\nCREATE TABLE city (\n\tCity_ID number,\n\tOfficial_Name text,\n\tStatus text,\n\tArea_km_2 number,\n\tPopulation number,\n\tCensus_Ranking text,\n\tprimary key ( City_ID )\n)\n\nCREATE TABLE farm (\n\tFarm_ID number,\n\tYear number,\n\tTotal_Horses number,\n\tWorking_Horses number,\n\tTotal_Cattle number,\n\tOxen number,\n\tBulls number,\n\tCows number,\n\tPigs number,\n\tSheep_and_Goats number,\n\tprimary key ( Farm_ID )\n)\n\nCREATE TABLE farm_competition (\n\tCompetition_ID number,\n\tYear number,\n\tTheme text,\n\tHost_city_ID number,\n\tHosts text,\n\tprimary key ( Competition_ID ),\n\tforeign key ( Host_city_ID ) references city ( City_ID )\n)\n\nCREATE TABLE competition_record (\n\tCompetition_ID number,\n\tFarm_ID number,\n\tRank number,\n\tprimary key ( Competition_ID , Farm_ID ),\n\tforeign key ( Farm_ID ) references farm ( Farm_ID ),\n\tforeign key ( Competition_ID ) references farm_competition ( Competition_ID )\n)\n\nValid Operators:\nThe following operators are available for query decomposition:\n- Scan: Direct table access with no sub-questions\n- Filter: Selection based on conditions\n- Aggregate: Group and compute aggregations\n- Sort: Order results\n- Topsort: Sort and limit results\n- Top: Limit results\n- Join: Combine two sub-queries\n- Except: Set difference between two sub-queries\n- Intersect: Set intersection between two sub-queries\n- Union: Set union of two sub-queries\n\nOperator Rules:\n1. Each decomposition MUST specify exactly one operator from the above list\n2. Operator constraints:\n - Scan: Cannot have sub-questions\n - Filter/Aggregate/Sort/Top/Topsort: Can have 1 sub-question\n - Join/Union/Intersect/Except: Must have exactly 2 sub-questions\n\nTask Description:\n1. You will receive a complex database question that needs to be decomposed\n2. For each question, you should:\n - First, determine the appropriate operator from the valid list\n - Then break it down into sub-questions according to the operator's rules\n - Explain how these sub-questions relate to the original question\n - Indicate the order in which these sub-questions should be answered\n\nResponse Format:\nFor each decomposition step, respond with this exact JSON format without any other text:\n{\n \"type\": \"object\",\n \"properties\": {\n \"index\": {\n \"type\": [\n \"integer\",\n \"null\"\n ]\n },\n \"question\": {\n \"type\": \"string\"\n },\n \"operator\": {\n \"type\": [\n \"string\",\n \"null\"\n ],\n \"enum\": [\n \"Scan\",\n \"Filter\",\n \"Aggregate\",\n \"Sort\",\n \"Top\",\n \"Join\",\n \"Union\",\n \"Intersect\",\n \"Except\",\n null\n ]\n },\n \"sub_questions\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#\"\n }\n }\n },\n \"required\": [\n \"index\",\n \"question\",\n \"operator\"\n ]\n}\n\nConversation Flow:\n1. User will provide the initial complex question\n2. You will:\n a. Choose an appropriate operator\n b. Decompose into sub-questions according to operator rules\n3. User will ask you to decompose one of the sub-questions if needed\n4. This process continues until we reach simple, directly answerable questions (Scan operations)\n\nImportant Rules:\n- Each decomposition MUST use exactly one operator from the valid list\n- Operator choice must be justified and appropriate for the question\n- Sub-questions must comply with the operator's requirements\n- Each sub-question should be simpler than the original question\n- Sub-questions should be clear and self-contained\n- Maintain context between decomposition steps\n- Use only tables and columns that exist in the provided schema\n",
"role": "system"
},
{
"content": "decompose the following question: Give the number of working horses on farms with more than 5000 total horses.",
"role": "user"
},
{
"content": "{\"index\":1,\"question\":\"Give the number of working horses on farms with more than 5000 total horses.\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
}
] |
da69d487c871b3dbb14a08348231720204910489613652bfe03d4e9d848dc8b3_0
|
farm
|
Return the maximum and minimum number of cows across all farms.
|
[
"#1 = Scan Table [ farm ] Output [ Cows ]",
"#2 = Aggregate [ #1 ] Output [ MIN(Cows) AS Min_Cows , MAX(Cows) AS Max_Cows ]"
] |
[
"Return the number of cows on farms.",
"Return the maximum and minimum number of cows across all farms."
] |
[
{
"content": "You are a question decomposition expert. You are given a database schema and a complex database input question in natural language, and your task is to break down the complex database input question into simpler sub-questions in a recursive way, like a tree. In each step you will be given a question to decompose, so that your answer will be the input for the next steps.\n\nInput Question:\nReturn the maximum and minimum number of cows across all farms.\n\nDatabase Name:\nfarm\n\nDatabase Schema:\nCREATE TABLE city (\n\tCity_ID number,\n\tOfficial_Name text,\n\tStatus text,\n\tArea_km_2 number,\n\tPopulation number,\n\tCensus_Ranking text,\n\tprimary key ( City_ID )\n)\n\nCREATE TABLE farm (\n\tFarm_ID number,\n\tYear number,\n\tTotal_Horses number,\n\tWorking_Horses number,\n\tTotal_Cattle number,\n\tOxen number,\n\tBulls number,\n\tCows number,\n\tPigs number,\n\tSheep_and_Goats number,\n\tprimary key ( Farm_ID )\n)\n\nCREATE TABLE farm_competition (\n\tCompetition_ID number,\n\tYear number,\n\tTheme text,\n\tHost_city_ID number,\n\tHosts text,\n\tprimary key ( Competition_ID ),\n\tforeign key ( Host_city_ID ) references city ( City_ID )\n)\n\nCREATE TABLE competition_record (\n\tCompetition_ID number,\n\tFarm_ID number,\n\tRank number,\n\tprimary key ( Competition_ID , Farm_ID ),\n\tforeign key ( Farm_ID ) references farm ( Farm_ID ),\n\tforeign key ( Competition_ID ) references farm_competition ( Competition_ID )\n)\n\nValid Operators:\nThe following operators are available for query decomposition:\n- Scan: Direct table access with no sub-questions\n- Filter: Selection based on conditions\n- Aggregate: Group and compute aggregations\n- Sort: Order results\n- Topsort: Sort and limit results\n- Top: Limit results\n- Join: Combine two sub-queries\n- Except: Set difference between two sub-queries\n- Intersect: Set intersection between two sub-queries\n- Union: Set union of two sub-queries\n\nOperator Rules:\n1. Each decomposition MUST specify exactly one operator from the above list\n2. Operator constraints:\n - Scan: Cannot have sub-questions\n - Filter/Aggregate/Sort/Top/Topsort: Can have 1 sub-question\n - Join/Union/Intersect/Except: Must have exactly 2 sub-questions\n\nTask Description:\n1. You will receive a complex database question that needs to be decomposed\n2. For each question, you should:\n - First, determine the appropriate operator from the valid list\n - Then break it down into sub-questions according to the operator's rules\n - Explain how these sub-questions relate to the original question\n - Indicate the order in which these sub-questions should be answered\n\nResponse Format:\nFor each decomposition step, respond with this exact JSON format without any other text:\n{\n \"type\": \"object\",\n \"properties\": {\n \"index\": {\n \"type\": [\n \"integer\",\n \"null\"\n ]\n },\n \"question\": {\n \"type\": \"string\"\n },\n \"operator\": {\n \"type\": [\n \"string\",\n \"null\"\n ],\n \"enum\": [\n \"Scan\",\n \"Filter\",\n \"Aggregate\",\n \"Sort\",\n \"Top\",\n \"Join\",\n \"Union\",\n \"Intersect\",\n \"Except\",\n null\n ]\n },\n \"sub_questions\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#\"\n }\n }\n },\n \"required\": [\n \"index\",\n \"question\",\n \"operator\"\n ]\n}\n\nConversation Flow:\n1. User will provide the initial complex question\n2. You will:\n a. Choose an appropriate operator\n b. Decompose into sub-questions according to operator rules\n3. User will ask you to decompose one of the sub-questions if needed\n4. This process continues until we reach simple, directly answerable questions (Scan operations)\n\nImportant Rules:\n- Each decomposition MUST use exactly one operator from the valid list\n- Operator choice must be justified and appropriate for the question\n- Sub-questions must comply with the operator's requirements\n- Each sub-question should be simpler than the original question\n- Sub-questions should be clear and self-contained\n- Maintain context between decomposition steps\n- Use only tables and columns that exist in the provided schema\n",
"role": "system"
},
{
"content": "decompose the following question: Return the maximum and minimum number of cows across all farms.",
"role": "user"
},
{
"content": "{\"index\":1,\"question\":\"Return the maximum and minimum number of cows across all farms.\",\"operator\":\"Aggregate\",\"sub_questions\":[{\"index\":2,\"question\":\"Return the number of cows on farms.\",\"operator\":null,\"sub_questions\":[]}]}",
"role": "assistant"
},
{
"content": "given the decomposition: {\"index\":1,\"question\":\"Return the maximum and minimum number of cows across all farms.\",\"operator\":\"Aggregate\",\"sub_questions\":[{\"index\":2,\"question\":\"Return the number of cows on farms.\",\"operator\":null,\"sub_questions\":[]}]}\ndecompose the following question with index 2: Return the number of cows on farms.",
"role": "user"
},
{
"content": "{\"index\":2,\"question\":\"Return the number of cows on farms.\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
}
] |
da69d487c871b3dbb14a08348231720204910489613652bfe03d4e9d848dc8b3_1
|
farm
|
Return the number of cows on farms.
|
[
"#1 = Scan Table [ farm ] Output [ Cows ]"
] |
[
"Return the number of cows on farms."
] |
[
{
"content": "You are a question decomposition expert. You are given a database schema and a complex database input question in natural language, and your task is to break down the complex database input question into simpler sub-questions in a recursive way, like a tree. In each step you will be given a question to decompose, so that your answer will be the input for the next steps.\n\nInput Question:\nReturn the maximum and minimum number of cows across all farms.\n\nDatabase Name:\nfarm\n\nDatabase Schema:\nCREATE TABLE city (\n\tCity_ID number,\n\tOfficial_Name text,\n\tStatus text,\n\tArea_km_2 number,\n\tPopulation number,\n\tCensus_Ranking text,\n\tprimary key ( City_ID )\n)\n\nCREATE TABLE farm (\n\tFarm_ID number,\n\tYear number,\n\tTotal_Horses number,\n\tWorking_Horses number,\n\tTotal_Cattle number,\n\tOxen number,\n\tBulls number,\n\tCows number,\n\tPigs number,\n\tSheep_and_Goats number,\n\tprimary key ( Farm_ID )\n)\n\nCREATE TABLE farm_competition (\n\tCompetition_ID number,\n\tYear number,\n\tTheme text,\n\tHost_city_ID number,\n\tHosts text,\n\tprimary key ( Competition_ID ),\n\tforeign key ( Host_city_ID ) references city ( City_ID )\n)\n\nCREATE TABLE competition_record (\n\tCompetition_ID number,\n\tFarm_ID number,\n\tRank number,\n\tprimary key ( Competition_ID , Farm_ID ),\n\tforeign key ( Farm_ID ) references farm ( Farm_ID ),\n\tforeign key ( Competition_ID ) references farm_competition ( Competition_ID )\n)\n\nValid Operators:\nThe following operators are available for query decomposition:\n- Scan: Direct table access with no sub-questions\n- Filter: Selection based on conditions\n- Aggregate: Group and compute aggregations\n- Sort: Order results\n- Topsort: Sort and limit results\n- Top: Limit results\n- Join: Combine two sub-queries\n- Except: Set difference between two sub-queries\n- Intersect: Set intersection between two sub-queries\n- Union: Set union of two sub-queries\n\nOperator Rules:\n1. Each decomposition MUST specify exactly one operator from the above list\n2. Operator constraints:\n - Scan: Cannot have sub-questions\n - Filter/Aggregate/Sort/Top/Topsort: Can have 1 sub-question\n - Join/Union/Intersect/Except: Must have exactly 2 sub-questions\n\nTask Description:\n1. You will receive a complex database question that needs to be decomposed\n2. For each question, you should:\n - First, determine the appropriate operator from the valid list\n - Then break it down into sub-questions according to the operator's rules\n - Explain how these sub-questions relate to the original question\n - Indicate the order in which these sub-questions should be answered\n\nResponse Format:\nFor each decomposition step, respond with this exact JSON format without any other text:\n{\n \"type\": \"object\",\n \"properties\": {\n \"index\": {\n \"type\": [\n \"integer\",\n \"null\"\n ]\n },\n \"question\": {\n \"type\": \"string\"\n },\n \"operator\": {\n \"type\": [\n \"string\",\n \"null\"\n ],\n \"enum\": [\n \"Scan\",\n \"Filter\",\n \"Aggregate\",\n \"Sort\",\n \"Top\",\n \"Join\",\n \"Union\",\n \"Intersect\",\n \"Except\",\n null\n ]\n },\n \"sub_questions\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#\"\n }\n }\n },\n \"required\": [\n \"index\",\n \"question\",\n \"operator\"\n ]\n}\n\nConversation Flow:\n1. User will provide the initial complex question\n2. You will:\n a. Choose an appropriate operator\n b. Decompose into sub-questions according to operator rules\n3. User will ask you to decompose one of the sub-questions if needed\n4. This process continues until we reach simple, directly answerable questions (Scan operations)\n\nImportant Rules:\n- Each decomposition MUST use exactly one operator from the valid list\n- Operator choice must be justified and appropriate for the question\n- Sub-questions must comply with the operator's requirements\n- Each sub-question should be simpler than the original question\n- Sub-questions should be clear and self-contained\n- Maintain context between decomposition steps\n- Use only tables and columns that exist in the provided schema\n",
"role": "system"
},
{
"content": "decompose the following question: Return the number of cows on farms.",
"role": "user"
},
{
"content": "{\"index\":1,\"question\":\"Return the number of cows on farms.\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
}
] |
6870e259d7d217c97bf22d4164c3e4919d692594c98f51f902abc9c5daa1f6ae_0
|
farm
|
Return the maximum and minimum number of cows across all farms.
|
[
"#1 = Scan Table [ farm ] Output [ Cows ]",
"#2 = Aggregate [ #1 ] Output [ MIN(Cows) AS Min_Cows , MAX(Cows) AS Max_Cows ]"
] |
[
"Return the number of cows on farms.",
"Return the maximum and minimum number of cows across all farms."
] |
[
{
"content": "You are a question decomposition expert. You are given a database schema and a complex database input question in natural language, and your task is to break down the complex database input question into simpler sub-questions in a recursive way, like a tree. In each step you will be given a question to decompose, so that your answer will be the input for the next steps.\n\nInput Question:\nWhat are the maximum and minimum number of cows across all farms.\n\nDatabase Name:\nfarm\n\nDatabase Schema:\nCREATE TABLE city (\n\tCity_ID number,\n\tOfficial_Name text,\n\tStatus text,\n\tArea_km_2 number,\n\tPopulation number,\n\tCensus_Ranking text,\n\tprimary key ( City_ID )\n)\n\nCREATE TABLE farm (\n\tFarm_ID number,\n\tYear number,\n\tTotal_Horses number,\n\tWorking_Horses number,\n\tTotal_Cattle number,\n\tOxen number,\n\tBulls number,\n\tCows number,\n\tPigs number,\n\tSheep_and_Goats number,\n\tprimary key ( Farm_ID )\n)\n\nCREATE TABLE farm_competition (\n\tCompetition_ID number,\n\tYear number,\n\tTheme text,\n\tHost_city_ID number,\n\tHosts text,\n\tprimary key ( Competition_ID ),\n\tforeign key ( Host_city_ID ) references city ( City_ID )\n)\n\nCREATE TABLE competition_record (\n\tCompetition_ID number,\n\tFarm_ID number,\n\tRank number,\n\tprimary key ( Competition_ID , Farm_ID ),\n\tforeign key ( Farm_ID ) references farm ( Farm_ID ),\n\tforeign key ( Competition_ID ) references farm_competition ( Competition_ID )\n)\n\nValid Operators:\nThe following operators are available for query decomposition:\n- Scan: Direct table access with no sub-questions\n- Filter: Selection based on conditions\n- Aggregate: Group and compute aggregations\n- Sort: Order results\n- Topsort: Sort and limit results\n- Top: Limit results\n- Join: Combine two sub-queries\n- Except: Set difference between two sub-queries\n- Intersect: Set intersection between two sub-queries\n- Union: Set union of two sub-queries\n\nOperator Rules:\n1. Each decomposition MUST specify exactly one operator from the above list\n2. Operator constraints:\n - Scan: Cannot have sub-questions\n - Filter/Aggregate/Sort/Top/Topsort: Can have 1 sub-question\n - Join/Union/Intersect/Except: Must have exactly 2 sub-questions\n\nTask Description:\n1. You will receive a complex database question that needs to be decomposed\n2. For each question, you should:\n - First, determine the appropriate operator from the valid list\n - Then break it down into sub-questions according to the operator's rules\n - Explain how these sub-questions relate to the original question\n - Indicate the order in which these sub-questions should be answered\n\nResponse Format:\nFor each decomposition step, respond with this exact JSON format without any other text:\n{\n \"type\": \"object\",\n \"properties\": {\n \"index\": {\n \"type\": [\n \"integer\",\n \"null\"\n ]\n },\n \"question\": {\n \"type\": \"string\"\n },\n \"operator\": {\n \"type\": [\n \"string\",\n \"null\"\n ],\n \"enum\": [\n \"Scan\",\n \"Filter\",\n \"Aggregate\",\n \"Sort\",\n \"Top\",\n \"Join\",\n \"Union\",\n \"Intersect\",\n \"Except\",\n null\n ]\n },\n \"sub_questions\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#\"\n }\n }\n },\n \"required\": [\n \"index\",\n \"question\",\n \"operator\"\n ]\n}\n\nConversation Flow:\n1. User will provide the initial complex question\n2. You will:\n a. Choose an appropriate operator\n b. Decompose into sub-questions according to operator rules\n3. User will ask you to decompose one of the sub-questions if needed\n4. This process continues until we reach simple, directly answerable questions (Scan operations)\n\nImportant Rules:\n- Each decomposition MUST use exactly one operator from the valid list\n- Operator choice must be justified and appropriate for the question\n- Sub-questions must comply with the operator's requirements\n- Each sub-question should be simpler than the original question\n- Sub-questions should be clear and self-contained\n- Maintain context between decomposition steps\n- Use only tables and columns that exist in the provided schema\n",
"role": "system"
},
{
"content": "decompose the following question: Return the maximum and minimum number of cows across all farms.",
"role": "user"
},
{
"content": "{\"index\":1,\"question\":\"Return the maximum and minimum number of cows across all farms.\",\"operator\":\"Aggregate\",\"sub_questions\":[{\"index\":2,\"question\":\"Return the number of cows on farms.\",\"operator\":null,\"sub_questions\":[]}]}",
"role": "assistant"
},
{
"content": "given the decomposition: {\"index\":1,\"question\":\"Return the maximum and minimum number of cows across all farms.\",\"operator\":\"Aggregate\",\"sub_questions\":[{\"index\":2,\"question\":\"Return the number of cows on farms.\",\"operator\":null,\"sub_questions\":[]}]}\ndecompose the following question with index 2: Return the number of cows on farms.",
"role": "user"
},
{
"content": "{\"index\":2,\"question\":\"Return the number of cows on farms.\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
}
] |
6870e259d7d217c97bf22d4164c3e4919d692594c98f51f902abc9c5daa1f6ae_1
|
farm
|
Return the number of cows on farms.
|
[
"#1 = Scan Table [ farm ] Output [ Cows ]"
] |
[
"Return the number of cows on farms."
] |
[
{
"content": "You are a question decomposition expert. You are given a database schema and a complex database input question in natural language, and your task is to break down the complex database input question into simpler sub-questions in a recursive way, like a tree. In each step you will be given a question to decompose, so that your answer will be the input for the next steps.\n\nInput Question:\nWhat are the maximum and minimum number of cows across all farms.\n\nDatabase Name:\nfarm\n\nDatabase Schema:\nCREATE TABLE city (\n\tCity_ID number,\n\tOfficial_Name text,\n\tStatus text,\n\tArea_km_2 number,\n\tPopulation number,\n\tCensus_Ranking text,\n\tprimary key ( City_ID )\n)\n\nCREATE TABLE farm (\n\tFarm_ID number,\n\tYear number,\n\tTotal_Horses number,\n\tWorking_Horses number,\n\tTotal_Cattle number,\n\tOxen number,\n\tBulls number,\n\tCows number,\n\tPigs number,\n\tSheep_and_Goats number,\n\tprimary key ( Farm_ID )\n)\n\nCREATE TABLE farm_competition (\n\tCompetition_ID number,\n\tYear number,\n\tTheme text,\n\tHost_city_ID number,\n\tHosts text,\n\tprimary key ( Competition_ID ),\n\tforeign key ( Host_city_ID ) references city ( City_ID )\n)\n\nCREATE TABLE competition_record (\n\tCompetition_ID number,\n\tFarm_ID number,\n\tRank number,\n\tprimary key ( Competition_ID , Farm_ID ),\n\tforeign key ( Farm_ID ) references farm ( Farm_ID ),\n\tforeign key ( Competition_ID ) references farm_competition ( Competition_ID )\n)\n\nValid Operators:\nThe following operators are available for query decomposition:\n- Scan: Direct table access with no sub-questions\n- Filter: Selection based on conditions\n- Aggregate: Group and compute aggregations\n- Sort: Order results\n- Topsort: Sort and limit results\n- Top: Limit results\n- Join: Combine two sub-queries\n- Except: Set difference between two sub-queries\n- Intersect: Set intersection between two sub-queries\n- Union: Set union of two sub-queries\n\nOperator Rules:\n1. Each decomposition MUST specify exactly one operator from the above list\n2. Operator constraints:\n - Scan: Cannot have sub-questions\n - Filter/Aggregate/Sort/Top/Topsort: Can have 1 sub-question\n - Join/Union/Intersect/Except: Must have exactly 2 sub-questions\n\nTask Description:\n1. You will receive a complex database question that needs to be decomposed\n2. For each question, you should:\n - First, determine the appropriate operator from the valid list\n - Then break it down into sub-questions according to the operator's rules\n - Explain how these sub-questions relate to the original question\n - Indicate the order in which these sub-questions should be answered\n\nResponse Format:\nFor each decomposition step, respond with this exact JSON format without any other text:\n{\n \"type\": \"object\",\n \"properties\": {\n \"index\": {\n \"type\": [\n \"integer\",\n \"null\"\n ]\n },\n \"question\": {\n \"type\": \"string\"\n },\n \"operator\": {\n \"type\": [\n \"string\",\n \"null\"\n ],\n \"enum\": [\n \"Scan\",\n \"Filter\",\n \"Aggregate\",\n \"Sort\",\n \"Top\",\n \"Join\",\n \"Union\",\n \"Intersect\",\n \"Except\",\n null\n ]\n },\n \"sub_questions\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#\"\n }\n }\n },\n \"required\": [\n \"index\",\n \"question\",\n \"operator\"\n ]\n}\n\nConversation Flow:\n1. User will provide the initial complex question\n2. You will:\n a. Choose an appropriate operator\n b. Decompose into sub-questions according to operator rules\n3. User will ask you to decompose one of the sub-questions if needed\n4. This process continues until we reach simple, directly answerable questions (Scan operations)\n\nImportant Rules:\n- Each decomposition MUST use exactly one operator from the valid list\n- Operator choice must be justified and appropriate for the question\n- Sub-questions must comply with the operator's requirements\n- Each sub-question should be simpler than the original question\n- Sub-questions should be clear and self-contained\n- Maintain context between decomposition steps\n- Use only tables and columns that exist in the provided schema\n",
"role": "system"
},
{
"content": "decompose the following question: Return the number of cows on farms.",
"role": "user"
},
{
"content": "{\"index\":1,\"question\":\"Return the number of cows on farms.\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
}
] |
a76a419110e56eadea2f81a7d5b23d2d746db87b8cb4ae2ac5823862201aa999_0
|
farm
|
Count the number of different statuses.
|
[
"#1 = Scan Table [ city ] Distinct [ true ] Output [ Status ]",
"#2 = Aggregate [ #1 ] Output [ countstar AS Count_Star ]"
] |
[
"List the different statuses.",
"Count the number of different statuses."
] |
[
{
"content": "You are a question decomposition expert. You are given a database schema and a complex database input question in natural language, and your task is to break down the complex database input question into simpler sub-questions in a recursive way, like a tree. In each step you will be given a question to decompose, so that your answer will be the input for the next steps.\n\nInput Question:\nHow many different statuses do cities have?\n\nDatabase Name:\nfarm\n\nDatabase Schema:\nCREATE TABLE city (\n\tCity_ID number,\n\tOfficial_Name text,\n\tStatus text,\n\tArea_km_2 number,\n\tPopulation number,\n\tCensus_Ranking text,\n\tprimary key ( City_ID )\n)\n\nCREATE TABLE farm (\n\tFarm_ID number,\n\tYear number,\n\tTotal_Horses number,\n\tWorking_Horses number,\n\tTotal_Cattle number,\n\tOxen number,\n\tBulls number,\n\tCows number,\n\tPigs number,\n\tSheep_and_Goats number,\n\tprimary key ( Farm_ID )\n)\n\nCREATE TABLE farm_competition (\n\tCompetition_ID number,\n\tYear number,\n\tTheme text,\n\tHost_city_ID number,\n\tHosts text,\n\tprimary key ( Competition_ID ),\n\tforeign key ( Host_city_ID ) references city ( City_ID )\n)\n\nCREATE TABLE competition_record (\n\tCompetition_ID number,\n\tFarm_ID number,\n\tRank number,\n\tprimary key ( Competition_ID , Farm_ID ),\n\tforeign key ( Farm_ID ) references farm ( Farm_ID ),\n\tforeign key ( Competition_ID ) references farm_competition ( Competition_ID )\n)\n\nValid Operators:\nThe following operators are available for query decomposition:\n- Scan: Direct table access with no sub-questions\n- Filter: Selection based on conditions\n- Aggregate: Group and compute aggregations\n- Sort: Order results\n- Topsort: Sort and limit results\n- Top: Limit results\n- Join: Combine two sub-queries\n- Except: Set difference between two sub-queries\n- Intersect: Set intersection between two sub-queries\n- Union: Set union of two sub-queries\n\nOperator Rules:\n1. Each decomposition MUST specify exactly one operator from the above list\n2. Operator constraints:\n - Scan: Cannot have sub-questions\n - Filter/Aggregate/Sort/Top/Topsort: Can have 1 sub-question\n - Join/Union/Intersect/Except: Must have exactly 2 sub-questions\n\nTask Description:\n1. You will receive a complex database question that needs to be decomposed\n2. For each question, you should:\n - First, determine the appropriate operator from the valid list\n - Then break it down into sub-questions according to the operator's rules\n - Explain how these sub-questions relate to the original question\n - Indicate the order in which these sub-questions should be answered\n\nResponse Format:\nFor each decomposition step, respond with this exact JSON format without any other text:\n{\n \"type\": \"object\",\n \"properties\": {\n \"index\": {\n \"type\": [\n \"integer\",\n \"null\"\n ]\n },\n \"question\": {\n \"type\": \"string\"\n },\n \"operator\": {\n \"type\": [\n \"string\",\n \"null\"\n ],\n \"enum\": [\n \"Scan\",\n \"Filter\",\n \"Aggregate\",\n \"Sort\",\n \"Top\",\n \"Join\",\n \"Union\",\n \"Intersect\",\n \"Except\",\n null\n ]\n },\n \"sub_questions\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#\"\n }\n }\n },\n \"required\": [\n \"index\",\n \"question\",\n \"operator\"\n ]\n}\n\nConversation Flow:\n1. User will provide the initial complex question\n2. You will:\n a. Choose an appropriate operator\n b. Decompose into sub-questions according to operator rules\n3. User will ask you to decompose one of the sub-questions if needed\n4. This process continues until we reach simple, directly answerable questions (Scan operations)\n\nImportant Rules:\n- Each decomposition MUST use exactly one operator from the valid list\n- Operator choice must be justified and appropriate for the question\n- Sub-questions must comply with the operator's requirements\n- Each sub-question should be simpler than the original question\n- Sub-questions should be clear and self-contained\n- Maintain context between decomposition steps\n- Use only tables and columns that exist in the provided schema\n",
"role": "system"
},
{
"content": "decompose the following question: Count the number of different statuses.",
"role": "user"
},
{
"content": "{\"index\":1,\"question\":\"Count the number of different statuses.\",\"operator\":\"Aggregate\",\"sub_questions\":[{\"index\":2,\"question\":\"List the different statuses.\",\"operator\":null,\"sub_questions\":[]}]}",
"role": "assistant"
},
{
"content": "given the decomposition: {\"index\":1,\"question\":\"Count the number of different statuses.\",\"operator\":\"Aggregate\",\"sub_questions\":[{\"index\":2,\"question\":\"List the different statuses.\",\"operator\":null,\"sub_questions\":[]}]}\ndecompose the following question with index 2: List the different statuses.",
"role": "user"
},
{
"content": "{\"index\":2,\"question\":\"List the different statuses.\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
}
] |
a76a419110e56eadea2f81a7d5b23d2d746db87b8cb4ae2ac5823862201aa999_1
|
farm
|
List the different statuses.
|
[
"#1 = Scan Table [ city ] Distinct [ true ] Output [ Status ]"
] |
[
"List the different statuses."
] |
[
{
"content": "You are a question decomposition expert. You are given a database schema and a complex database input question in natural language, and your task is to break down the complex database input question into simpler sub-questions in a recursive way, like a tree. In each step you will be given a question to decompose, so that your answer will be the input for the next steps.\n\nInput Question:\nHow many different statuses do cities have?\n\nDatabase Name:\nfarm\n\nDatabase Schema:\nCREATE TABLE city (\n\tCity_ID number,\n\tOfficial_Name text,\n\tStatus text,\n\tArea_km_2 number,\n\tPopulation number,\n\tCensus_Ranking text,\n\tprimary key ( City_ID )\n)\n\nCREATE TABLE farm (\n\tFarm_ID number,\n\tYear number,\n\tTotal_Horses number,\n\tWorking_Horses number,\n\tTotal_Cattle number,\n\tOxen number,\n\tBulls number,\n\tCows number,\n\tPigs number,\n\tSheep_and_Goats number,\n\tprimary key ( Farm_ID )\n)\n\nCREATE TABLE farm_competition (\n\tCompetition_ID number,\n\tYear number,\n\tTheme text,\n\tHost_city_ID number,\n\tHosts text,\n\tprimary key ( Competition_ID ),\n\tforeign key ( Host_city_ID ) references city ( City_ID )\n)\n\nCREATE TABLE competition_record (\n\tCompetition_ID number,\n\tFarm_ID number,\n\tRank number,\n\tprimary key ( Competition_ID , Farm_ID ),\n\tforeign key ( Farm_ID ) references farm ( Farm_ID ),\n\tforeign key ( Competition_ID ) references farm_competition ( Competition_ID )\n)\n\nValid Operators:\nThe following operators are available for query decomposition:\n- Scan: Direct table access with no sub-questions\n- Filter: Selection based on conditions\n- Aggregate: Group and compute aggregations\n- Sort: Order results\n- Topsort: Sort and limit results\n- Top: Limit results\n- Join: Combine two sub-queries\n- Except: Set difference between two sub-queries\n- Intersect: Set intersection between two sub-queries\n- Union: Set union of two sub-queries\n\nOperator Rules:\n1. Each decomposition MUST specify exactly one operator from the above list\n2. Operator constraints:\n - Scan: Cannot have sub-questions\n - Filter/Aggregate/Sort/Top/Topsort: Can have 1 sub-question\n - Join/Union/Intersect/Except: Must have exactly 2 sub-questions\n\nTask Description:\n1. You will receive a complex database question that needs to be decomposed\n2. For each question, you should:\n - First, determine the appropriate operator from the valid list\n - Then break it down into sub-questions according to the operator's rules\n - Explain how these sub-questions relate to the original question\n - Indicate the order in which these sub-questions should be answered\n\nResponse Format:\nFor each decomposition step, respond with this exact JSON format without any other text:\n{\n \"type\": \"object\",\n \"properties\": {\n \"index\": {\n \"type\": [\n \"integer\",\n \"null\"\n ]\n },\n \"question\": {\n \"type\": \"string\"\n },\n \"operator\": {\n \"type\": [\n \"string\",\n \"null\"\n ],\n \"enum\": [\n \"Scan\",\n \"Filter\",\n \"Aggregate\",\n \"Sort\",\n \"Top\",\n \"Join\",\n \"Union\",\n \"Intersect\",\n \"Except\",\n null\n ]\n },\n \"sub_questions\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#\"\n }\n }\n },\n \"required\": [\n \"index\",\n \"question\",\n \"operator\"\n ]\n}\n\nConversation Flow:\n1. User will provide the initial complex question\n2. You will:\n a. Choose an appropriate operator\n b. Decompose into sub-questions according to operator rules\n3. User will ask you to decompose one of the sub-questions if needed\n4. This process continues until we reach simple, directly answerable questions (Scan operations)\n\nImportant Rules:\n- Each decomposition MUST use exactly one operator from the valid list\n- Operator choice must be justified and appropriate for the question\n- Sub-questions must comply with the operator's requirements\n- Each sub-question should be simpler than the original question\n- Sub-questions should be clear and self-contained\n- Maintain context between decomposition steps\n- Use only tables and columns that exist in the provided schema\n",
"role": "system"
},
{
"content": "decompose the following question: List the different statuses.",
"role": "user"
},
{
"content": "{\"index\":1,\"question\":\"List the different statuses.\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
}
] |
c5002a577bd5f2e184aa143e17fbbd7ef2fc32f8a3b1361776a2d49c155ed31c_0
|
farm
|
Count the number of different statuses.
|
[
"#1 = Scan Table [ city ] Distinct [ true ] Output [ Status ]",
"#2 = Aggregate [ #1 ] Output [ countstar AS Count_Star ]"
] |
[
"List the different statuses.",
"Count the number of different statuses."
] |
[
{
"content": "You are a question decomposition expert. You are given a database schema and a complex database input question in natural language, and your task is to break down the complex database input question into simpler sub-questions in a recursive way, like a tree. In each step you will be given a question to decompose, so that your answer will be the input for the next steps.\n\nInput Question:\nCount the number of different statuses.\n\nDatabase Name:\nfarm\n\nDatabase Schema:\nCREATE TABLE city (\n\tCity_ID number,\n\tOfficial_Name text,\n\tStatus text,\n\tArea_km_2 number,\n\tPopulation number,\n\tCensus_Ranking text,\n\tprimary key ( City_ID )\n)\n\nCREATE TABLE farm (\n\tFarm_ID number,\n\tYear number,\n\tTotal_Horses number,\n\tWorking_Horses number,\n\tTotal_Cattle number,\n\tOxen number,\n\tBulls number,\n\tCows number,\n\tPigs number,\n\tSheep_and_Goats number,\n\tprimary key ( Farm_ID )\n)\n\nCREATE TABLE farm_competition (\n\tCompetition_ID number,\n\tYear number,\n\tTheme text,\n\tHost_city_ID number,\n\tHosts text,\n\tprimary key ( Competition_ID ),\n\tforeign key ( Host_city_ID ) references city ( City_ID )\n)\n\nCREATE TABLE competition_record (\n\tCompetition_ID number,\n\tFarm_ID number,\n\tRank number,\n\tprimary key ( Competition_ID , Farm_ID ),\n\tforeign key ( Farm_ID ) references farm ( Farm_ID ),\n\tforeign key ( Competition_ID ) references farm_competition ( Competition_ID )\n)\n\nValid Operators:\nThe following operators are available for query decomposition:\n- Scan: Direct table access with no sub-questions\n- Filter: Selection based on conditions\n- Aggregate: Group and compute aggregations\n- Sort: Order results\n- Topsort: Sort and limit results\n- Top: Limit results\n- Join: Combine two sub-queries\n- Except: Set difference between two sub-queries\n- Intersect: Set intersection between two sub-queries\n- Union: Set union of two sub-queries\n\nOperator Rules:\n1. Each decomposition MUST specify exactly one operator from the above list\n2. Operator constraints:\n - Scan: Cannot have sub-questions\n - Filter/Aggregate/Sort/Top/Topsort: Can have 1 sub-question\n - Join/Union/Intersect/Except: Must have exactly 2 sub-questions\n\nTask Description:\n1. You will receive a complex database question that needs to be decomposed\n2. For each question, you should:\n - First, determine the appropriate operator from the valid list\n - Then break it down into sub-questions according to the operator's rules\n - Explain how these sub-questions relate to the original question\n - Indicate the order in which these sub-questions should be answered\n\nResponse Format:\nFor each decomposition step, respond with this exact JSON format without any other text:\n{\n \"type\": \"object\",\n \"properties\": {\n \"index\": {\n \"type\": [\n \"integer\",\n \"null\"\n ]\n },\n \"question\": {\n \"type\": \"string\"\n },\n \"operator\": {\n \"type\": [\n \"string\",\n \"null\"\n ],\n \"enum\": [\n \"Scan\",\n \"Filter\",\n \"Aggregate\",\n \"Sort\",\n \"Top\",\n \"Join\",\n \"Union\",\n \"Intersect\",\n \"Except\",\n null\n ]\n },\n \"sub_questions\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#\"\n }\n }\n },\n \"required\": [\n \"index\",\n \"question\",\n \"operator\"\n ]\n}\n\nConversation Flow:\n1. User will provide the initial complex question\n2. You will:\n a. Choose an appropriate operator\n b. Decompose into sub-questions according to operator rules\n3. User will ask you to decompose one of the sub-questions if needed\n4. This process continues until we reach simple, directly answerable questions (Scan operations)\n\nImportant Rules:\n- Each decomposition MUST use exactly one operator from the valid list\n- Operator choice must be justified and appropriate for the question\n- Sub-questions must comply with the operator's requirements\n- Each sub-question should be simpler than the original question\n- Sub-questions should be clear and self-contained\n- Maintain context between decomposition steps\n- Use only tables and columns that exist in the provided schema\n",
"role": "system"
},
{
"content": "decompose the following question: Count the number of different statuses.",
"role": "user"
},
{
"content": "{\"index\":1,\"question\":\"Count the number of different statuses.\",\"operator\":\"Aggregate\",\"sub_questions\":[{\"index\":2,\"question\":\"List the different statuses.\",\"operator\":null,\"sub_questions\":[]}]}",
"role": "assistant"
},
{
"content": "given the decomposition: {\"index\":1,\"question\":\"Count the number of different statuses.\",\"operator\":\"Aggregate\",\"sub_questions\":[{\"index\":2,\"question\":\"List the different statuses.\",\"operator\":null,\"sub_questions\":[]}]}\ndecompose the following question with index 2: List the different statuses.",
"role": "user"
},
{
"content": "{\"index\":2,\"question\":\"List the different statuses.\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
}
] |
c5002a577bd5f2e184aa143e17fbbd7ef2fc32f8a3b1361776a2d49c155ed31c_1
|
farm
|
List the different statuses.
|
[
"#1 = Scan Table [ city ] Distinct [ true ] Output [ Status ]"
] |
[
"List the different statuses."
] |
[
{
"content": "You are a question decomposition expert. You are given a database schema and a complex database input question in natural language, and your task is to break down the complex database input question into simpler sub-questions in a recursive way, like a tree. In each step you will be given a question to decompose, so that your answer will be the input for the next steps.\n\nInput Question:\nCount the number of different statuses.\n\nDatabase Name:\nfarm\n\nDatabase Schema:\nCREATE TABLE city (\n\tCity_ID number,\n\tOfficial_Name text,\n\tStatus text,\n\tArea_km_2 number,\n\tPopulation number,\n\tCensus_Ranking text,\n\tprimary key ( City_ID )\n)\n\nCREATE TABLE farm (\n\tFarm_ID number,\n\tYear number,\n\tTotal_Horses number,\n\tWorking_Horses number,\n\tTotal_Cattle number,\n\tOxen number,\n\tBulls number,\n\tCows number,\n\tPigs number,\n\tSheep_and_Goats number,\n\tprimary key ( Farm_ID )\n)\n\nCREATE TABLE farm_competition (\n\tCompetition_ID number,\n\tYear number,\n\tTheme text,\n\tHost_city_ID number,\n\tHosts text,\n\tprimary key ( Competition_ID ),\n\tforeign key ( Host_city_ID ) references city ( City_ID )\n)\n\nCREATE TABLE competition_record (\n\tCompetition_ID number,\n\tFarm_ID number,\n\tRank number,\n\tprimary key ( Competition_ID , Farm_ID ),\n\tforeign key ( Farm_ID ) references farm ( Farm_ID ),\n\tforeign key ( Competition_ID ) references farm_competition ( Competition_ID )\n)\n\nValid Operators:\nThe following operators are available for query decomposition:\n- Scan: Direct table access with no sub-questions\n- Filter: Selection based on conditions\n- Aggregate: Group and compute aggregations\n- Sort: Order results\n- Topsort: Sort and limit results\n- Top: Limit results\n- Join: Combine two sub-queries\n- Except: Set difference between two sub-queries\n- Intersect: Set intersection between two sub-queries\n- Union: Set union of two sub-queries\n\nOperator Rules:\n1. Each decomposition MUST specify exactly one operator from the above list\n2. Operator constraints:\n - Scan: Cannot have sub-questions\n - Filter/Aggregate/Sort/Top/Topsort: Can have 1 sub-question\n - Join/Union/Intersect/Except: Must have exactly 2 sub-questions\n\nTask Description:\n1. You will receive a complex database question that needs to be decomposed\n2. For each question, you should:\n - First, determine the appropriate operator from the valid list\n - Then break it down into sub-questions according to the operator's rules\n - Explain how these sub-questions relate to the original question\n - Indicate the order in which these sub-questions should be answered\n\nResponse Format:\nFor each decomposition step, respond with this exact JSON format without any other text:\n{\n \"type\": \"object\",\n \"properties\": {\n \"index\": {\n \"type\": [\n \"integer\",\n \"null\"\n ]\n },\n \"question\": {\n \"type\": \"string\"\n },\n \"operator\": {\n \"type\": [\n \"string\",\n \"null\"\n ],\n \"enum\": [\n \"Scan\",\n \"Filter\",\n \"Aggregate\",\n \"Sort\",\n \"Top\",\n \"Join\",\n \"Union\",\n \"Intersect\",\n \"Except\",\n null\n ]\n },\n \"sub_questions\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#\"\n }\n }\n },\n \"required\": [\n \"index\",\n \"question\",\n \"operator\"\n ]\n}\n\nConversation Flow:\n1. User will provide the initial complex question\n2. You will:\n a. Choose an appropriate operator\n b. Decompose into sub-questions according to operator rules\n3. User will ask you to decompose one of the sub-questions if needed\n4. This process continues until we reach simple, directly answerable questions (Scan operations)\n\nImportant Rules:\n- Each decomposition MUST use exactly one operator from the valid list\n- Operator choice must be justified and appropriate for the question\n- Sub-questions must comply with the operator's requirements\n- Each sub-question should be simpler than the original question\n- Sub-questions should be clear and self-contained\n- Maintain context between decomposition steps\n- Use only tables and columns that exist in the provided schema\n",
"role": "system"
},
{
"content": "decompose the following question: List the different statuses.",
"role": "user"
},
{
"content": "{\"index\":1,\"question\":\"List the different statuses.\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
}
] |
917d34f46620f84960e9c1ebef602465a57055601e972e2ec637a716d4e012f0_0
|
farm
|
What are the official names of cities, ordered descending by population?
|
[
"#1 = Scan Table [ city ] Output [ Population , Official_Name ]",
"#2 = Sort [ #1 ] OrderBy [ Population DESC ] Output [ Population , Official_Name ]"
] |
[
"What are the official names and population of all cities?",
"What are the official names of cities, ordered descending by population?"
] |
[
{
"content": "You are a question decomposition expert. You are given a database schema and a complex database input question in natural language, and your task is to break down the complex database input question into simpler sub-questions in a recursive way, like a tree. In each step you will be given a question to decompose, so that your answer will be the input for the next steps.\n\nInput Question:\nWhat are the official names of cities, ordered descending by population?\n\nDatabase Name:\nfarm\n\nDatabase Schema:\nCREATE TABLE city (\n\tCity_ID number,\n\tOfficial_Name text,\n\tStatus text,\n\tArea_km_2 number,\n\tPopulation number,\n\tCensus_Ranking text,\n\tprimary key ( City_ID )\n)\n\nCREATE TABLE farm (\n\tFarm_ID number,\n\tYear number,\n\tTotal_Horses number,\n\tWorking_Horses number,\n\tTotal_Cattle number,\n\tOxen number,\n\tBulls number,\n\tCows number,\n\tPigs number,\n\tSheep_and_Goats number,\n\tprimary key ( Farm_ID )\n)\n\nCREATE TABLE farm_competition (\n\tCompetition_ID number,\n\tYear number,\n\tTheme text,\n\tHost_city_ID number,\n\tHosts text,\n\tprimary key ( Competition_ID ),\n\tforeign key ( Host_city_ID ) references city ( City_ID )\n)\n\nCREATE TABLE competition_record (\n\tCompetition_ID number,\n\tFarm_ID number,\n\tRank number,\n\tprimary key ( Competition_ID , Farm_ID ),\n\tforeign key ( Farm_ID ) references farm ( Farm_ID ),\n\tforeign key ( Competition_ID ) references farm_competition ( Competition_ID )\n)\n\nValid Operators:\nThe following operators are available for query decomposition:\n- Scan: Direct table access with no sub-questions\n- Filter: Selection based on conditions\n- Aggregate: Group and compute aggregations\n- Sort: Order results\n- Topsort: Sort and limit results\n- Top: Limit results\n- Join: Combine two sub-queries\n- Except: Set difference between two sub-queries\n- Intersect: Set intersection between two sub-queries\n- Union: Set union of two sub-queries\n\nOperator Rules:\n1. Each decomposition MUST specify exactly one operator from the above list\n2. Operator constraints:\n - Scan: Cannot have sub-questions\n - Filter/Aggregate/Sort/Top/Topsort: Can have 1 sub-question\n - Join/Union/Intersect/Except: Must have exactly 2 sub-questions\n\nTask Description:\n1. You will receive a complex database question that needs to be decomposed\n2. For each question, you should:\n - First, determine the appropriate operator from the valid list\n - Then break it down into sub-questions according to the operator's rules\n - Explain how these sub-questions relate to the original question\n - Indicate the order in which these sub-questions should be answered\n\nResponse Format:\nFor each decomposition step, respond with this exact JSON format without any other text:\n{\n \"type\": \"object\",\n \"properties\": {\n \"index\": {\n \"type\": [\n \"integer\",\n \"null\"\n ]\n },\n \"question\": {\n \"type\": \"string\"\n },\n \"operator\": {\n \"type\": [\n \"string\",\n \"null\"\n ],\n \"enum\": [\n \"Scan\",\n \"Filter\",\n \"Aggregate\",\n \"Sort\",\n \"Top\",\n \"Join\",\n \"Union\",\n \"Intersect\",\n \"Except\",\n null\n ]\n },\n \"sub_questions\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#\"\n }\n }\n },\n \"required\": [\n \"index\",\n \"question\",\n \"operator\"\n ]\n}\n\nConversation Flow:\n1. User will provide the initial complex question\n2. You will:\n a. Choose an appropriate operator\n b. Decompose into sub-questions according to operator rules\n3. User will ask you to decompose one of the sub-questions if needed\n4. This process continues until we reach simple, directly answerable questions (Scan operations)\n\nImportant Rules:\n- Each decomposition MUST use exactly one operator from the valid list\n- Operator choice must be justified and appropriate for the question\n- Sub-questions must comply with the operator's requirements\n- Each sub-question should be simpler than the original question\n- Sub-questions should be clear and self-contained\n- Maintain context between decomposition steps\n- Use only tables and columns that exist in the provided schema\n",
"role": "system"
},
{
"content": "decompose the following question: What are the official names of cities, ordered descending by population?",
"role": "user"
},
{
"content": "{\"index\":1,\"question\":\"What are the official names of cities, ordered descending by population?\",\"operator\":\"Sort\",\"sub_questions\":[{\"index\":2,\"question\":\"What are the official names and population of all cities?\",\"operator\":null,\"sub_questions\":[]}]}",
"role": "assistant"
},
{
"content": "given the decomposition: {\"index\":1,\"question\":\"What are the official names of cities, ordered descending by population?\",\"operator\":\"Sort\",\"sub_questions\":[{\"index\":2,\"question\":\"What are the official names and population of all cities?\",\"operator\":null,\"sub_questions\":[]}]}\ndecompose the following question with index 2: What are the official names and population of all cities?",
"role": "user"
},
{
"content": "{\"index\":2,\"question\":\"What are the official names and population of all cities?\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
}
] |
917d34f46620f84960e9c1ebef602465a57055601e972e2ec637a716d4e012f0_1
|
farm
|
What are the official names and population of all cities?
|
[
"#1 = Scan Table [ city ] Output [ Population , Official_Name ]"
] |
[
"What are the official names and population of all cities?"
] |
[
{
"content": "You are a question decomposition expert. You are given a database schema and a complex database input question in natural language, and your task is to break down the complex database input question into simpler sub-questions in a recursive way, like a tree. In each step you will be given a question to decompose, so that your answer will be the input for the next steps.\n\nInput Question:\nWhat are the official names of cities, ordered descending by population?\n\nDatabase Name:\nfarm\n\nDatabase Schema:\nCREATE TABLE city (\n\tCity_ID number,\n\tOfficial_Name text,\n\tStatus text,\n\tArea_km_2 number,\n\tPopulation number,\n\tCensus_Ranking text,\n\tprimary key ( City_ID )\n)\n\nCREATE TABLE farm (\n\tFarm_ID number,\n\tYear number,\n\tTotal_Horses number,\n\tWorking_Horses number,\n\tTotal_Cattle number,\n\tOxen number,\n\tBulls number,\n\tCows number,\n\tPigs number,\n\tSheep_and_Goats number,\n\tprimary key ( Farm_ID )\n)\n\nCREATE TABLE farm_competition (\n\tCompetition_ID number,\n\tYear number,\n\tTheme text,\n\tHost_city_ID number,\n\tHosts text,\n\tprimary key ( Competition_ID ),\n\tforeign key ( Host_city_ID ) references city ( City_ID )\n)\n\nCREATE TABLE competition_record (\n\tCompetition_ID number,\n\tFarm_ID number,\n\tRank number,\n\tprimary key ( Competition_ID , Farm_ID ),\n\tforeign key ( Farm_ID ) references farm ( Farm_ID ),\n\tforeign key ( Competition_ID ) references farm_competition ( Competition_ID )\n)\n\nValid Operators:\nThe following operators are available for query decomposition:\n- Scan: Direct table access with no sub-questions\n- Filter: Selection based on conditions\n- Aggregate: Group and compute aggregations\n- Sort: Order results\n- Topsort: Sort and limit results\n- Top: Limit results\n- Join: Combine two sub-queries\n- Except: Set difference between two sub-queries\n- Intersect: Set intersection between two sub-queries\n- Union: Set union of two sub-queries\n\nOperator Rules:\n1. Each decomposition MUST specify exactly one operator from the above list\n2. Operator constraints:\n - Scan: Cannot have sub-questions\n - Filter/Aggregate/Sort/Top/Topsort: Can have 1 sub-question\n - Join/Union/Intersect/Except: Must have exactly 2 sub-questions\n\nTask Description:\n1. You will receive a complex database question that needs to be decomposed\n2. For each question, you should:\n - First, determine the appropriate operator from the valid list\n - Then break it down into sub-questions according to the operator's rules\n - Explain how these sub-questions relate to the original question\n - Indicate the order in which these sub-questions should be answered\n\nResponse Format:\nFor each decomposition step, respond with this exact JSON format without any other text:\n{\n \"type\": \"object\",\n \"properties\": {\n \"index\": {\n \"type\": [\n \"integer\",\n \"null\"\n ]\n },\n \"question\": {\n \"type\": \"string\"\n },\n \"operator\": {\n \"type\": [\n \"string\",\n \"null\"\n ],\n \"enum\": [\n \"Scan\",\n \"Filter\",\n \"Aggregate\",\n \"Sort\",\n \"Top\",\n \"Join\",\n \"Union\",\n \"Intersect\",\n \"Except\",\n null\n ]\n },\n \"sub_questions\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#\"\n }\n }\n },\n \"required\": [\n \"index\",\n \"question\",\n \"operator\"\n ]\n}\n\nConversation Flow:\n1. User will provide the initial complex question\n2. You will:\n a. Choose an appropriate operator\n b. Decompose into sub-questions according to operator rules\n3. User will ask you to decompose one of the sub-questions if needed\n4. This process continues until we reach simple, directly answerable questions (Scan operations)\n\nImportant Rules:\n- Each decomposition MUST use exactly one operator from the valid list\n- Operator choice must be justified and appropriate for the question\n- Sub-questions must comply with the operator's requirements\n- Each sub-question should be simpler than the original question\n- Sub-questions should be clear and self-contained\n- Maintain context between decomposition steps\n- Use only tables and columns that exist in the provided schema\n",
"role": "system"
},
{
"content": "decompose the following question: What are the official names and population of all cities?",
"role": "user"
},
{
"content": "{\"index\":1,\"question\":\"What are the official names and population of all cities?\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
}
] |
2b3c60db750ba52e1c491cf07f780b12b155e7cd235127357a0858a9608ae5dd_0
|
farm
|
What are the official names of cities, ordered descending by population?
|
[
"#1 = Scan Table [ city ] Output [ Population , Official_Name ]",
"#2 = Sort [ #1 ] OrderBy [ Population DESC ] Output [ Population , Official_Name ]"
] |
[
"What are the official names and population of all cities?",
"What are the official names of cities, ordered descending by population?"
] |
[
{
"content": "You are a question decomposition expert. You are given a database schema and a complex database input question in natural language, and your task is to break down the complex database input question into simpler sub-questions in a recursive way, like a tree. In each step you will be given a question to decompose, so that your answer will be the input for the next steps.\n\nInput Question:\nList official names of cities in descending order of population.\n\nDatabase Name:\nfarm\n\nDatabase Schema:\nCREATE TABLE city (\n\tCity_ID number,\n\tOfficial_Name text,\n\tStatus text,\n\tArea_km_2 number,\n\tPopulation number,\n\tCensus_Ranking text,\n\tprimary key ( City_ID )\n)\n\nCREATE TABLE farm (\n\tFarm_ID number,\n\tYear number,\n\tTotal_Horses number,\n\tWorking_Horses number,\n\tTotal_Cattle number,\n\tOxen number,\n\tBulls number,\n\tCows number,\n\tPigs number,\n\tSheep_and_Goats number,\n\tprimary key ( Farm_ID )\n)\n\nCREATE TABLE farm_competition (\n\tCompetition_ID number,\n\tYear number,\n\tTheme text,\n\tHost_city_ID number,\n\tHosts text,\n\tprimary key ( Competition_ID ),\n\tforeign key ( Host_city_ID ) references city ( City_ID )\n)\n\nCREATE TABLE competition_record (\n\tCompetition_ID number,\n\tFarm_ID number,\n\tRank number,\n\tprimary key ( Competition_ID , Farm_ID ),\n\tforeign key ( Farm_ID ) references farm ( Farm_ID ),\n\tforeign key ( Competition_ID ) references farm_competition ( Competition_ID )\n)\n\nValid Operators:\nThe following operators are available for query decomposition:\n- Scan: Direct table access with no sub-questions\n- Filter: Selection based on conditions\n- Aggregate: Group and compute aggregations\n- Sort: Order results\n- Topsort: Sort and limit results\n- Top: Limit results\n- Join: Combine two sub-queries\n- Except: Set difference between two sub-queries\n- Intersect: Set intersection between two sub-queries\n- Union: Set union of two sub-queries\n\nOperator Rules:\n1. Each decomposition MUST specify exactly one operator from the above list\n2. Operator constraints:\n - Scan: Cannot have sub-questions\n - Filter/Aggregate/Sort/Top/Topsort: Can have 1 sub-question\n - Join/Union/Intersect/Except: Must have exactly 2 sub-questions\n\nTask Description:\n1. You will receive a complex database question that needs to be decomposed\n2. For each question, you should:\n - First, determine the appropriate operator from the valid list\n - Then break it down into sub-questions according to the operator's rules\n - Explain how these sub-questions relate to the original question\n - Indicate the order in which these sub-questions should be answered\n\nResponse Format:\nFor each decomposition step, respond with this exact JSON format without any other text:\n{\n \"type\": \"object\",\n \"properties\": {\n \"index\": {\n \"type\": [\n \"integer\",\n \"null\"\n ]\n },\n \"question\": {\n \"type\": \"string\"\n },\n \"operator\": {\n \"type\": [\n \"string\",\n \"null\"\n ],\n \"enum\": [\n \"Scan\",\n \"Filter\",\n \"Aggregate\",\n \"Sort\",\n \"Top\",\n \"Join\",\n \"Union\",\n \"Intersect\",\n \"Except\",\n null\n ]\n },\n \"sub_questions\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#\"\n }\n }\n },\n \"required\": [\n \"index\",\n \"question\",\n \"operator\"\n ]\n}\n\nConversation Flow:\n1. User will provide the initial complex question\n2. You will:\n a. Choose an appropriate operator\n b. Decompose into sub-questions according to operator rules\n3. User will ask you to decompose one of the sub-questions if needed\n4. This process continues until we reach simple, directly answerable questions (Scan operations)\n\nImportant Rules:\n- Each decomposition MUST use exactly one operator from the valid list\n- Operator choice must be justified and appropriate for the question\n- Sub-questions must comply with the operator's requirements\n- Each sub-question should be simpler than the original question\n- Sub-questions should be clear and self-contained\n- Maintain context between decomposition steps\n- Use only tables and columns that exist in the provided schema\n",
"role": "system"
},
{
"content": "decompose the following question: What are the official names of cities, ordered descending by population?",
"role": "user"
},
{
"content": "{\"index\":1,\"question\":\"What are the official names of cities, ordered descending by population?\",\"operator\":\"Sort\",\"sub_questions\":[{\"index\":2,\"question\":\"What are the official names and population of all cities?\",\"operator\":null,\"sub_questions\":[]}]}",
"role": "assistant"
},
{
"content": "given the decomposition: {\"index\":1,\"question\":\"What are the official names of cities, ordered descending by population?\",\"operator\":\"Sort\",\"sub_questions\":[{\"index\":2,\"question\":\"What are the official names and population of all cities?\",\"operator\":null,\"sub_questions\":[]}]}\ndecompose the following question with index 2: What are the official names and population of all cities?",
"role": "user"
},
{
"content": "{\"index\":2,\"question\":\"What are the official names and population of all cities?\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
}
] |
2b3c60db750ba52e1c491cf07f780b12b155e7cd235127357a0858a9608ae5dd_1
|
farm
|
What are the official names and population of all cities?
|
[
"#1 = Scan Table [ city ] Output [ Population , Official_Name ]"
] |
[
"What are the official names and population of all cities?"
] |
[
{
"content": "You are a question decomposition expert. You are given a database schema and a complex database input question in natural language, and your task is to break down the complex database input question into simpler sub-questions in a recursive way, like a tree. In each step you will be given a question to decompose, so that your answer will be the input for the next steps.\n\nInput Question:\nList official names of cities in descending order of population.\n\nDatabase Name:\nfarm\n\nDatabase Schema:\nCREATE TABLE city (\n\tCity_ID number,\n\tOfficial_Name text,\n\tStatus text,\n\tArea_km_2 number,\n\tPopulation number,\n\tCensus_Ranking text,\n\tprimary key ( City_ID )\n)\n\nCREATE TABLE farm (\n\tFarm_ID number,\n\tYear number,\n\tTotal_Horses number,\n\tWorking_Horses number,\n\tTotal_Cattle number,\n\tOxen number,\n\tBulls number,\n\tCows number,\n\tPigs number,\n\tSheep_and_Goats number,\n\tprimary key ( Farm_ID )\n)\n\nCREATE TABLE farm_competition (\n\tCompetition_ID number,\n\tYear number,\n\tTheme text,\n\tHost_city_ID number,\n\tHosts text,\n\tprimary key ( Competition_ID ),\n\tforeign key ( Host_city_ID ) references city ( City_ID )\n)\n\nCREATE TABLE competition_record (\n\tCompetition_ID number,\n\tFarm_ID number,\n\tRank number,\n\tprimary key ( Competition_ID , Farm_ID ),\n\tforeign key ( Farm_ID ) references farm ( Farm_ID ),\n\tforeign key ( Competition_ID ) references farm_competition ( Competition_ID )\n)\n\nValid Operators:\nThe following operators are available for query decomposition:\n- Scan: Direct table access with no sub-questions\n- Filter: Selection based on conditions\n- Aggregate: Group and compute aggregations\n- Sort: Order results\n- Topsort: Sort and limit results\n- Top: Limit results\n- Join: Combine two sub-queries\n- Except: Set difference between two sub-queries\n- Intersect: Set intersection between two sub-queries\n- Union: Set union of two sub-queries\n\nOperator Rules:\n1. Each decomposition MUST specify exactly one operator from the above list\n2. Operator constraints:\n - Scan: Cannot have sub-questions\n - Filter/Aggregate/Sort/Top/Topsort: Can have 1 sub-question\n - Join/Union/Intersect/Except: Must have exactly 2 sub-questions\n\nTask Description:\n1. You will receive a complex database question that needs to be decomposed\n2. For each question, you should:\n - First, determine the appropriate operator from the valid list\n - Then break it down into sub-questions according to the operator's rules\n - Explain how these sub-questions relate to the original question\n - Indicate the order in which these sub-questions should be answered\n\nResponse Format:\nFor each decomposition step, respond with this exact JSON format without any other text:\n{\n \"type\": \"object\",\n \"properties\": {\n \"index\": {\n \"type\": [\n \"integer\",\n \"null\"\n ]\n },\n \"question\": {\n \"type\": \"string\"\n },\n \"operator\": {\n \"type\": [\n \"string\",\n \"null\"\n ],\n \"enum\": [\n \"Scan\",\n \"Filter\",\n \"Aggregate\",\n \"Sort\",\n \"Top\",\n \"Join\",\n \"Union\",\n \"Intersect\",\n \"Except\",\n null\n ]\n },\n \"sub_questions\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#\"\n }\n }\n },\n \"required\": [\n \"index\",\n \"question\",\n \"operator\"\n ]\n}\n\nConversation Flow:\n1. User will provide the initial complex question\n2. You will:\n a. Choose an appropriate operator\n b. Decompose into sub-questions according to operator rules\n3. User will ask you to decompose one of the sub-questions if needed\n4. This process continues until we reach simple, directly answerable questions (Scan operations)\n\nImportant Rules:\n- Each decomposition MUST use exactly one operator from the valid list\n- Operator choice must be justified and appropriate for the question\n- Sub-questions must comply with the operator's requirements\n- Each sub-question should be simpler than the original question\n- Sub-questions should be clear and self-contained\n- Maintain context between decomposition steps\n- Use only tables and columns that exist in the provided schema\n",
"role": "system"
},
{
"content": "decompose the following question: What are the official names and population of all cities?",
"role": "user"
},
{
"content": "{\"index\":1,\"question\":\"What are the official names and population of all cities?\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
}
] |
eac2fc782ad4c08f1a019056f19bd25411c5ba476a026fe8c345b5e91669485a_0
|
farm
|
List the official name and status of the city with the largest population.
|
[
"#1 = Scan Table [ city ] Output [ Population , Status , Official_Name ]",
"#2 = TopSort [ #1 ] Rows [ 1 ] OrderBy [ Population DESC ] Output [ Population , Status , Official_Name ]"
] |
[
"List the official name, status and population of all cities.",
"List the official name and status of the city with the largest population."
] |
[
{
"content": "You are a question decomposition expert. You are given a database schema and a complex database input question in natural language, and your task is to break down the complex database input question into simpler sub-questions in a recursive way, like a tree. In each step you will be given a question to decompose, so that your answer will be the input for the next steps.\n\nInput Question:\nList the official name and status of the city with the largest population.\n\nDatabase Name:\nfarm\n\nDatabase Schema:\nCREATE TABLE city (\n\tCity_ID number,\n\tOfficial_Name text,\n\tStatus text,\n\tArea_km_2 number,\n\tPopulation number,\n\tCensus_Ranking text,\n\tprimary key ( City_ID )\n)\n\nCREATE TABLE farm (\n\tFarm_ID number,\n\tYear number,\n\tTotal_Horses number,\n\tWorking_Horses number,\n\tTotal_Cattle number,\n\tOxen number,\n\tBulls number,\n\tCows number,\n\tPigs number,\n\tSheep_and_Goats number,\n\tprimary key ( Farm_ID )\n)\n\nCREATE TABLE farm_competition (\n\tCompetition_ID number,\n\tYear number,\n\tTheme text,\n\tHost_city_ID number,\n\tHosts text,\n\tprimary key ( Competition_ID ),\n\tforeign key ( Host_city_ID ) references city ( City_ID )\n)\n\nCREATE TABLE competition_record (\n\tCompetition_ID number,\n\tFarm_ID number,\n\tRank number,\n\tprimary key ( Competition_ID , Farm_ID ),\n\tforeign key ( Farm_ID ) references farm ( Farm_ID ),\n\tforeign key ( Competition_ID ) references farm_competition ( Competition_ID )\n)\n\nValid Operators:\nThe following operators are available for query decomposition:\n- Scan: Direct table access with no sub-questions\n- Filter: Selection based on conditions\n- Aggregate: Group and compute aggregations\n- Sort: Order results\n- Topsort: Sort and limit results\n- Top: Limit results\n- Join: Combine two sub-queries\n- Except: Set difference between two sub-queries\n- Intersect: Set intersection between two sub-queries\n- Union: Set union of two sub-queries\n\nOperator Rules:\n1. Each decomposition MUST specify exactly one operator from the above list\n2. Operator constraints:\n - Scan: Cannot have sub-questions\n - Filter/Aggregate/Sort/Top/Topsort: Can have 1 sub-question\n - Join/Union/Intersect/Except: Must have exactly 2 sub-questions\n\nTask Description:\n1. You will receive a complex database question that needs to be decomposed\n2. For each question, you should:\n - First, determine the appropriate operator from the valid list\n - Then break it down into sub-questions according to the operator's rules\n - Explain how these sub-questions relate to the original question\n - Indicate the order in which these sub-questions should be answered\n\nResponse Format:\nFor each decomposition step, respond with this exact JSON format without any other text:\n{\n \"type\": \"object\",\n \"properties\": {\n \"index\": {\n \"type\": [\n \"integer\",\n \"null\"\n ]\n },\n \"question\": {\n \"type\": \"string\"\n },\n \"operator\": {\n \"type\": [\n \"string\",\n \"null\"\n ],\n \"enum\": [\n \"Scan\",\n \"Filter\",\n \"Aggregate\",\n \"Sort\",\n \"Top\",\n \"Join\",\n \"Union\",\n \"Intersect\",\n \"Except\",\n null\n ]\n },\n \"sub_questions\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#\"\n }\n }\n },\n \"required\": [\n \"index\",\n \"question\",\n \"operator\"\n ]\n}\n\nConversation Flow:\n1. User will provide the initial complex question\n2. You will:\n a. Choose an appropriate operator\n b. Decompose into sub-questions according to operator rules\n3. User will ask you to decompose one of the sub-questions if needed\n4. This process continues until we reach simple, directly answerable questions (Scan operations)\n\nImportant Rules:\n- Each decomposition MUST use exactly one operator from the valid list\n- Operator choice must be justified and appropriate for the question\n- Sub-questions must comply with the operator's requirements\n- Each sub-question should be simpler than the original question\n- Sub-questions should be clear and self-contained\n- Maintain context between decomposition steps\n- Use only tables and columns that exist in the provided schema\n",
"role": "system"
},
{
"content": "decompose the following question: List the official name and status of the city with the largest population.",
"role": "user"
},
{
"content": "{\"index\":1,\"question\":\"List the official name and status of the city with the largest population.\",\"operator\":\"TopSort\",\"sub_questions\":[{\"index\":2,\"question\":\"List the official name, status and population of all cities.\",\"operator\":null,\"sub_questions\":[]}]}",
"role": "assistant"
},
{
"content": "given the decomposition: {\"index\":1,\"question\":\"List the official name and status of the city with the largest population.\",\"operator\":\"TopSort\",\"sub_questions\":[{\"index\":2,\"question\":\"List the official name, status and population of all cities.\",\"operator\":null,\"sub_questions\":[]}]}\ndecompose the following question with index 2: List the official name, status and population of all cities.",
"role": "user"
},
{
"content": "{\"index\":2,\"question\":\"List the official name, status and population of all cities.\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
}
] |
eac2fc782ad4c08f1a019056f19bd25411c5ba476a026fe8c345b5e91669485a_1
|
farm
|
List the official name, status and population of all cities.
|
[
"#1 = Scan Table [ city ] Output [ Population , Status , Official_Name ]"
] |
[
"List the official name, status and population of all cities."
] |
[
{
"content": "You are a question decomposition expert. You are given a database schema and a complex database input question in natural language, and your task is to break down the complex database input question into simpler sub-questions in a recursive way, like a tree. In each step you will be given a question to decompose, so that your answer will be the input for the next steps.\n\nInput Question:\nList the official name and status of the city with the largest population.\n\nDatabase Name:\nfarm\n\nDatabase Schema:\nCREATE TABLE city (\n\tCity_ID number,\n\tOfficial_Name text,\n\tStatus text,\n\tArea_km_2 number,\n\tPopulation number,\n\tCensus_Ranking text,\n\tprimary key ( City_ID )\n)\n\nCREATE TABLE farm (\n\tFarm_ID number,\n\tYear number,\n\tTotal_Horses number,\n\tWorking_Horses number,\n\tTotal_Cattle number,\n\tOxen number,\n\tBulls number,\n\tCows number,\n\tPigs number,\n\tSheep_and_Goats number,\n\tprimary key ( Farm_ID )\n)\n\nCREATE TABLE farm_competition (\n\tCompetition_ID number,\n\tYear number,\n\tTheme text,\n\tHost_city_ID number,\n\tHosts text,\n\tprimary key ( Competition_ID ),\n\tforeign key ( Host_city_ID ) references city ( City_ID )\n)\n\nCREATE TABLE competition_record (\n\tCompetition_ID number,\n\tFarm_ID number,\n\tRank number,\n\tprimary key ( Competition_ID , Farm_ID ),\n\tforeign key ( Farm_ID ) references farm ( Farm_ID ),\n\tforeign key ( Competition_ID ) references farm_competition ( Competition_ID )\n)\n\nValid Operators:\nThe following operators are available for query decomposition:\n- Scan: Direct table access with no sub-questions\n- Filter: Selection based on conditions\n- Aggregate: Group and compute aggregations\n- Sort: Order results\n- Topsort: Sort and limit results\n- Top: Limit results\n- Join: Combine two sub-queries\n- Except: Set difference between two sub-queries\n- Intersect: Set intersection between two sub-queries\n- Union: Set union of two sub-queries\n\nOperator Rules:\n1. Each decomposition MUST specify exactly one operator from the above list\n2. Operator constraints:\n - Scan: Cannot have sub-questions\n - Filter/Aggregate/Sort/Top/Topsort: Can have 1 sub-question\n - Join/Union/Intersect/Except: Must have exactly 2 sub-questions\n\nTask Description:\n1. You will receive a complex database question that needs to be decomposed\n2. For each question, you should:\n - First, determine the appropriate operator from the valid list\n - Then break it down into sub-questions according to the operator's rules\n - Explain how these sub-questions relate to the original question\n - Indicate the order in which these sub-questions should be answered\n\nResponse Format:\nFor each decomposition step, respond with this exact JSON format without any other text:\n{\n \"type\": \"object\",\n \"properties\": {\n \"index\": {\n \"type\": [\n \"integer\",\n \"null\"\n ]\n },\n \"question\": {\n \"type\": \"string\"\n },\n \"operator\": {\n \"type\": [\n \"string\",\n \"null\"\n ],\n \"enum\": [\n \"Scan\",\n \"Filter\",\n \"Aggregate\",\n \"Sort\",\n \"Top\",\n \"Join\",\n \"Union\",\n \"Intersect\",\n \"Except\",\n null\n ]\n },\n \"sub_questions\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#\"\n }\n }\n },\n \"required\": [\n \"index\",\n \"question\",\n \"operator\"\n ]\n}\n\nConversation Flow:\n1. User will provide the initial complex question\n2. You will:\n a. Choose an appropriate operator\n b. Decompose into sub-questions according to operator rules\n3. User will ask you to decompose one of the sub-questions if needed\n4. This process continues until we reach simple, directly answerable questions (Scan operations)\n\nImportant Rules:\n- Each decomposition MUST use exactly one operator from the valid list\n- Operator choice must be justified and appropriate for the question\n- Sub-questions must comply with the operator's requirements\n- Each sub-question should be simpler than the original question\n- Sub-questions should be clear and self-contained\n- Maintain context between decomposition steps\n- Use only tables and columns that exist in the provided schema\n",
"role": "system"
},
{
"content": "decompose the following question: List the official name, status and population of all cities.",
"role": "user"
},
{
"content": "{\"index\":1,\"question\":\"List the official name, status and population of all cities.\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
}
] |
6e117912c192d88de1aafca02cf34ff911fe869980cc5016aff1f41a2b3a1b8a_0
|
farm
|
List the official name and status of the city with the largest population.
|
[
"#1 = Scan Table [ city ] Output [ Population , Status , Official_Name ]",
"#2 = TopSort [ #1 ] Rows [ 1 ] OrderBy [ Population DESC ] Output [ Population , Status , Official_Name ]"
] |
[
"List the official name, status and population of all cities.",
"List the official name and status of the city with the largest population."
] |
[
{
"content": "You are a question decomposition expert. You are given a database schema and a complex database input question in natural language, and your task is to break down the complex database input question into simpler sub-questions in a recursive way, like a tree. In each step you will be given a question to decompose, so that your answer will be the input for the next steps.\n\nInput Question:\nWhat is the official name and status of the city with the most residents?\n\nDatabase Name:\nfarm\n\nDatabase Schema:\nCREATE TABLE city (\n\tCity_ID number,\n\tOfficial_Name text,\n\tStatus text,\n\tArea_km_2 number,\n\tPopulation number,\n\tCensus_Ranking text,\n\tprimary key ( City_ID )\n)\n\nCREATE TABLE farm (\n\tFarm_ID number,\n\tYear number,\n\tTotal_Horses number,\n\tWorking_Horses number,\n\tTotal_Cattle number,\n\tOxen number,\n\tBulls number,\n\tCows number,\n\tPigs number,\n\tSheep_and_Goats number,\n\tprimary key ( Farm_ID )\n)\n\nCREATE TABLE farm_competition (\n\tCompetition_ID number,\n\tYear number,\n\tTheme text,\n\tHost_city_ID number,\n\tHosts text,\n\tprimary key ( Competition_ID ),\n\tforeign key ( Host_city_ID ) references city ( City_ID )\n)\n\nCREATE TABLE competition_record (\n\tCompetition_ID number,\n\tFarm_ID number,\n\tRank number,\n\tprimary key ( Competition_ID , Farm_ID ),\n\tforeign key ( Farm_ID ) references farm ( Farm_ID ),\n\tforeign key ( Competition_ID ) references farm_competition ( Competition_ID )\n)\n\nValid Operators:\nThe following operators are available for query decomposition:\n- Scan: Direct table access with no sub-questions\n- Filter: Selection based on conditions\n- Aggregate: Group and compute aggregations\n- Sort: Order results\n- Topsort: Sort and limit results\n- Top: Limit results\n- Join: Combine two sub-queries\n- Except: Set difference between two sub-queries\n- Intersect: Set intersection between two sub-queries\n- Union: Set union of two sub-queries\n\nOperator Rules:\n1. Each decomposition MUST specify exactly one operator from the above list\n2. Operator constraints:\n - Scan: Cannot have sub-questions\n - Filter/Aggregate/Sort/Top/Topsort: Can have 1 sub-question\n - Join/Union/Intersect/Except: Must have exactly 2 sub-questions\n\nTask Description:\n1. You will receive a complex database question that needs to be decomposed\n2. For each question, you should:\n - First, determine the appropriate operator from the valid list\n - Then break it down into sub-questions according to the operator's rules\n - Explain how these sub-questions relate to the original question\n - Indicate the order in which these sub-questions should be answered\n\nResponse Format:\nFor each decomposition step, respond with this exact JSON format without any other text:\n{\n \"type\": \"object\",\n \"properties\": {\n \"index\": {\n \"type\": [\n \"integer\",\n \"null\"\n ]\n },\n \"question\": {\n \"type\": \"string\"\n },\n \"operator\": {\n \"type\": [\n \"string\",\n \"null\"\n ],\n \"enum\": [\n \"Scan\",\n \"Filter\",\n \"Aggregate\",\n \"Sort\",\n \"Top\",\n \"Join\",\n \"Union\",\n \"Intersect\",\n \"Except\",\n null\n ]\n },\n \"sub_questions\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#\"\n }\n }\n },\n \"required\": [\n \"index\",\n \"question\",\n \"operator\"\n ]\n}\n\nConversation Flow:\n1. User will provide the initial complex question\n2. You will:\n a. Choose an appropriate operator\n b. Decompose into sub-questions according to operator rules\n3. User will ask you to decompose one of the sub-questions if needed\n4. This process continues until we reach simple, directly answerable questions (Scan operations)\n\nImportant Rules:\n- Each decomposition MUST use exactly one operator from the valid list\n- Operator choice must be justified and appropriate for the question\n- Sub-questions must comply with the operator's requirements\n- Each sub-question should be simpler than the original question\n- Sub-questions should be clear and self-contained\n- Maintain context between decomposition steps\n- Use only tables and columns that exist in the provided schema\n",
"role": "system"
},
{
"content": "decompose the following question: List the official name and status of the city with the largest population.",
"role": "user"
},
{
"content": "{\"index\":1,\"question\":\"List the official name and status of the city with the largest population.\",\"operator\":\"TopSort\",\"sub_questions\":[{\"index\":2,\"question\":\"List the official name, status and population of all cities.\",\"operator\":null,\"sub_questions\":[]}]}",
"role": "assistant"
},
{
"content": "given the decomposition: {\"index\":1,\"question\":\"List the official name and status of the city with the largest population.\",\"operator\":\"TopSort\",\"sub_questions\":[{\"index\":2,\"question\":\"List the official name, status and population of all cities.\",\"operator\":null,\"sub_questions\":[]}]}\ndecompose the following question with index 2: List the official name, status and population of all cities.",
"role": "user"
},
{
"content": "{\"index\":2,\"question\":\"List the official name, status and population of all cities.\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
}
] |
6e117912c192d88de1aafca02cf34ff911fe869980cc5016aff1f41a2b3a1b8a_1
|
farm
|
List the official name, status and population of all cities.
|
[
"#1 = Scan Table [ city ] Output [ Population , Status , Official_Name ]"
] |
[
"List the official name, status and population of all cities."
] |
[
{
"content": "You are a question decomposition expert. You are given a database schema and a complex database input question in natural language, and your task is to break down the complex database input question into simpler sub-questions in a recursive way, like a tree. In each step you will be given a question to decompose, so that your answer will be the input for the next steps.\n\nInput Question:\nWhat is the official name and status of the city with the most residents?\n\nDatabase Name:\nfarm\n\nDatabase Schema:\nCREATE TABLE city (\n\tCity_ID number,\n\tOfficial_Name text,\n\tStatus text,\n\tArea_km_2 number,\n\tPopulation number,\n\tCensus_Ranking text,\n\tprimary key ( City_ID )\n)\n\nCREATE TABLE farm (\n\tFarm_ID number,\n\tYear number,\n\tTotal_Horses number,\n\tWorking_Horses number,\n\tTotal_Cattle number,\n\tOxen number,\n\tBulls number,\n\tCows number,\n\tPigs number,\n\tSheep_and_Goats number,\n\tprimary key ( Farm_ID )\n)\n\nCREATE TABLE farm_competition (\n\tCompetition_ID number,\n\tYear number,\n\tTheme text,\n\tHost_city_ID number,\n\tHosts text,\n\tprimary key ( Competition_ID ),\n\tforeign key ( Host_city_ID ) references city ( City_ID )\n)\n\nCREATE TABLE competition_record (\n\tCompetition_ID number,\n\tFarm_ID number,\n\tRank number,\n\tprimary key ( Competition_ID , Farm_ID ),\n\tforeign key ( Farm_ID ) references farm ( Farm_ID ),\n\tforeign key ( Competition_ID ) references farm_competition ( Competition_ID )\n)\n\nValid Operators:\nThe following operators are available for query decomposition:\n- Scan: Direct table access with no sub-questions\n- Filter: Selection based on conditions\n- Aggregate: Group and compute aggregations\n- Sort: Order results\n- Topsort: Sort and limit results\n- Top: Limit results\n- Join: Combine two sub-queries\n- Except: Set difference between two sub-queries\n- Intersect: Set intersection between two sub-queries\n- Union: Set union of two sub-queries\n\nOperator Rules:\n1. Each decomposition MUST specify exactly one operator from the above list\n2. Operator constraints:\n - Scan: Cannot have sub-questions\n - Filter/Aggregate/Sort/Top/Topsort: Can have 1 sub-question\n - Join/Union/Intersect/Except: Must have exactly 2 sub-questions\n\nTask Description:\n1. You will receive a complex database question that needs to be decomposed\n2. For each question, you should:\n - First, determine the appropriate operator from the valid list\n - Then break it down into sub-questions according to the operator's rules\n - Explain how these sub-questions relate to the original question\n - Indicate the order in which these sub-questions should be answered\n\nResponse Format:\nFor each decomposition step, respond with this exact JSON format without any other text:\n{\n \"type\": \"object\",\n \"properties\": {\n \"index\": {\n \"type\": [\n \"integer\",\n \"null\"\n ]\n },\n \"question\": {\n \"type\": \"string\"\n },\n \"operator\": {\n \"type\": [\n \"string\",\n \"null\"\n ],\n \"enum\": [\n \"Scan\",\n \"Filter\",\n \"Aggregate\",\n \"Sort\",\n \"Top\",\n \"Join\",\n \"Union\",\n \"Intersect\",\n \"Except\",\n null\n ]\n },\n \"sub_questions\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#\"\n }\n }\n },\n \"required\": [\n \"index\",\n \"question\",\n \"operator\"\n ]\n}\n\nConversation Flow:\n1. User will provide the initial complex question\n2. You will:\n a. Choose an appropriate operator\n b. Decompose into sub-questions according to operator rules\n3. User will ask you to decompose one of the sub-questions if needed\n4. This process continues until we reach simple, directly answerable questions (Scan operations)\n\nImportant Rules:\n- Each decomposition MUST use exactly one operator from the valid list\n- Operator choice must be justified and appropriate for the question\n- Sub-questions must comply with the operator's requirements\n- Each sub-question should be simpler than the original question\n- Sub-questions should be clear and self-contained\n- Maintain context between decomposition steps\n- Use only tables and columns that exist in the provided schema\n",
"role": "system"
},
{
"content": "decompose the following question: List the official name, status and population of all cities.",
"role": "user"
},
{
"content": "{\"index\":1,\"question\":\"List the official name, status and population of all cities.\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
}
] |
7a233282b2e29514b51b842774abff3f6a95db80c23f805c0f383e5e940e1730_0
|
farm
|
Show the years and the official names of the host cities of competitions.
|
[
"#1 = Scan Table [ farm_competition ] Output [ Year , Host_city_ID ]",
"#2 = Scan Table [ city ] Output [ City_ID , Official_Name ]",
"#3 = Join [ #1 , #2 ] Predicate [ #1.Host_city_ID = #2.City_ID ] Output [ #1.Year , #2.Official_Name ]"
] |
[
"Show the years and the ids of the host cities of competitions.",
"Show the ids and official names of all cities.",
"Show the years and the official names of the host cities of competitions."
] |
[
{
"content": "You are a question decomposition expert. You are given a database schema and a complex database input question in natural language, and your task is to break down the complex database input question into simpler sub-questions in a recursive way, like a tree. In each step you will be given a question to decompose, so that your answer will be the input for the next steps.\n\nInput Question:\nShow the years and the official names of the host cities of competitions.\n\nDatabase Name:\nfarm\n\nDatabase Schema:\nCREATE TABLE city (\n\tCity_ID number,\n\tOfficial_Name text,\n\tStatus text,\n\tArea_km_2 number,\n\tPopulation number,\n\tCensus_Ranking text,\n\tprimary key ( City_ID )\n)\n\nCREATE TABLE farm (\n\tFarm_ID number,\n\tYear number,\n\tTotal_Horses number,\n\tWorking_Horses number,\n\tTotal_Cattle number,\n\tOxen number,\n\tBulls number,\n\tCows number,\n\tPigs number,\n\tSheep_and_Goats number,\n\tprimary key ( Farm_ID )\n)\n\nCREATE TABLE farm_competition (\n\tCompetition_ID number,\n\tYear number,\n\tTheme text,\n\tHost_city_ID number,\n\tHosts text,\n\tprimary key ( Competition_ID ),\n\tforeign key ( Host_city_ID ) references city ( City_ID )\n)\n\nCREATE TABLE competition_record (\n\tCompetition_ID number,\n\tFarm_ID number,\n\tRank number,\n\tprimary key ( Competition_ID , Farm_ID ),\n\tforeign key ( Farm_ID ) references farm ( Farm_ID ),\n\tforeign key ( Competition_ID ) references farm_competition ( Competition_ID )\n)\n\nValid Operators:\nThe following operators are available for query decomposition:\n- Scan: Direct table access with no sub-questions\n- Filter: Selection based on conditions\n- Aggregate: Group and compute aggregations\n- Sort: Order results\n- Topsort: Sort and limit results\n- Top: Limit results\n- Join: Combine two sub-queries\n- Except: Set difference between two sub-queries\n- Intersect: Set intersection between two sub-queries\n- Union: Set union of two sub-queries\n\nOperator Rules:\n1. Each decomposition MUST specify exactly one operator from the above list\n2. Operator constraints:\n - Scan: Cannot have sub-questions\n - Filter/Aggregate/Sort/Top/Topsort: Can have 1 sub-question\n - Join/Union/Intersect/Except: Must have exactly 2 sub-questions\n\nTask Description:\n1. You will receive a complex database question that needs to be decomposed\n2. For each question, you should:\n - First, determine the appropriate operator from the valid list\n - Then break it down into sub-questions according to the operator's rules\n - Explain how these sub-questions relate to the original question\n - Indicate the order in which these sub-questions should be answered\n\nResponse Format:\nFor each decomposition step, respond with this exact JSON format without any other text:\n{\n \"type\": \"object\",\n \"properties\": {\n \"index\": {\n \"type\": [\n \"integer\",\n \"null\"\n ]\n },\n \"question\": {\n \"type\": \"string\"\n },\n \"operator\": {\n \"type\": [\n \"string\",\n \"null\"\n ],\n \"enum\": [\n \"Scan\",\n \"Filter\",\n \"Aggregate\",\n \"Sort\",\n \"Top\",\n \"Join\",\n \"Union\",\n \"Intersect\",\n \"Except\",\n null\n ]\n },\n \"sub_questions\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#\"\n }\n }\n },\n \"required\": [\n \"index\",\n \"question\",\n \"operator\"\n ]\n}\n\nConversation Flow:\n1. User will provide the initial complex question\n2. You will:\n a. Choose an appropriate operator\n b. Decompose into sub-questions according to operator rules\n3. User will ask you to decompose one of the sub-questions if needed\n4. This process continues until we reach simple, directly answerable questions (Scan operations)\n\nImportant Rules:\n- Each decomposition MUST use exactly one operator from the valid list\n- Operator choice must be justified and appropriate for the question\n- Sub-questions must comply with the operator's requirements\n- Each sub-question should be simpler than the original question\n- Sub-questions should be clear and self-contained\n- Maintain context between decomposition steps\n- Use only tables and columns that exist in the provided schema\n",
"role": "system"
},
{
"content": "decompose the following question: Show the years and the official names of the host cities of competitions.",
"role": "user"
},
{
"content": "{\"index\":1,\"question\":\"Show the years and the official names of the host cities of competitions.\",\"operator\":\"Join\",\"sub_questions\":[{\"index\":2,\"question\":\"Show the years and the ids of the host cities of competitions.\",\"operator\":null,\"sub_questions\":[]},{\"index\":3,\"question\":\"Show the ids and official names of all cities.\",\"operator\":null,\"sub_questions\":[]}]}",
"role": "assistant"
},
{
"content": "given the decomposition: {\"index\":1,\"question\":\"Show the years and the official names of the host cities of competitions.\",\"operator\":\"Join\",\"sub_questions\":[{\"index\":2,\"question\":\"Show the years and the ids of the host cities of competitions.\",\"operator\":null,\"sub_questions\":[]},{\"index\":3,\"question\":\"Show the ids and official names of all cities.\",\"operator\":null,\"sub_questions\":[]}]}\ndecompose the following question with index 2: Show the years and the ids of the host cities of competitions.",
"role": "user"
},
{
"content": "{\"index\":2,\"question\":\"Show the years and the ids of the host cities of competitions.\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
},
{
"content": "given the decomposition: {\"index\":1,\"question\":\"Show the years and the official names of the host cities of competitions.\",\"operator\":\"Join\",\"sub_questions\":[{\"index\":2,\"question\":\"Show the years and the ids of the host cities of competitions.\",\"operator\":\"Scan\",\"sub_questions\":[]},{\"index\":3,\"question\":\"Show the ids and official names of all cities.\",\"operator\":null,\"sub_questions\":[]}]}\ndecompose the following question with index 3: Show the ids and official names of all cities.",
"role": "user"
},
{
"content": "{\"index\":3,\"question\":\"Show the ids and official names of all cities.\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
}
] |
7a233282b2e29514b51b842774abff3f6a95db80c23f805c0f383e5e940e1730_1
|
farm
|
Show the years and the ids of the host cities of competitions.
|
[
"#1 = Scan Table [ farm_competition ] Output [ Year , Host_city_ID ]"
] |
[
"Show the years and the ids of the host cities of competitions."
] |
[
{
"content": "You are a question decomposition expert. You are given a database schema and a complex database input question in natural language, and your task is to break down the complex database input question into simpler sub-questions in a recursive way, like a tree. In each step you will be given a question to decompose, so that your answer will be the input for the next steps.\n\nInput Question:\nShow the years and the official names of the host cities of competitions.\n\nDatabase Name:\nfarm\n\nDatabase Schema:\nCREATE TABLE city (\n\tCity_ID number,\n\tOfficial_Name text,\n\tStatus text,\n\tArea_km_2 number,\n\tPopulation number,\n\tCensus_Ranking text,\n\tprimary key ( City_ID )\n)\n\nCREATE TABLE farm (\n\tFarm_ID number,\n\tYear number,\n\tTotal_Horses number,\n\tWorking_Horses number,\n\tTotal_Cattle number,\n\tOxen number,\n\tBulls number,\n\tCows number,\n\tPigs number,\n\tSheep_and_Goats number,\n\tprimary key ( Farm_ID )\n)\n\nCREATE TABLE farm_competition (\n\tCompetition_ID number,\n\tYear number,\n\tTheme text,\n\tHost_city_ID number,\n\tHosts text,\n\tprimary key ( Competition_ID ),\n\tforeign key ( Host_city_ID ) references city ( City_ID )\n)\n\nCREATE TABLE competition_record (\n\tCompetition_ID number,\n\tFarm_ID number,\n\tRank number,\n\tprimary key ( Competition_ID , Farm_ID ),\n\tforeign key ( Farm_ID ) references farm ( Farm_ID ),\n\tforeign key ( Competition_ID ) references farm_competition ( Competition_ID )\n)\n\nValid Operators:\nThe following operators are available for query decomposition:\n- Scan: Direct table access with no sub-questions\n- Filter: Selection based on conditions\n- Aggregate: Group and compute aggregations\n- Sort: Order results\n- Topsort: Sort and limit results\n- Top: Limit results\n- Join: Combine two sub-queries\n- Except: Set difference between two sub-queries\n- Intersect: Set intersection between two sub-queries\n- Union: Set union of two sub-queries\n\nOperator Rules:\n1. Each decomposition MUST specify exactly one operator from the above list\n2. Operator constraints:\n - Scan: Cannot have sub-questions\n - Filter/Aggregate/Sort/Top/Topsort: Can have 1 sub-question\n - Join/Union/Intersect/Except: Must have exactly 2 sub-questions\n\nTask Description:\n1. You will receive a complex database question that needs to be decomposed\n2. For each question, you should:\n - First, determine the appropriate operator from the valid list\n - Then break it down into sub-questions according to the operator's rules\n - Explain how these sub-questions relate to the original question\n - Indicate the order in which these sub-questions should be answered\n\nResponse Format:\nFor each decomposition step, respond with this exact JSON format without any other text:\n{\n \"type\": \"object\",\n \"properties\": {\n \"index\": {\n \"type\": [\n \"integer\",\n \"null\"\n ]\n },\n \"question\": {\n \"type\": \"string\"\n },\n \"operator\": {\n \"type\": [\n \"string\",\n \"null\"\n ],\n \"enum\": [\n \"Scan\",\n \"Filter\",\n \"Aggregate\",\n \"Sort\",\n \"Top\",\n \"Join\",\n \"Union\",\n \"Intersect\",\n \"Except\",\n null\n ]\n },\n \"sub_questions\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#\"\n }\n }\n },\n \"required\": [\n \"index\",\n \"question\",\n \"operator\"\n ]\n}\n\nConversation Flow:\n1. User will provide the initial complex question\n2. You will:\n a. Choose an appropriate operator\n b. Decompose into sub-questions according to operator rules\n3. User will ask you to decompose one of the sub-questions if needed\n4. This process continues until we reach simple, directly answerable questions (Scan operations)\n\nImportant Rules:\n- Each decomposition MUST use exactly one operator from the valid list\n- Operator choice must be justified and appropriate for the question\n- Sub-questions must comply with the operator's requirements\n- Each sub-question should be simpler than the original question\n- Sub-questions should be clear and self-contained\n- Maintain context between decomposition steps\n- Use only tables and columns that exist in the provided schema\n",
"role": "system"
},
{
"content": "decompose the following question: Show the years and the ids of the host cities of competitions.",
"role": "user"
},
{
"content": "{\"index\":1,\"question\":\"Show the years and the ids of the host cities of competitions.\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
}
] |
7a233282b2e29514b51b842774abff3f6a95db80c23f805c0f383e5e940e1730_2
|
farm
|
Show the ids and official names of all cities.
|
[
"#1 = Scan Table [ city ] Output [ City_ID , Official_Name ]"
] |
[
"Show the ids and official names of all cities."
] |
[
{
"content": "You are a question decomposition expert. You are given a database schema and a complex database input question in natural language, and your task is to break down the complex database input question into simpler sub-questions in a recursive way, like a tree. In each step you will be given a question to decompose, so that your answer will be the input for the next steps.\n\nInput Question:\nShow the years and the official names of the host cities of competitions.\n\nDatabase Name:\nfarm\n\nDatabase Schema:\nCREATE TABLE city (\n\tCity_ID number,\n\tOfficial_Name text,\n\tStatus text,\n\tArea_km_2 number,\n\tPopulation number,\n\tCensus_Ranking text,\n\tprimary key ( City_ID )\n)\n\nCREATE TABLE farm (\n\tFarm_ID number,\n\tYear number,\n\tTotal_Horses number,\n\tWorking_Horses number,\n\tTotal_Cattle number,\n\tOxen number,\n\tBulls number,\n\tCows number,\n\tPigs number,\n\tSheep_and_Goats number,\n\tprimary key ( Farm_ID )\n)\n\nCREATE TABLE farm_competition (\n\tCompetition_ID number,\n\tYear number,\n\tTheme text,\n\tHost_city_ID number,\n\tHosts text,\n\tprimary key ( Competition_ID ),\n\tforeign key ( Host_city_ID ) references city ( City_ID )\n)\n\nCREATE TABLE competition_record (\n\tCompetition_ID number,\n\tFarm_ID number,\n\tRank number,\n\tprimary key ( Competition_ID , Farm_ID ),\n\tforeign key ( Farm_ID ) references farm ( Farm_ID ),\n\tforeign key ( Competition_ID ) references farm_competition ( Competition_ID )\n)\n\nValid Operators:\nThe following operators are available for query decomposition:\n- Scan: Direct table access with no sub-questions\n- Filter: Selection based on conditions\n- Aggregate: Group and compute aggregations\n- Sort: Order results\n- Topsort: Sort and limit results\n- Top: Limit results\n- Join: Combine two sub-queries\n- Except: Set difference between two sub-queries\n- Intersect: Set intersection between two sub-queries\n- Union: Set union of two sub-queries\n\nOperator Rules:\n1. Each decomposition MUST specify exactly one operator from the above list\n2. Operator constraints:\n - Scan: Cannot have sub-questions\n - Filter/Aggregate/Sort/Top/Topsort: Can have 1 sub-question\n - Join/Union/Intersect/Except: Must have exactly 2 sub-questions\n\nTask Description:\n1. You will receive a complex database question that needs to be decomposed\n2. For each question, you should:\n - First, determine the appropriate operator from the valid list\n - Then break it down into sub-questions according to the operator's rules\n - Explain how these sub-questions relate to the original question\n - Indicate the order in which these sub-questions should be answered\n\nResponse Format:\nFor each decomposition step, respond with this exact JSON format without any other text:\n{\n \"type\": \"object\",\n \"properties\": {\n \"index\": {\n \"type\": [\n \"integer\",\n \"null\"\n ]\n },\n \"question\": {\n \"type\": \"string\"\n },\n \"operator\": {\n \"type\": [\n \"string\",\n \"null\"\n ],\n \"enum\": [\n \"Scan\",\n \"Filter\",\n \"Aggregate\",\n \"Sort\",\n \"Top\",\n \"Join\",\n \"Union\",\n \"Intersect\",\n \"Except\",\n null\n ]\n },\n \"sub_questions\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#\"\n }\n }\n },\n \"required\": [\n \"index\",\n \"question\",\n \"operator\"\n ]\n}\n\nConversation Flow:\n1. User will provide the initial complex question\n2. You will:\n a. Choose an appropriate operator\n b. Decompose into sub-questions according to operator rules\n3. User will ask you to decompose one of the sub-questions if needed\n4. This process continues until we reach simple, directly answerable questions (Scan operations)\n\nImportant Rules:\n- Each decomposition MUST use exactly one operator from the valid list\n- Operator choice must be justified and appropriate for the question\n- Sub-questions must comply with the operator's requirements\n- Each sub-question should be simpler than the original question\n- Sub-questions should be clear and self-contained\n- Maintain context between decomposition steps\n- Use only tables and columns that exist in the provided schema\n",
"role": "system"
},
{
"content": "decompose the following question: Show the ids and official names of all cities.",
"role": "user"
},
{
"content": "{\"index\":1,\"question\":\"Show the ids and official names of all cities.\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
}
] |
aa8f85214b52972a4b2621237a4c0b85e723f50b1dd3963e5bca990f01bcdcd3_0
|
farm
|
Show the years and the official names of the host cities of competitions.
|
[
"#1 = Scan Table [ farm_competition ] Output [ Year , Host_city_ID ]",
"#2 = Scan Table [ city ] Output [ City_ID , Official_Name ]",
"#3 = Join [ #1 , #2 ] Predicate [ #1.Host_city_ID = #2.City_ID ] Output [ #1.Year , #2.Official_Name ]"
] |
[
"Show the years and the ids of the host cities of competitions.",
"Show the ids and official names of all cities.",
"Show the years and the official names of the host cities of competitions."
] |
[
{
"content": "You are a question decomposition expert. You are given a database schema and a complex database input question in natural language, and your task is to break down the complex database input question into simpler sub-questions in a recursive way, like a tree. In each step you will be given a question to decompose, so that your answer will be the input for the next steps.\n\nInput Question:\nGive the years and official names of the cities of each competition.\n\nDatabase Name:\nfarm\n\nDatabase Schema:\nCREATE TABLE city (\n\tCity_ID number,\n\tOfficial_Name text,\n\tStatus text,\n\tArea_km_2 number,\n\tPopulation number,\n\tCensus_Ranking text,\n\tprimary key ( City_ID )\n)\n\nCREATE TABLE farm (\n\tFarm_ID number,\n\tYear number,\n\tTotal_Horses number,\n\tWorking_Horses number,\n\tTotal_Cattle number,\n\tOxen number,\n\tBulls number,\n\tCows number,\n\tPigs number,\n\tSheep_and_Goats number,\n\tprimary key ( Farm_ID )\n)\n\nCREATE TABLE farm_competition (\n\tCompetition_ID number,\n\tYear number,\n\tTheme text,\n\tHost_city_ID number,\n\tHosts text,\n\tprimary key ( Competition_ID ),\n\tforeign key ( Host_city_ID ) references city ( City_ID )\n)\n\nCREATE TABLE competition_record (\n\tCompetition_ID number,\n\tFarm_ID number,\n\tRank number,\n\tprimary key ( Competition_ID , Farm_ID ),\n\tforeign key ( Farm_ID ) references farm ( Farm_ID ),\n\tforeign key ( Competition_ID ) references farm_competition ( Competition_ID )\n)\n\nValid Operators:\nThe following operators are available for query decomposition:\n- Scan: Direct table access with no sub-questions\n- Filter: Selection based on conditions\n- Aggregate: Group and compute aggregations\n- Sort: Order results\n- Topsort: Sort and limit results\n- Top: Limit results\n- Join: Combine two sub-queries\n- Except: Set difference between two sub-queries\n- Intersect: Set intersection between two sub-queries\n- Union: Set union of two sub-queries\n\nOperator Rules:\n1. Each decomposition MUST specify exactly one operator from the above list\n2. Operator constraints:\n - Scan: Cannot have sub-questions\n - Filter/Aggregate/Sort/Top/Topsort: Can have 1 sub-question\n - Join/Union/Intersect/Except: Must have exactly 2 sub-questions\n\nTask Description:\n1. You will receive a complex database question that needs to be decomposed\n2. For each question, you should:\n - First, determine the appropriate operator from the valid list\n - Then break it down into sub-questions according to the operator's rules\n - Explain how these sub-questions relate to the original question\n - Indicate the order in which these sub-questions should be answered\n\nResponse Format:\nFor each decomposition step, respond with this exact JSON format without any other text:\n{\n \"type\": \"object\",\n \"properties\": {\n \"index\": {\n \"type\": [\n \"integer\",\n \"null\"\n ]\n },\n \"question\": {\n \"type\": \"string\"\n },\n \"operator\": {\n \"type\": [\n \"string\",\n \"null\"\n ],\n \"enum\": [\n \"Scan\",\n \"Filter\",\n \"Aggregate\",\n \"Sort\",\n \"Top\",\n \"Join\",\n \"Union\",\n \"Intersect\",\n \"Except\",\n null\n ]\n },\n \"sub_questions\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#\"\n }\n }\n },\n \"required\": [\n \"index\",\n \"question\",\n \"operator\"\n ]\n}\n\nConversation Flow:\n1. User will provide the initial complex question\n2. You will:\n a. Choose an appropriate operator\n b. Decompose into sub-questions according to operator rules\n3. User will ask you to decompose one of the sub-questions if needed\n4. This process continues until we reach simple, directly answerable questions (Scan operations)\n\nImportant Rules:\n- Each decomposition MUST use exactly one operator from the valid list\n- Operator choice must be justified and appropriate for the question\n- Sub-questions must comply with the operator's requirements\n- Each sub-question should be simpler than the original question\n- Sub-questions should be clear and self-contained\n- Maintain context between decomposition steps\n- Use only tables and columns that exist in the provided schema\n",
"role": "system"
},
{
"content": "decompose the following question: Show the years and the official names of the host cities of competitions.",
"role": "user"
},
{
"content": "{\"index\":1,\"question\":\"Show the years and the official names of the host cities of competitions.\",\"operator\":\"Join\",\"sub_questions\":[{\"index\":2,\"question\":\"Show the years and the ids of the host cities of competitions.\",\"operator\":null,\"sub_questions\":[]},{\"index\":3,\"question\":\"Show the ids and official names of all cities.\",\"operator\":null,\"sub_questions\":[]}]}",
"role": "assistant"
},
{
"content": "given the decomposition: {\"index\":1,\"question\":\"Show the years and the official names of the host cities of competitions.\",\"operator\":\"Join\",\"sub_questions\":[{\"index\":2,\"question\":\"Show the years and the ids of the host cities of competitions.\",\"operator\":null,\"sub_questions\":[]},{\"index\":3,\"question\":\"Show the ids and official names of all cities.\",\"operator\":null,\"sub_questions\":[]}]}\ndecompose the following question with index 2: Show the years and the ids of the host cities of competitions.",
"role": "user"
},
{
"content": "{\"index\":2,\"question\":\"Show the years and the ids of the host cities of competitions.\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
},
{
"content": "given the decomposition: {\"index\":1,\"question\":\"Show the years and the official names of the host cities of competitions.\",\"operator\":\"Join\",\"sub_questions\":[{\"index\":2,\"question\":\"Show the years and the ids of the host cities of competitions.\",\"operator\":\"Scan\",\"sub_questions\":[]},{\"index\":3,\"question\":\"Show the ids and official names of all cities.\",\"operator\":null,\"sub_questions\":[]}]}\ndecompose the following question with index 3: Show the ids and official names of all cities.",
"role": "user"
},
{
"content": "{\"index\":3,\"question\":\"Show the ids and official names of all cities.\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
}
] |
aa8f85214b52972a4b2621237a4c0b85e723f50b1dd3963e5bca990f01bcdcd3_1
|
farm
|
Show the years and the ids of the host cities of competitions.
|
[
"#1 = Scan Table [ farm_competition ] Output [ Year , Host_city_ID ]"
] |
[
"Show the years and the ids of the host cities of competitions."
] |
[
{
"content": "You are a question decomposition expert. You are given a database schema and a complex database input question in natural language, and your task is to break down the complex database input question into simpler sub-questions in a recursive way, like a tree. In each step you will be given a question to decompose, so that your answer will be the input for the next steps.\n\nInput Question:\nGive the years and official names of the cities of each competition.\n\nDatabase Name:\nfarm\n\nDatabase Schema:\nCREATE TABLE city (\n\tCity_ID number,\n\tOfficial_Name text,\n\tStatus text,\n\tArea_km_2 number,\n\tPopulation number,\n\tCensus_Ranking text,\n\tprimary key ( City_ID )\n)\n\nCREATE TABLE farm (\n\tFarm_ID number,\n\tYear number,\n\tTotal_Horses number,\n\tWorking_Horses number,\n\tTotal_Cattle number,\n\tOxen number,\n\tBulls number,\n\tCows number,\n\tPigs number,\n\tSheep_and_Goats number,\n\tprimary key ( Farm_ID )\n)\n\nCREATE TABLE farm_competition (\n\tCompetition_ID number,\n\tYear number,\n\tTheme text,\n\tHost_city_ID number,\n\tHosts text,\n\tprimary key ( Competition_ID ),\n\tforeign key ( Host_city_ID ) references city ( City_ID )\n)\n\nCREATE TABLE competition_record (\n\tCompetition_ID number,\n\tFarm_ID number,\n\tRank number,\n\tprimary key ( Competition_ID , Farm_ID ),\n\tforeign key ( Farm_ID ) references farm ( Farm_ID ),\n\tforeign key ( Competition_ID ) references farm_competition ( Competition_ID )\n)\n\nValid Operators:\nThe following operators are available for query decomposition:\n- Scan: Direct table access with no sub-questions\n- Filter: Selection based on conditions\n- Aggregate: Group and compute aggregations\n- Sort: Order results\n- Topsort: Sort and limit results\n- Top: Limit results\n- Join: Combine two sub-queries\n- Except: Set difference between two sub-queries\n- Intersect: Set intersection between two sub-queries\n- Union: Set union of two sub-queries\n\nOperator Rules:\n1. Each decomposition MUST specify exactly one operator from the above list\n2. Operator constraints:\n - Scan: Cannot have sub-questions\n - Filter/Aggregate/Sort/Top/Topsort: Can have 1 sub-question\n - Join/Union/Intersect/Except: Must have exactly 2 sub-questions\n\nTask Description:\n1. You will receive a complex database question that needs to be decomposed\n2. For each question, you should:\n - First, determine the appropriate operator from the valid list\n - Then break it down into sub-questions according to the operator's rules\n - Explain how these sub-questions relate to the original question\n - Indicate the order in which these sub-questions should be answered\n\nResponse Format:\nFor each decomposition step, respond with this exact JSON format without any other text:\n{\n \"type\": \"object\",\n \"properties\": {\n \"index\": {\n \"type\": [\n \"integer\",\n \"null\"\n ]\n },\n \"question\": {\n \"type\": \"string\"\n },\n \"operator\": {\n \"type\": [\n \"string\",\n \"null\"\n ],\n \"enum\": [\n \"Scan\",\n \"Filter\",\n \"Aggregate\",\n \"Sort\",\n \"Top\",\n \"Join\",\n \"Union\",\n \"Intersect\",\n \"Except\",\n null\n ]\n },\n \"sub_questions\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#\"\n }\n }\n },\n \"required\": [\n \"index\",\n \"question\",\n \"operator\"\n ]\n}\n\nConversation Flow:\n1. User will provide the initial complex question\n2. You will:\n a. Choose an appropriate operator\n b. Decompose into sub-questions according to operator rules\n3. User will ask you to decompose one of the sub-questions if needed\n4. This process continues until we reach simple, directly answerable questions (Scan operations)\n\nImportant Rules:\n- Each decomposition MUST use exactly one operator from the valid list\n- Operator choice must be justified and appropriate for the question\n- Sub-questions must comply with the operator's requirements\n- Each sub-question should be simpler than the original question\n- Sub-questions should be clear and self-contained\n- Maintain context between decomposition steps\n- Use only tables and columns that exist in the provided schema\n",
"role": "system"
},
{
"content": "decompose the following question: Show the years and the ids of the host cities of competitions.",
"role": "user"
},
{
"content": "{\"index\":1,\"question\":\"Show the years and the ids of the host cities of competitions.\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
}
] |
aa8f85214b52972a4b2621237a4c0b85e723f50b1dd3963e5bca990f01bcdcd3_2
|
farm
|
Show the ids and official names of all cities.
|
[
"#1 = Scan Table [ city ] Output [ City_ID , Official_Name ]"
] |
[
"Show the ids and official names of all cities."
] |
[
{
"content": "You are a question decomposition expert. You are given a database schema and a complex database input question in natural language, and your task is to break down the complex database input question into simpler sub-questions in a recursive way, like a tree. In each step you will be given a question to decompose, so that your answer will be the input for the next steps.\n\nInput Question:\nGive the years and official names of the cities of each competition.\n\nDatabase Name:\nfarm\n\nDatabase Schema:\nCREATE TABLE city (\n\tCity_ID number,\n\tOfficial_Name text,\n\tStatus text,\n\tArea_km_2 number,\n\tPopulation number,\n\tCensus_Ranking text,\n\tprimary key ( City_ID )\n)\n\nCREATE TABLE farm (\n\tFarm_ID number,\n\tYear number,\n\tTotal_Horses number,\n\tWorking_Horses number,\n\tTotal_Cattle number,\n\tOxen number,\n\tBulls number,\n\tCows number,\n\tPigs number,\n\tSheep_and_Goats number,\n\tprimary key ( Farm_ID )\n)\n\nCREATE TABLE farm_competition (\n\tCompetition_ID number,\n\tYear number,\n\tTheme text,\n\tHost_city_ID number,\n\tHosts text,\n\tprimary key ( Competition_ID ),\n\tforeign key ( Host_city_ID ) references city ( City_ID )\n)\n\nCREATE TABLE competition_record (\n\tCompetition_ID number,\n\tFarm_ID number,\n\tRank number,\n\tprimary key ( Competition_ID , Farm_ID ),\n\tforeign key ( Farm_ID ) references farm ( Farm_ID ),\n\tforeign key ( Competition_ID ) references farm_competition ( Competition_ID )\n)\n\nValid Operators:\nThe following operators are available for query decomposition:\n- Scan: Direct table access with no sub-questions\n- Filter: Selection based on conditions\n- Aggregate: Group and compute aggregations\n- Sort: Order results\n- Topsort: Sort and limit results\n- Top: Limit results\n- Join: Combine two sub-queries\n- Except: Set difference between two sub-queries\n- Intersect: Set intersection between two sub-queries\n- Union: Set union of two sub-queries\n\nOperator Rules:\n1. Each decomposition MUST specify exactly one operator from the above list\n2. Operator constraints:\n - Scan: Cannot have sub-questions\n - Filter/Aggregate/Sort/Top/Topsort: Can have 1 sub-question\n - Join/Union/Intersect/Except: Must have exactly 2 sub-questions\n\nTask Description:\n1. You will receive a complex database question that needs to be decomposed\n2. For each question, you should:\n - First, determine the appropriate operator from the valid list\n - Then break it down into sub-questions according to the operator's rules\n - Explain how these sub-questions relate to the original question\n - Indicate the order in which these sub-questions should be answered\n\nResponse Format:\nFor each decomposition step, respond with this exact JSON format without any other text:\n{\n \"type\": \"object\",\n \"properties\": {\n \"index\": {\n \"type\": [\n \"integer\",\n \"null\"\n ]\n },\n \"question\": {\n \"type\": \"string\"\n },\n \"operator\": {\n \"type\": [\n \"string\",\n \"null\"\n ],\n \"enum\": [\n \"Scan\",\n \"Filter\",\n \"Aggregate\",\n \"Sort\",\n \"Top\",\n \"Join\",\n \"Union\",\n \"Intersect\",\n \"Except\",\n null\n ]\n },\n \"sub_questions\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#\"\n }\n }\n },\n \"required\": [\n \"index\",\n \"question\",\n \"operator\"\n ]\n}\n\nConversation Flow:\n1. User will provide the initial complex question\n2. You will:\n a. Choose an appropriate operator\n b. Decompose into sub-questions according to operator rules\n3. User will ask you to decompose one of the sub-questions if needed\n4. This process continues until we reach simple, directly answerable questions (Scan operations)\n\nImportant Rules:\n- Each decomposition MUST use exactly one operator from the valid list\n- Operator choice must be justified and appropriate for the question\n- Sub-questions must comply with the operator's requirements\n- Each sub-question should be simpler than the original question\n- Sub-questions should be clear and self-contained\n- Maintain context between decomposition steps\n- Use only tables and columns that exist in the provided schema\n",
"role": "system"
},
{
"content": "decompose the following question: Show the ids and official names of all cities.",
"role": "user"
},
{
"content": "{\"index\":1,\"question\":\"Show the ids and official names of all cities.\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
}
] |
4e7c634308ce04be87c7346458ee0d0e056b6f4f3162c938cb563738ec1fe77b_0
|
farm
|
Show the official names of the cities that have hosted more than one competition.
|
[
"#1 = Scan Table [ farm_competition ] Output [ Host_city_ID ]",
"#2 = Scan Table [ city ] Output [ City_ID , Official_Name ]",
"#3 = Join [ #1 , #2 ] Predicate [ #1.Host_city_ID = #2.City_ID ] Output [ #1.Host_city_ID , #2.Official_Name , #2.City_ID ]",
"#4 = Aggregate [ #3 ] GroupBy [ Host_city_ID ] Output [ countstar AS Count_Star , Official_Name ]",
"#5 = Filter [ #4 ] Predicate [ Count_Star > 1 ] Output [ Official_Name ]"
] |
[
"Show the host city ids of all competitions.",
"Show the ids and official names of all the cities.",
"Show the host city ids and official names of all competitions.",
"Show the the official names of the cities and the number of competitions have hosted for each host city id.",
"Show the official names of the cities that have hosted more than one competition."
] |
[
{
"content": "You are a question decomposition expert. You are given a database schema and a complex database input question in natural language, and your task is to break down the complex database input question into simpler sub-questions in a recursive way, like a tree. In each step you will be given a question to decompose, so that your answer will be the input for the next steps.\n\nInput Question:\nShow the official names of the cities that have hosted more than one competition.\n\nDatabase Name:\nfarm\n\nDatabase Schema:\nCREATE TABLE city (\n\tCity_ID number,\n\tOfficial_Name text,\n\tStatus text,\n\tArea_km_2 number,\n\tPopulation number,\n\tCensus_Ranking text,\n\tprimary key ( City_ID )\n)\n\nCREATE TABLE farm (\n\tFarm_ID number,\n\tYear number,\n\tTotal_Horses number,\n\tWorking_Horses number,\n\tTotal_Cattle number,\n\tOxen number,\n\tBulls number,\n\tCows number,\n\tPigs number,\n\tSheep_and_Goats number,\n\tprimary key ( Farm_ID )\n)\n\nCREATE TABLE farm_competition (\n\tCompetition_ID number,\n\tYear number,\n\tTheme text,\n\tHost_city_ID number,\n\tHosts text,\n\tprimary key ( Competition_ID ),\n\tforeign key ( Host_city_ID ) references city ( City_ID )\n)\n\nCREATE TABLE competition_record (\n\tCompetition_ID number,\n\tFarm_ID number,\n\tRank number,\n\tprimary key ( Competition_ID , Farm_ID ),\n\tforeign key ( Farm_ID ) references farm ( Farm_ID ),\n\tforeign key ( Competition_ID ) references farm_competition ( Competition_ID )\n)\n\nValid Operators:\nThe following operators are available for query decomposition:\n- Scan: Direct table access with no sub-questions\n- Filter: Selection based on conditions\n- Aggregate: Group and compute aggregations\n- Sort: Order results\n- Topsort: Sort and limit results\n- Top: Limit results\n- Join: Combine two sub-queries\n- Except: Set difference between two sub-queries\n- Intersect: Set intersection between two sub-queries\n- Union: Set union of two sub-queries\n\nOperator Rules:\n1. Each decomposition MUST specify exactly one operator from the above list\n2. Operator constraints:\n - Scan: Cannot have sub-questions\n - Filter/Aggregate/Sort/Top/Topsort: Can have 1 sub-question\n - Join/Union/Intersect/Except: Must have exactly 2 sub-questions\n\nTask Description:\n1. You will receive a complex database question that needs to be decomposed\n2. For each question, you should:\n - First, determine the appropriate operator from the valid list\n - Then break it down into sub-questions according to the operator's rules\n - Explain how these sub-questions relate to the original question\n - Indicate the order in which these sub-questions should be answered\n\nResponse Format:\nFor each decomposition step, respond with this exact JSON format without any other text:\n{\n \"type\": \"object\",\n \"properties\": {\n \"index\": {\n \"type\": [\n \"integer\",\n \"null\"\n ]\n },\n \"question\": {\n \"type\": \"string\"\n },\n \"operator\": {\n \"type\": [\n \"string\",\n \"null\"\n ],\n \"enum\": [\n \"Scan\",\n \"Filter\",\n \"Aggregate\",\n \"Sort\",\n \"Top\",\n \"Join\",\n \"Union\",\n \"Intersect\",\n \"Except\",\n null\n ]\n },\n \"sub_questions\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#\"\n }\n }\n },\n \"required\": [\n \"index\",\n \"question\",\n \"operator\"\n ]\n}\n\nConversation Flow:\n1. User will provide the initial complex question\n2. You will:\n a. Choose an appropriate operator\n b. Decompose into sub-questions according to operator rules\n3. User will ask you to decompose one of the sub-questions if needed\n4. This process continues until we reach simple, directly answerable questions (Scan operations)\n\nImportant Rules:\n- Each decomposition MUST use exactly one operator from the valid list\n- Operator choice must be justified and appropriate for the question\n- Sub-questions must comply with the operator's requirements\n- Each sub-question should be simpler than the original question\n- Sub-questions should be clear and self-contained\n- Maintain context between decomposition steps\n- Use only tables and columns that exist in the provided schema\n",
"role": "system"
},
{
"content": "decompose the following question: Show the official names of the cities that have hosted more than one competition.",
"role": "user"
},
{
"content": "{\"index\":1,\"question\":\"Show the official names of the cities that have hosted more than one competition.\",\"operator\":\"Filter\",\"sub_questions\":[{\"index\":2,\"question\":\"Show the the official names of the cities and the number of competitions have hosted for each host city id.\",\"operator\":null,\"sub_questions\":[]}]}",
"role": "assistant"
},
{
"content": "given the decomposition: {\"index\":1,\"question\":\"Show the official names of the cities that have hosted more than one competition.\",\"operator\":\"Filter\",\"sub_questions\":[{\"index\":2,\"question\":\"Show the the official names of the cities and the number of competitions have hosted for each host city id.\",\"operator\":null,\"sub_questions\":[]}]}\ndecompose the following question with index 2: Show the the official names of the cities and the number of competitions have hosted for each host city id.",
"role": "user"
},
{
"content": "{\"index\":2,\"question\":\"Show the the official names of the cities and the number of competitions have hosted for each host city id.\",\"operator\":\"Aggregate\",\"sub_questions\":[{\"index\":3,\"question\":\"Show the host city ids and official names of all competitions.\",\"operator\":null,\"sub_questions\":[]}]}",
"role": "assistant"
},
{
"content": "given the decomposition: {\"index\":1,\"question\":\"Show the official names of the cities that have hosted more than one competition.\",\"operator\":\"Filter\",\"sub_questions\":[{\"index\":2,\"question\":\"Show the the official names of the cities and the number of competitions have hosted for each host city id.\",\"operator\":\"Aggregate\",\"sub_questions\":[{\"index\":3,\"question\":\"Show the host city ids and official names of all competitions.\",\"operator\":null,\"sub_questions\":[]}]}]}\ndecompose the following question with index 3: Show the host city ids and official names of all competitions.",
"role": "user"
},
{
"content": "{\"index\":3,\"question\":\"Show the host city ids and official names of all competitions.\",\"operator\":\"Join\",\"sub_questions\":[{\"index\":4,\"question\":\"Show the host city ids of all competitions.\",\"operator\":null,\"sub_questions\":[]},{\"index\":5,\"question\":\"Show the ids and official names of all the cities.\",\"operator\":null,\"sub_questions\":[]}]}",
"role": "assistant"
},
{
"content": "given the decomposition: {\"index\":1,\"question\":\"Show the official names of the cities that have hosted more than one competition.\",\"operator\":\"Filter\",\"sub_questions\":[{\"index\":2,\"question\":\"Show the the official names of the cities and the number of competitions have hosted for each host city id.\",\"operator\":\"Aggregate\",\"sub_questions\":[{\"index\":3,\"question\":\"Show the host city ids and official names of all competitions.\",\"operator\":\"Join\",\"sub_questions\":[{\"index\":4,\"question\":\"Show the host city ids of all competitions.\",\"operator\":null,\"sub_questions\":[]},{\"index\":5,\"question\":\"Show the ids and official names of all the cities.\",\"operator\":null,\"sub_questions\":[]}]}]}]}\ndecompose the following question with index 4: Show the host city ids of all competitions.",
"role": "user"
},
{
"content": "{\"index\":4,\"question\":\"Show the host city ids of all competitions.\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
},
{
"content": "given the decomposition: {\"index\":1,\"question\":\"Show the official names of the cities that have hosted more than one competition.\",\"operator\":\"Filter\",\"sub_questions\":[{\"index\":2,\"question\":\"Show the the official names of the cities and the number of competitions have hosted for each host city id.\",\"operator\":\"Aggregate\",\"sub_questions\":[{\"index\":3,\"question\":\"Show the host city ids and official names of all competitions.\",\"operator\":\"Join\",\"sub_questions\":[{\"index\":4,\"question\":\"Show the host city ids of all competitions.\",\"operator\":\"Scan\",\"sub_questions\":[]},{\"index\":5,\"question\":\"Show the ids and official names of all the cities.\",\"operator\":null,\"sub_questions\":[]}]}]}]}\ndecompose the following question with index 5: Show the ids and official names of all the cities.",
"role": "user"
},
{
"content": "{\"index\":5,\"question\":\"Show the ids and official names of all the cities.\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
}
] |
4e7c634308ce04be87c7346458ee0d0e056b6f4f3162c938cb563738ec1fe77b_1
|
farm
|
Show the the official names of the cities and the number of competitions have hosted for each host city id.
|
[
"#1 = Scan Table [ farm_competition ] Output [ Host_city_ID ]",
"#2 = Scan Table [ city ] Output [ City_ID , Official_Name ]",
"#3 = Join [ #1 , #2 ] Predicate [ #1.Host_city_ID = #2.City_ID ] Output [ #1.Host_city_ID , #2.Official_Name , #2.City_ID ]",
"#4 = Aggregate [ #3 ] GroupBy [ Host_city_ID ] Output [ countstar AS Count_Star , Official_Name ]"
] |
[
"Show the host city ids of all competitions.",
"Show the ids and official names of all the cities.",
"Show the host city ids and official names of all competitions.",
"Show the the official names of the cities and the number of competitions have hosted for each host city id."
] |
[
{
"content": "You are a question decomposition expert. You are given a database schema and a complex database input question in natural language, and your task is to break down the complex database input question into simpler sub-questions in a recursive way, like a tree. In each step you will be given a question to decompose, so that your answer will be the input for the next steps.\n\nInput Question:\nShow the official names of the cities that have hosted more than one competition.\n\nDatabase Name:\nfarm\n\nDatabase Schema:\nCREATE TABLE city (\n\tCity_ID number,\n\tOfficial_Name text,\n\tStatus text,\n\tArea_km_2 number,\n\tPopulation number,\n\tCensus_Ranking text,\n\tprimary key ( City_ID )\n)\n\nCREATE TABLE farm (\n\tFarm_ID number,\n\tYear number,\n\tTotal_Horses number,\n\tWorking_Horses number,\n\tTotal_Cattle number,\n\tOxen number,\n\tBulls number,\n\tCows number,\n\tPigs number,\n\tSheep_and_Goats number,\n\tprimary key ( Farm_ID )\n)\n\nCREATE TABLE farm_competition (\n\tCompetition_ID number,\n\tYear number,\n\tTheme text,\n\tHost_city_ID number,\n\tHosts text,\n\tprimary key ( Competition_ID ),\n\tforeign key ( Host_city_ID ) references city ( City_ID )\n)\n\nCREATE TABLE competition_record (\n\tCompetition_ID number,\n\tFarm_ID number,\n\tRank number,\n\tprimary key ( Competition_ID , Farm_ID ),\n\tforeign key ( Farm_ID ) references farm ( Farm_ID ),\n\tforeign key ( Competition_ID ) references farm_competition ( Competition_ID )\n)\n\nValid Operators:\nThe following operators are available for query decomposition:\n- Scan: Direct table access with no sub-questions\n- Filter: Selection based on conditions\n- Aggregate: Group and compute aggregations\n- Sort: Order results\n- Topsort: Sort and limit results\n- Top: Limit results\n- Join: Combine two sub-queries\n- Except: Set difference between two sub-queries\n- Intersect: Set intersection between two sub-queries\n- Union: Set union of two sub-queries\n\nOperator Rules:\n1. Each decomposition MUST specify exactly one operator from the above list\n2. Operator constraints:\n - Scan: Cannot have sub-questions\n - Filter/Aggregate/Sort/Top/Topsort: Can have 1 sub-question\n - Join/Union/Intersect/Except: Must have exactly 2 sub-questions\n\nTask Description:\n1. You will receive a complex database question that needs to be decomposed\n2. For each question, you should:\n - First, determine the appropriate operator from the valid list\n - Then break it down into sub-questions according to the operator's rules\n - Explain how these sub-questions relate to the original question\n - Indicate the order in which these sub-questions should be answered\n\nResponse Format:\nFor each decomposition step, respond with this exact JSON format without any other text:\n{\n \"type\": \"object\",\n \"properties\": {\n \"index\": {\n \"type\": [\n \"integer\",\n \"null\"\n ]\n },\n \"question\": {\n \"type\": \"string\"\n },\n \"operator\": {\n \"type\": [\n \"string\",\n \"null\"\n ],\n \"enum\": [\n \"Scan\",\n \"Filter\",\n \"Aggregate\",\n \"Sort\",\n \"Top\",\n \"Join\",\n \"Union\",\n \"Intersect\",\n \"Except\",\n null\n ]\n },\n \"sub_questions\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#\"\n }\n }\n },\n \"required\": [\n \"index\",\n \"question\",\n \"operator\"\n ]\n}\n\nConversation Flow:\n1. User will provide the initial complex question\n2. You will:\n a. Choose an appropriate operator\n b. Decompose into sub-questions according to operator rules\n3. User will ask you to decompose one of the sub-questions if needed\n4. This process continues until we reach simple, directly answerable questions (Scan operations)\n\nImportant Rules:\n- Each decomposition MUST use exactly one operator from the valid list\n- Operator choice must be justified and appropriate for the question\n- Sub-questions must comply with the operator's requirements\n- Each sub-question should be simpler than the original question\n- Sub-questions should be clear and self-contained\n- Maintain context between decomposition steps\n- Use only tables and columns that exist in the provided schema\n",
"role": "system"
},
{
"content": "decompose the following question: Show the the official names of the cities and the number of competitions have hosted for each host city id.",
"role": "user"
},
{
"content": "{\"index\":1,\"question\":\"Show the the official names of the cities and the number of competitions have hosted for each host city id.\",\"operator\":\"Aggregate\",\"sub_questions\":[{\"index\":2,\"question\":\"Show the host city ids and official names of all competitions.\",\"operator\":null,\"sub_questions\":[]}]}",
"role": "assistant"
},
{
"content": "given the decomposition: {\"index\":1,\"question\":\"Show the the official names of the cities and the number of competitions have hosted for each host city id.\",\"operator\":\"Aggregate\",\"sub_questions\":[{\"index\":2,\"question\":\"Show the host city ids and official names of all competitions.\",\"operator\":null,\"sub_questions\":[]}]}\ndecompose the following question with index 2: Show the host city ids and official names of all competitions.",
"role": "user"
},
{
"content": "{\"index\":2,\"question\":\"Show the host city ids and official names of all competitions.\",\"operator\":\"Join\",\"sub_questions\":[{\"index\":3,\"question\":\"Show the host city ids of all competitions.\",\"operator\":null,\"sub_questions\":[]},{\"index\":4,\"question\":\"Show the ids and official names of all the cities.\",\"operator\":null,\"sub_questions\":[]}]}",
"role": "assistant"
},
{
"content": "given the decomposition: {\"index\":1,\"question\":\"Show the the official names of the cities and the number of competitions have hosted for each host city id.\",\"operator\":\"Aggregate\",\"sub_questions\":[{\"index\":2,\"question\":\"Show the host city ids and official names of all competitions.\",\"operator\":\"Join\",\"sub_questions\":[{\"index\":3,\"question\":\"Show the host city ids of all competitions.\",\"operator\":null,\"sub_questions\":[]},{\"index\":4,\"question\":\"Show the ids and official names of all the cities.\",\"operator\":null,\"sub_questions\":[]}]}]}\ndecompose the following question with index 3: Show the host city ids of all competitions.",
"role": "user"
},
{
"content": "{\"index\":3,\"question\":\"Show the host city ids of all competitions.\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
},
{
"content": "given the decomposition: {\"index\":1,\"question\":\"Show the the official names of the cities and the number of competitions have hosted for each host city id.\",\"operator\":\"Aggregate\",\"sub_questions\":[{\"index\":2,\"question\":\"Show the host city ids and official names of all competitions.\",\"operator\":\"Join\",\"sub_questions\":[{\"index\":3,\"question\":\"Show the host city ids of all competitions.\",\"operator\":\"Scan\",\"sub_questions\":[]},{\"index\":4,\"question\":\"Show the ids and official names of all the cities.\",\"operator\":null,\"sub_questions\":[]}]}]}\ndecompose the following question with index 4: Show the ids and official names of all the cities.",
"role": "user"
},
{
"content": "{\"index\":4,\"question\":\"Show the ids and official names of all the cities.\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
}
] |
4e7c634308ce04be87c7346458ee0d0e056b6f4f3162c938cb563738ec1fe77b_2
|
farm
|
Show the host city ids and official names of all competitions.
|
[
"#1 = Scan Table [ farm_competition ] Output [ Host_city_ID ]",
"#2 = Scan Table [ city ] Output [ City_ID , Official_Name ]",
"#3 = Join [ #1 , #2 ] Predicate [ #1.Host_city_ID = #2.City_ID ] Output [ #1.Host_city_ID , #2.Official_Name , #2.City_ID ]"
] |
[
"Show the host city ids of all competitions.",
"Show the ids and official names of all the cities.",
"Show the host city ids and official names of all competitions."
] |
[
{
"content": "You are a question decomposition expert. You are given a database schema and a complex database input question in natural language, and your task is to break down the complex database input question into simpler sub-questions in a recursive way, like a tree. In each step you will be given a question to decompose, so that your answer will be the input for the next steps.\n\nInput Question:\nShow the official names of the cities that have hosted more than one competition.\n\nDatabase Name:\nfarm\n\nDatabase Schema:\nCREATE TABLE city (\n\tCity_ID number,\n\tOfficial_Name text,\n\tStatus text,\n\tArea_km_2 number,\n\tPopulation number,\n\tCensus_Ranking text,\n\tprimary key ( City_ID )\n)\n\nCREATE TABLE farm (\n\tFarm_ID number,\n\tYear number,\n\tTotal_Horses number,\n\tWorking_Horses number,\n\tTotal_Cattle number,\n\tOxen number,\n\tBulls number,\n\tCows number,\n\tPigs number,\n\tSheep_and_Goats number,\n\tprimary key ( Farm_ID )\n)\n\nCREATE TABLE farm_competition (\n\tCompetition_ID number,\n\tYear number,\n\tTheme text,\n\tHost_city_ID number,\n\tHosts text,\n\tprimary key ( Competition_ID ),\n\tforeign key ( Host_city_ID ) references city ( City_ID )\n)\n\nCREATE TABLE competition_record (\n\tCompetition_ID number,\n\tFarm_ID number,\n\tRank number,\n\tprimary key ( Competition_ID , Farm_ID ),\n\tforeign key ( Farm_ID ) references farm ( Farm_ID ),\n\tforeign key ( Competition_ID ) references farm_competition ( Competition_ID )\n)\n\nValid Operators:\nThe following operators are available for query decomposition:\n- Scan: Direct table access with no sub-questions\n- Filter: Selection based on conditions\n- Aggregate: Group and compute aggregations\n- Sort: Order results\n- Topsort: Sort and limit results\n- Top: Limit results\n- Join: Combine two sub-queries\n- Except: Set difference between two sub-queries\n- Intersect: Set intersection between two sub-queries\n- Union: Set union of two sub-queries\n\nOperator Rules:\n1. Each decomposition MUST specify exactly one operator from the above list\n2. Operator constraints:\n - Scan: Cannot have sub-questions\n - Filter/Aggregate/Sort/Top/Topsort: Can have 1 sub-question\n - Join/Union/Intersect/Except: Must have exactly 2 sub-questions\n\nTask Description:\n1. You will receive a complex database question that needs to be decomposed\n2. For each question, you should:\n - First, determine the appropriate operator from the valid list\n - Then break it down into sub-questions according to the operator's rules\n - Explain how these sub-questions relate to the original question\n - Indicate the order in which these sub-questions should be answered\n\nResponse Format:\nFor each decomposition step, respond with this exact JSON format without any other text:\n{\n \"type\": \"object\",\n \"properties\": {\n \"index\": {\n \"type\": [\n \"integer\",\n \"null\"\n ]\n },\n \"question\": {\n \"type\": \"string\"\n },\n \"operator\": {\n \"type\": [\n \"string\",\n \"null\"\n ],\n \"enum\": [\n \"Scan\",\n \"Filter\",\n \"Aggregate\",\n \"Sort\",\n \"Top\",\n \"Join\",\n \"Union\",\n \"Intersect\",\n \"Except\",\n null\n ]\n },\n \"sub_questions\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#\"\n }\n }\n },\n \"required\": [\n \"index\",\n \"question\",\n \"operator\"\n ]\n}\n\nConversation Flow:\n1. User will provide the initial complex question\n2. You will:\n a. Choose an appropriate operator\n b. Decompose into sub-questions according to operator rules\n3. User will ask you to decompose one of the sub-questions if needed\n4. This process continues until we reach simple, directly answerable questions (Scan operations)\n\nImportant Rules:\n- Each decomposition MUST use exactly one operator from the valid list\n- Operator choice must be justified and appropriate for the question\n- Sub-questions must comply with the operator's requirements\n- Each sub-question should be simpler than the original question\n- Sub-questions should be clear and self-contained\n- Maintain context between decomposition steps\n- Use only tables and columns that exist in the provided schema\n",
"role": "system"
},
{
"content": "decompose the following question: Show the host city ids and official names of all competitions.",
"role": "user"
},
{
"content": "{\"index\":1,\"question\":\"Show the host city ids and official names of all competitions.\",\"operator\":\"Join\",\"sub_questions\":[{\"index\":2,\"question\":\"Show the host city ids of all competitions.\",\"operator\":null,\"sub_questions\":[]},{\"index\":3,\"question\":\"Show the ids and official names of all the cities.\",\"operator\":null,\"sub_questions\":[]}]}",
"role": "assistant"
},
{
"content": "given the decomposition: {\"index\":1,\"question\":\"Show the host city ids and official names of all competitions.\",\"operator\":\"Join\",\"sub_questions\":[{\"index\":2,\"question\":\"Show the host city ids of all competitions.\",\"operator\":null,\"sub_questions\":[]},{\"index\":3,\"question\":\"Show the ids and official names of all the cities.\",\"operator\":null,\"sub_questions\":[]}]}\ndecompose the following question with index 2: Show the host city ids of all competitions.",
"role": "user"
},
{
"content": "{\"index\":2,\"question\":\"Show the host city ids of all competitions.\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
},
{
"content": "given the decomposition: {\"index\":1,\"question\":\"Show the host city ids and official names of all competitions.\",\"operator\":\"Join\",\"sub_questions\":[{\"index\":2,\"question\":\"Show the host city ids of all competitions.\",\"operator\":\"Scan\",\"sub_questions\":[]},{\"index\":3,\"question\":\"Show the ids and official names of all the cities.\",\"operator\":null,\"sub_questions\":[]}]}\ndecompose the following question with index 3: Show the ids and official names of all the cities.",
"role": "user"
},
{
"content": "{\"index\":3,\"question\":\"Show the ids and official names of all the cities.\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
}
] |
4e7c634308ce04be87c7346458ee0d0e056b6f4f3162c938cb563738ec1fe77b_3
|
farm
|
Show the host city ids of all competitions.
|
[
"#1 = Scan Table [ farm_competition ] Output [ Host_city_ID ]"
] |
[
"Show the host city ids of all competitions."
] |
[
{
"content": "You are a question decomposition expert. You are given a database schema and a complex database input question in natural language, and your task is to break down the complex database input question into simpler sub-questions in a recursive way, like a tree. In each step you will be given a question to decompose, so that your answer will be the input for the next steps.\n\nInput Question:\nShow the official names of the cities that have hosted more than one competition.\n\nDatabase Name:\nfarm\n\nDatabase Schema:\nCREATE TABLE city (\n\tCity_ID number,\n\tOfficial_Name text,\n\tStatus text,\n\tArea_km_2 number,\n\tPopulation number,\n\tCensus_Ranking text,\n\tprimary key ( City_ID )\n)\n\nCREATE TABLE farm (\n\tFarm_ID number,\n\tYear number,\n\tTotal_Horses number,\n\tWorking_Horses number,\n\tTotal_Cattle number,\n\tOxen number,\n\tBulls number,\n\tCows number,\n\tPigs number,\n\tSheep_and_Goats number,\n\tprimary key ( Farm_ID )\n)\n\nCREATE TABLE farm_competition (\n\tCompetition_ID number,\n\tYear number,\n\tTheme text,\n\tHost_city_ID number,\n\tHosts text,\n\tprimary key ( Competition_ID ),\n\tforeign key ( Host_city_ID ) references city ( City_ID )\n)\n\nCREATE TABLE competition_record (\n\tCompetition_ID number,\n\tFarm_ID number,\n\tRank number,\n\tprimary key ( Competition_ID , Farm_ID ),\n\tforeign key ( Farm_ID ) references farm ( Farm_ID ),\n\tforeign key ( Competition_ID ) references farm_competition ( Competition_ID )\n)\n\nValid Operators:\nThe following operators are available for query decomposition:\n- Scan: Direct table access with no sub-questions\n- Filter: Selection based on conditions\n- Aggregate: Group and compute aggregations\n- Sort: Order results\n- Topsort: Sort and limit results\n- Top: Limit results\n- Join: Combine two sub-queries\n- Except: Set difference between two sub-queries\n- Intersect: Set intersection between two sub-queries\n- Union: Set union of two sub-queries\n\nOperator Rules:\n1. Each decomposition MUST specify exactly one operator from the above list\n2. Operator constraints:\n - Scan: Cannot have sub-questions\n - Filter/Aggregate/Sort/Top/Topsort: Can have 1 sub-question\n - Join/Union/Intersect/Except: Must have exactly 2 sub-questions\n\nTask Description:\n1. You will receive a complex database question that needs to be decomposed\n2. For each question, you should:\n - First, determine the appropriate operator from the valid list\n - Then break it down into sub-questions according to the operator's rules\n - Explain how these sub-questions relate to the original question\n - Indicate the order in which these sub-questions should be answered\n\nResponse Format:\nFor each decomposition step, respond with this exact JSON format without any other text:\n{\n \"type\": \"object\",\n \"properties\": {\n \"index\": {\n \"type\": [\n \"integer\",\n \"null\"\n ]\n },\n \"question\": {\n \"type\": \"string\"\n },\n \"operator\": {\n \"type\": [\n \"string\",\n \"null\"\n ],\n \"enum\": [\n \"Scan\",\n \"Filter\",\n \"Aggregate\",\n \"Sort\",\n \"Top\",\n \"Join\",\n \"Union\",\n \"Intersect\",\n \"Except\",\n null\n ]\n },\n \"sub_questions\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#\"\n }\n }\n },\n \"required\": [\n \"index\",\n \"question\",\n \"operator\"\n ]\n}\n\nConversation Flow:\n1. User will provide the initial complex question\n2. You will:\n a. Choose an appropriate operator\n b. Decompose into sub-questions according to operator rules\n3. User will ask you to decompose one of the sub-questions if needed\n4. This process continues until we reach simple, directly answerable questions (Scan operations)\n\nImportant Rules:\n- Each decomposition MUST use exactly one operator from the valid list\n- Operator choice must be justified and appropriate for the question\n- Sub-questions must comply with the operator's requirements\n- Each sub-question should be simpler than the original question\n- Sub-questions should be clear and self-contained\n- Maintain context between decomposition steps\n- Use only tables and columns that exist in the provided schema\n",
"role": "system"
},
{
"content": "decompose the following question: Show the host city ids of all competitions.",
"role": "user"
},
{
"content": "{\"index\":1,\"question\":\"Show the host city ids of all competitions.\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
}
] |
4e7c634308ce04be87c7346458ee0d0e056b6f4f3162c938cb563738ec1fe77b_4
|
farm
|
Show the ids and official names of all the cities.
|
[
"#1 = Scan Table [ city ] Output [ City_ID , Official_Name ]"
] |
[
"Show the ids and official names of all the cities."
] |
[
{
"content": "You are a question decomposition expert. You are given a database schema and a complex database input question in natural language, and your task is to break down the complex database input question into simpler sub-questions in a recursive way, like a tree. In each step you will be given a question to decompose, so that your answer will be the input for the next steps.\n\nInput Question:\nShow the official names of the cities that have hosted more than one competition.\n\nDatabase Name:\nfarm\n\nDatabase Schema:\nCREATE TABLE city (\n\tCity_ID number,\n\tOfficial_Name text,\n\tStatus text,\n\tArea_km_2 number,\n\tPopulation number,\n\tCensus_Ranking text,\n\tprimary key ( City_ID )\n)\n\nCREATE TABLE farm (\n\tFarm_ID number,\n\tYear number,\n\tTotal_Horses number,\n\tWorking_Horses number,\n\tTotal_Cattle number,\n\tOxen number,\n\tBulls number,\n\tCows number,\n\tPigs number,\n\tSheep_and_Goats number,\n\tprimary key ( Farm_ID )\n)\n\nCREATE TABLE farm_competition (\n\tCompetition_ID number,\n\tYear number,\n\tTheme text,\n\tHost_city_ID number,\n\tHosts text,\n\tprimary key ( Competition_ID ),\n\tforeign key ( Host_city_ID ) references city ( City_ID )\n)\n\nCREATE TABLE competition_record (\n\tCompetition_ID number,\n\tFarm_ID number,\n\tRank number,\n\tprimary key ( Competition_ID , Farm_ID ),\n\tforeign key ( Farm_ID ) references farm ( Farm_ID ),\n\tforeign key ( Competition_ID ) references farm_competition ( Competition_ID )\n)\n\nValid Operators:\nThe following operators are available for query decomposition:\n- Scan: Direct table access with no sub-questions\n- Filter: Selection based on conditions\n- Aggregate: Group and compute aggregations\n- Sort: Order results\n- Topsort: Sort and limit results\n- Top: Limit results\n- Join: Combine two sub-queries\n- Except: Set difference between two sub-queries\n- Intersect: Set intersection between two sub-queries\n- Union: Set union of two sub-queries\n\nOperator Rules:\n1. Each decomposition MUST specify exactly one operator from the above list\n2. Operator constraints:\n - Scan: Cannot have sub-questions\n - Filter/Aggregate/Sort/Top/Topsort: Can have 1 sub-question\n - Join/Union/Intersect/Except: Must have exactly 2 sub-questions\n\nTask Description:\n1. You will receive a complex database question that needs to be decomposed\n2. For each question, you should:\n - First, determine the appropriate operator from the valid list\n - Then break it down into sub-questions according to the operator's rules\n - Explain how these sub-questions relate to the original question\n - Indicate the order in which these sub-questions should be answered\n\nResponse Format:\nFor each decomposition step, respond with this exact JSON format without any other text:\n{\n \"type\": \"object\",\n \"properties\": {\n \"index\": {\n \"type\": [\n \"integer\",\n \"null\"\n ]\n },\n \"question\": {\n \"type\": \"string\"\n },\n \"operator\": {\n \"type\": [\n \"string\",\n \"null\"\n ],\n \"enum\": [\n \"Scan\",\n \"Filter\",\n \"Aggregate\",\n \"Sort\",\n \"Top\",\n \"Join\",\n \"Union\",\n \"Intersect\",\n \"Except\",\n null\n ]\n },\n \"sub_questions\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#\"\n }\n }\n },\n \"required\": [\n \"index\",\n \"question\",\n \"operator\"\n ]\n}\n\nConversation Flow:\n1. User will provide the initial complex question\n2. You will:\n a. Choose an appropriate operator\n b. Decompose into sub-questions according to operator rules\n3. User will ask you to decompose one of the sub-questions if needed\n4. This process continues until we reach simple, directly answerable questions (Scan operations)\n\nImportant Rules:\n- Each decomposition MUST use exactly one operator from the valid list\n- Operator choice must be justified and appropriate for the question\n- Sub-questions must comply with the operator's requirements\n- Each sub-question should be simpler than the original question\n- Sub-questions should be clear and self-contained\n- Maintain context between decomposition steps\n- Use only tables and columns that exist in the provided schema\n",
"role": "system"
},
{
"content": "decompose the following question: Show the ids and official names of all the cities.",
"role": "user"
},
{
"content": "{\"index\":1,\"question\":\"Show the ids and official names of all the cities.\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
}
] |
a65f44a4ab12c64c23fc8a4a994c4e453a6f200fe69ad40b4ccd4e8c905361a8_0
|
farm
|
Show the official names of the cities that have hosted more than one competition.
|
[
"#1 = Scan Table [ farm_competition ] Output [ Host_city_ID ]",
"#2 = Scan Table [ city ] Output [ City_ID , Official_Name ]",
"#3 = Join [ #1 , #2 ] Predicate [ #1.Host_city_ID = #2.City_ID ] Output [ #1.Host_city_ID , #2.Official_Name , #2.City_ID ]",
"#4 = Aggregate [ #3 ] GroupBy [ Host_city_ID ] Output [ countstar AS Count_Star , Official_Name ]",
"#5 = Filter [ #4 ] Predicate [ Count_Star > 1 ] Output [ Official_Name ]"
] |
[
"Show the host city ids of all competitions.",
"Show the ids and official names of all the cities.",
"Show the host city ids and official names of all competitions.",
"Show the the official names of the cities and the number of competitions have hosted for each host city id.",
"Show the official names of the cities that have hosted more than one competition."
] |
[
{
"content": "You are a question decomposition expert. You are given a database schema and a complex database input question in natural language, and your task is to break down the complex database input question into simpler sub-questions in a recursive way, like a tree. In each step you will be given a question to decompose, so that your answer will be the input for the next steps.\n\nInput Question:\nWhat are the official names of cities that have hosted more than one competition?\n\nDatabase Name:\nfarm\n\nDatabase Schema:\nCREATE TABLE city (\n\tCity_ID number,\n\tOfficial_Name text,\n\tStatus text,\n\tArea_km_2 number,\n\tPopulation number,\n\tCensus_Ranking text,\n\tprimary key ( City_ID )\n)\n\nCREATE TABLE farm (\n\tFarm_ID number,\n\tYear number,\n\tTotal_Horses number,\n\tWorking_Horses number,\n\tTotal_Cattle number,\n\tOxen number,\n\tBulls number,\n\tCows number,\n\tPigs number,\n\tSheep_and_Goats number,\n\tprimary key ( Farm_ID )\n)\n\nCREATE TABLE farm_competition (\n\tCompetition_ID number,\n\tYear number,\n\tTheme text,\n\tHost_city_ID number,\n\tHosts text,\n\tprimary key ( Competition_ID ),\n\tforeign key ( Host_city_ID ) references city ( City_ID )\n)\n\nCREATE TABLE competition_record (\n\tCompetition_ID number,\n\tFarm_ID number,\n\tRank number,\n\tprimary key ( Competition_ID , Farm_ID ),\n\tforeign key ( Farm_ID ) references farm ( Farm_ID ),\n\tforeign key ( Competition_ID ) references farm_competition ( Competition_ID )\n)\n\nValid Operators:\nThe following operators are available for query decomposition:\n- Scan: Direct table access with no sub-questions\n- Filter: Selection based on conditions\n- Aggregate: Group and compute aggregations\n- Sort: Order results\n- Topsort: Sort and limit results\n- Top: Limit results\n- Join: Combine two sub-queries\n- Except: Set difference between two sub-queries\n- Intersect: Set intersection between two sub-queries\n- Union: Set union of two sub-queries\n\nOperator Rules:\n1. Each decomposition MUST specify exactly one operator from the above list\n2. Operator constraints:\n - Scan: Cannot have sub-questions\n - Filter/Aggregate/Sort/Top/Topsort: Can have 1 sub-question\n - Join/Union/Intersect/Except: Must have exactly 2 sub-questions\n\nTask Description:\n1. You will receive a complex database question that needs to be decomposed\n2. For each question, you should:\n - First, determine the appropriate operator from the valid list\n - Then break it down into sub-questions according to the operator's rules\n - Explain how these sub-questions relate to the original question\n - Indicate the order in which these sub-questions should be answered\n\nResponse Format:\nFor each decomposition step, respond with this exact JSON format without any other text:\n{\n \"type\": \"object\",\n \"properties\": {\n \"index\": {\n \"type\": [\n \"integer\",\n \"null\"\n ]\n },\n \"question\": {\n \"type\": \"string\"\n },\n \"operator\": {\n \"type\": [\n \"string\",\n \"null\"\n ],\n \"enum\": [\n \"Scan\",\n \"Filter\",\n \"Aggregate\",\n \"Sort\",\n \"Top\",\n \"Join\",\n \"Union\",\n \"Intersect\",\n \"Except\",\n null\n ]\n },\n \"sub_questions\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#\"\n }\n }\n },\n \"required\": [\n \"index\",\n \"question\",\n \"operator\"\n ]\n}\n\nConversation Flow:\n1. User will provide the initial complex question\n2. You will:\n a. Choose an appropriate operator\n b. Decompose into sub-questions according to operator rules\n3. User will ask you to decompose one of the sub-questions if needed\n4. This process continues until we reach simple, directly answerable questions (Scan operations)\n\nImportant Rules:\n- Each decomposition MUST use exactly one operator from the valid list\n- Operator choice must be justified and appropriate for the question\n- Sub-questions must comply with the operator's requirements\n- Each sub-question should be simpler than the original question\n- Sub-questions should be clear and self-contained\n- Maintain context between decomposition steps\n- Use only tables and columns that exist in the provided schema\n",
"role": "system"
},
{
"content": "decompose the following question: Show the official names of the cities that have hosted more than one competition.",
"role": "user"
},
{
"content": "{\"index\":1,\"question\":\"Show the official names of the cities that have hosted more than one competition.\",\"operator\":\"Filter\",\"sub_questions\":[{\"index\":2,\"question\":\"Show the the official names of the cities and the number of competitions have hosted for each host city id.\",\"operator\":null,\"sub_questions\":[]}]}",
"role": "assistant"
},
{
"content": "given the decomposition: {\"index\":1,\"question\":\"Show the official names of the cities that have hosted more than one competition.\",\"operator\":\"Filter\",\"sub_questions\":[{\"index\":2,\"question\":\"Show the the official names of the cities and the number of competitions have hosted for each host city id.\",\"operator\":null,\"sub_questions\":[]}]}\ndecompose the following question with index 2: Show the the official names of the cities and the number of competitions have hosted for each host city id.",
"role": "user"
},
{
"content": "{\"index\":2,\"question\":\"Show the the official names of the cities and the number of competitions have hosted for each host city id.\",\"operator\":\"Aggregate\",\"sub_questions\":[{\"index\":3,\"question\":\"Show the host city ids and official names of all competitions.\",\"operator\":null,\"sub_questions\":[]}]}",
"role": "assistant"
},
{
"content": "given the decomposition: {\"index\":1,\"question\":\"Show the official names of the cities that have hosted more than one competition.\",\"operator\":\"Filter\",\"sub_questions\":[{\"index\":2,\"question\":\"Show the the official names of the cities and the number of competitions have hosted for each host city id.\",\"operator\":\"Aggregate\",\"sub_questions\":[{\"index\":3,\"question\":\"Show the host city ids and official names of all competitions.\",\"operator\":null,\"sub_questions\":[]}]}]}\ndecompose the following question with index 3: Show the host city ids and official names of all competitions.",
"role": "user"
},
{
"content": "{\"index\":3,\"question\":\"Show the host city ids and official names of all competitions.\",\"operator\":\"Join\",\"sub_questions\":[{\"index\":4,\"question\":\"Show the host city ids of all competitions.\",\"operator\":null,\"sub_questions\":[]},{\"index\":5,\"question\":\"Show the ids and official names of all the cities.\",\"operator\":null,\"sub_questions\":[]}]}",
"role": "assistant"
},
{
"content": "given the decomposition: {\"index\":1,\"question\":\"Show the official names of the cities that have hosted more than one competition.\",\"operator\":\"Filter\",\"sub_questions\":[{\"index\":2,\"question\":\"Show the the official names of the cities and the number of competitions have hosted for each host city id.\",\"operator\":\"Aggregate\",\"sub_questions\":[{\"index\":3,\"question\":\"Show the host city ids and official names of all competitions.\",\"operator\":\"Join\",\"sub_questions\":[{\"index\":4,\"question\":\"Show the host city ids of all competitions.\",\"operator\":null,\"sub_questions\":[]},{\"index\":5,\"question\":\"Show the ids and official names of all the cities.\",\"operator\":null,\"sub_questions\":[]}]}]}]}\ndecompose the following question with index 4: Show the host city ids of all competitions.",
"role": "user"
},
{
"content": "{\"index\":4,\"question\":\"Show the host city ids of all competitions.\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
},
{
"content": "given the decomposition: {\"index\":1,\"question\":\"Show the official names of the cities that have hosted more than one competition.\",\"operator\":\"Filter\",\"sub_questions\":[{\"index\":2,\"question\":\"Show the the official names of the cities and the number of competitions have hosted for each host city id.\",\"operator\":\"Aggregate\",\"sub_questions\":[{\"index\":3,\"question\":\"Show the host city ids and official names of all competitions.\",\"operator\":\"Join\",\"sub_questions\":[{\"index\":4,\"question\":\"Show the host city ids of all competitions.\",\"operator\":\"Scan\",\"sub_questions\":[]},{\"index\":5,\"question\":\"Show the ids and official names of all the cities.\",\"operator\":null,\"sub_questions\":[]}]}]}]}\ndecompose the following question with index 5: Show the ids and official names of all the cities.",
"role": "user"
},
{
"content": "{\"index\":5,\"question\":\"Show the ids and official names of all the cities.\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
}
] |
a65f44a4ab12c64c23fc8a4a994c4e453a6f200fe69ad40b4ccd4e8c905361a8_1
|
farm
|
Show the the official names of the cities and the number of competitions have hosted for each host city id.
|
[
"#1 = Scan Table [ farm_competition ] Output [ Host_city_ID ]",
"#2 = Scan Table [ city ] Output [ City_ID , Official_Name ]",
"#3 = Join [ #1 , #2 ] Predicate [ #1.Host_city_ID = #2.City_ID ] Output [ #1.Host_city_ID , #2.Official_Name , #2.City_ID ]",
"#4 = Aggregate [ #3 ] GroupBy [ Host_city_ID ] Output [ countstar AS Count_Star , Official_Name ]"
] |
[
"Show the host city ids of all competitions.",
"Show the ids and official names of all the cities.",
"Show the host city ids and official names of all competitions.",
"Show the the official names of the cities and the number of competitions have hosted for each host city id."
] |
[
{
"content": "You are a question decomposition expert. You are given a database schema and a complex database input question in natural language, and your task is to break down the complex database input question into simpler sub-questions in a recursive way, like a tree. In each step you will be given a question to decompose, so that your answer will be the input for the next steps.\n\nInput Question:\nWhat are the official names of cities that have hosted more than one competition?\n\nDatabase Name:\nfarm\n\nDatabase Schema:\nCREATE TABLE city (\n\tCity_ID number,\n\tOfficial_Name text,\n\tStatus text,\n\tArea_km_2 number,\n\tPopulation number,\n\tCensus_Ranking text,\n\tprimary key ( City_ID )\n)\n\nCREATE TABLE farm (\n\tFarm_ID number,\n\tYear number,\n\tTotal_Horses number,\n\tWorking_Horses number,\n\tTotal_Cattle number,\n\tOxen number,\n\tBulls number,\n\tCows number,\n\tPigs number,\n\tSheep_and_Goats number,\n\tprimary key ( Farm_ID )\n)\n\nCREATE TABLE farm_competition (\n\tCompetition_ID number,\n\tYear number,\n\tTheme text,\n\tHost_city_ID number,\n\tHosts text,\n\tprimary key ( Competition_ID ),\n\tforeign key ( Host_city_ID ) references city ( City_ID )\n)\n\nCREATE TABLE competition_record (\n\tCompetition_ID number,\n\tFarm_ID number,\n\tRank number,\n\tprimary key ( Competition_ID , Farm_ID ),\n\tforeign key ( Farm_ID ) references farm ( Farm_ID ),\n\tforeign key ( Competition_ID ) references farm_competition ( Competition_ID )\n)\n\nValid Operators:\nThe following operators are available for query decomposition:\n- Scan: Direct table access with no sub-questions\n- Filter: Selection based on conditions\n- Aggregate: Group and compute aggregations\n- Sort: Order results\n- Topsort: Sort and limit results\n- Top: Limit results\n- Join: Combine two sub-queries\n- Except: Set difference between two sub-queries\n- Intersect: Set intersection between two sub-queries\n- Union: Set union of two sub-queries\n\nOperator Rules:\n1. Each decomposition MUST specify exactly one operator from the above list\n2. Operator constraints:\n - Scan: Cannot have sub-questions\n - Filter/Aggregate/Sort/Top/Topsort: Can have 1 sub-question\n - Join/Union/Intersect/Except: Must have exactly 2 sub-questions\n\nTask Description:\n1. You will receive a complex database question that needs to be decomposed\n2. For each question, you should:\n - First, determine the appropriate operator from the valid list\n - Then break it down into sub-questions according to the operator's rules\n - Explain how these sub-questions relate to the original question\n - Indicate the order in which these sub-questions should be answered\n\nResponse Format:\nFor each decomposition step, respond with this exact JSON format without any other text:\n{\n \"type\": \"object\",\n \"properties\": {\n \"index\": {\n \"type\": [\n \"integer\",\n \"null\"\n ]\n },\n \"question\": {\n \"type\": \"string\"\n },\n \"operator\": {\n \"type\": [\n \"string\",\n \"null\"\n ],\n \"enum\": [\n \"Scan\",\n \"Filter\",\n \"Aggregate\",\n \"Sort\",\n \"Top\",\n \"Join\",\n \"Union\",\n \"Intersect\",\n \"Except\",\n null\n ]\n },\n \"sub_questions\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#\"\n }\n }\n },\n \"required\": [\n \"index\",\n \"question\",\n \"operator\"\n ]\n}\n\nConversation Flow:\n1. User will provide the initial complex question\n2. You will:\n a. Choose an appropriate operator\n b. Decompose into sub-questions according to operator rules\n3. User will ask you to decompose one of the sub-questions if needed\n4. This process continues until we reach simple, directly answerable questions (Scan operations)\n\nImportant Rules:\n- Each decomposition MUST use exactly one operator from the valid list\n- Operator choice must be justified and appropriate for the question\n- Sub-questions must comply with the operator's requirements\n- Each sub-question should be simpler than the original question\n- Sub-questions should be clear and self-contained\n- Maintain context between decomposition steps\n- Use only tables and columns that exist in the provided schema\n",
"role": "system"
},
{
"content": "decompose the following question: Show the the official names of the cities and the number of competitions have hosted for each host city id.",
"role": "user"
},
{
"content": "{\"index\":1,\"question\":\"Show the the official names of the cities and the number of competitions have hosted for each host city id.\",\"operator\":\"Aggregate\",\"sub_questions\":[{\"index\":2,\"question\":\"Show the host city ids and official names of all competitions.\",\"operator\":null,\"sub_questions\":[]}]}",
"role": "assistant"
},
{
"content": "given the decomposition: {\"index\":1,\"question\":\"Show the the official names of the cities and the number of competitions have hosted for each host city id.\",\"operator\":\"Aggregate\",\"sub_questions\":[{\"index\":2,\"question\":\"Show the host city ids and official names of all competitions.\",\"operator\":null,\"sub_questions\":[]}]}\ndecompose the following question with index 2: Show the host city ids and official names of all competitions.",
"role": "user"
},
{
"content": "{\"index\":2,\"question\":\"Show the host city ids and official names of all competitions.\",\"operator\":\"Join\",\"sub_questions\":[{\"index\":3,\"question\":\"Show the host city ids of all competitions.\",\"operator\":null,\"sub_questions\":[]},{\"index\":4,\"question\":\"Show the ids and official names of all the cities.\",\"operator\":null,\"sub_questions\":[]}]}",
"role": "assistant"
},
{
"content": "given the decomposition: {\"index\":1,\"question\":\"Show the the official names of the cities and the number of competitions have hosted for each host city id.\",\"operator\":\"Aggregate\",\"sub_questions\":[{\"index\":2,\"question\":\"Show the host city ids and official names of all competitions.\",\"operator\":\"Join\",\"sub_questions\":[{\"index\":3,\"question\":\"Show the host city ids of all competitions.\",\"operator\":null,\"sub_questions\":[]},{\"index\":4,\"question\":\"Show the ids and official names of all the cities.\",\"operator\":null,\"sub_questions\":[]}]}]}\ndecompose the following question with index 3: Show the host city ids of all competitions.",
"role": "user"
},
{
"content": "{\"index\":3,\"question\":\"Show the host city ids of all competitions.\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
},
{
"content": "given the decomposition: {\"index\":1,\"question\":\"Show the the official names of the cities and the number of competitions have hosted for each host city id.\",\"operator\":\"Aggregate\",\"sub_questions\":[{\"index\":2,\"question\":\"Show the host city ids and official names of all competitions.\",\"operator\":\"Join\",\"sub_questions\":[{\"index\":3,\"question\":\"Show the host city ids of all competitions.\",\"operator\":\"Scan\",\"sub_questions\":[]},{\"index\":4,\"question\":\"Show the ids and official names of all the cities.\",\"operator\":null,\"sub_questions\":[]}]}]}\ndecompose the following question with index 4: Show the ids and official names of all the cities.",
"role": "user"
},
{
"content": "{\"index\":4,\"question\":\"Show the ids and official names of all the cities.\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
}
] |
a65f44a4ab12c64c23fc8a4a994c4e453a6f200fe69ad40b4ccd4e8c905361a8_2
|
farm
|
Show the host city ids and official names of all competitions.
|
[
"#1 = Scan Table [ farm_competition ] Output [ Host_city_ID ]",
"#2 = Scan Table [ city ] Output [ City_ID , Official_Name ]",
"#3 = Join [ #1 , #2 ] Predicate [ #1.Host_city_ID = #2.City_ID ] Output [ #1.Host_city_ID , #2.Official_Name , #2.City_ID ]"
] |
[
"Show the host city ids of all competitions.",
"Show the ids and official names of all the cities.",
"Show the host city ids and official names of all competitions."
] |
[
{
"content": "You are a question decomposition expert. You are given a database schema and a complex database input question in natural language, and your task is to break down the complex database input question into simpler sub-questions in a recursive way, like a tree. In each step you will be given a question to decompose, so that your answer will be the input for the next steps.\n\nInput Question:\nWhat are the official names of cities that have hosted more than one competition?\n\nDatabase Name:\nfarm\n\nDatabase Schema:\nCREATE TABLE city (\n\tCity_ID number,\n\tOfficial_Name text,\n\tStatus text,\n\tArea_km_2 number,\n\tPopulation number,\n\tCensus_Ranking text,\n\tprimary key ( City_ID )\n)\n\nCREATE TABLE farm (\n\tFarm_ID number,\n\tYear number,\n\tTotal_Horses number,\n\tWorking_Horses number,\n\tTotal_Cattle number,\n\tOxen number,\n\tBulls number,\n\tCows number,\n\tPigs number,\n\tSheep_and_Goats number,\n\tprimary key ( Farm_ID )\n)\n\nCREATE TABLE farm_competition (\n\tCompetition_ID number,\n\tYear number,\n\tTheme text,\n\tHost_city_ID number,\n\tHosts text,\n\tprimary key ( Competition_ID ),\n\tforeign key ( Host_city_ID ) references city ( City_ID )\n)\n\nCREATE TABLE competition_record (\n\tCompetition_ID number,\n\tFarm_ID number,\n\tRank number,\n\tprimary key ( Competition_ID , Farm_ID ),\n\tforeign key ( Farm_ID ) references farm ( Farm_ID ),\n\tforeign key ( Competition_ID ) references farm_competition ( Competition_ID )\n)\n\nValid Operators:\nThe following operators are available for query decomposition:\n- Scan: Direct table access with no sub-questions\n- Filter: Selection based on conditions\n- Aggregate: Group and compute aggregations\n- Sort: Order results\n- Topsort: Sort and limit results\n- Top: Limit results\n- Join: Combine two sub-queries\n- Except: Set difference between two sub-queries\n- Intersect: Set intersection between two sub-queries\n- Union: Set union of two sub-queries\n\nOperator Rules:\n1. Each decomposition MUST specify exactly one operator from the above list\n2. Operator constraints:\n - Scan: Cannot have sub-questions\n - Filter/Aggregate/Sort/Top/Topsort: Can have 1 sub-question\n - Join/Union/Intersect/Except: Must have exactly 2 sub-questions\n\nTask Description:\n1. You will receive a complex database question that needs to be decomposed\n2. For each question, you should:\n - First, determine the appropriate operator from the valid list\n - Then break it down into sub-questions according to the operator's rules\n - Explain how these sub-questions relate to the original question\n - Indicate the order in which these sub-questions should be answered\n\nResponse Format:\nFor each decomposition step, respond with this exact JSON format without any other text:\n{\n \"type\": \"object\",\n \"properties\": {\n \"index\": {\n \"type\": [\n \"integer\",\n \"null\"\n ]\n },\n \"question\": {\n \"type\": \"string\"\n },\n \"operator\": {\n \"type\": [\n \"string\",\n \"null\"\n ],\n \"enum\": [\n \"Scan\",\n \"Filter\",\n \"Aggregate\",\n \"Sort\",\n \"Top\",\n \"Join\",\n \"Union\",\n \"Intersect\",\n \"Except\",\n null\n ]\n },\n \"sub_questions\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#\"\n }\n }\n },\n \"required\": [\n \"index\",\n \"question\",\n \"operator\"\n ]\n}\n\nConversation Flow:\n1. User will provide the initial complex question\n2. You will:\n a. Choose an appropriate operator\n b. Decompose into sub-questions according to operator rules\n3. User will ask you to decompose one of the sub-questions if needed\n4. This process continues until we reach simple, directly answerable questions (Scan operations)\n\nImportant Rules:\n- Each decomposition MUST use exactly one operator from the valid list\n- Operator choice must be justified and appropriate for the question\n- Sub-questions must comply with the operator's requirements\n- Each sub-question should be simpler than the original question\n- Sub-questions should be clear and self-contained\n- Maintain context between decomposition steps\n- Use only tables and columns that exist in the provided schema\n",
"role": "system"
},
{
"content": "decompose the following question: Show the host city ids and official names of all competitions.",
"role": "user"
},
{
"content": "{\"index\":1,\"question\":\"Show the host city ids and official names of all competitions.\",\"operator\":\"Join\",\"sub_questions\":[{\"index\":2,\"question\":\"Show the host city ids of all competitions.\",\"operator\":null,\"sub_questions\":[]},{\"index\":3,\"question\":\"Show the ids and official names of all the cities.\",\"operator\":null,\"sub_questions\":[]}]}",
"role": "assistant"
},
{
"content": "given the decomposition: {\"index\":1,\"question\":\"Show the host city ids and official names of all competitions.\",\"operator\":\"Join\",\"sub_questions\":[{\"index\":2,\"question\":\"Show the host city ids of all competitions.\",\"operator\":null,\"sub_questions\":[]},{\"index\":3,\"question\":\"Show the ids and official names of all the cities.\",\"operator\":null,\"sub_questions\":[]}]}\ndecompose the following question with index 2: Show the host city ids of all competitions.",
"role": "user"
},
{
"content": "{\"index\":2,\"question\":\"Show the host city ids of all competitions.\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
},
{
"content": "given the decomposition: {\"index\":1,\"question\":\"Show the host city ids and official names of all competitions.\",\"operator\":\"Join\",\"sub_questions\":[{\"index\":2,\"question\":\"Show the host city ids of all competitions.\",\"operator\":\"Scan\",\"sub_questions\":[]},{\"index\":3,\"question\":\"Show the ids and official names of all the cities.\",\"operator\":null,\"sub_questions\":[]}]}\ndecompose the following question with index 3: Show the ids and official names of all the cities.",
"role": "user"
},
{
"content": "{\"index\":3,\"question\":\"Show the ids and official names of all the cities.\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
}
] |
a65f44a4ab12c64c23fc8a4a994c4e453a6f200fe69ad40b4ccd4e8c905361a8_3
|
farm
|
Show the host city ids of all competitions.
|
[
"#1 = Scan Table [ farm_competition ] Output [ Host_city_ID ]"
] |
[
"Show the host city ids of all competitions."
] |
[
{
"content": "You are a question decomposition expert. You are given a database schema and a complex database input question in natural language, and your task is to break down the complex database input question into simpler sub-questions in a recursive way, like a tree. In each step you will be given a question to decompose, so that your answer will be the input for the next steps.\n\nInput Question:\nWhat are the official names of cities that have hosted more than one competition?\n\nDatabase Name:\nfarm\n\nDatabase Schema:\nCREATE TABLE city (\n\tCity_ID number,\n\tOfficial_Name text,\n\tStatus text,\n\tArea_km_2 number,\n\tPopulation number,\n\tCensus_Ranking text,\n\tprimary key ( City_ID )\n)\n\nCREATE TABLE farm (\n\tFarm_ID number,\n\tYear number,\n\tTotal_Horses number,\n\tWorking_Horses number,\n\tTotal_Cattle number,\n\tOxen number,\n\tBulls number,\n\tCows number,\n\tPigs number,\n\tSheep_and_Goats number,\n\tprimary key ( Farm_ID )\n)\n\nCREATE TABLE farm_competition (\n\tCompetition_ID number,\n\tYear number,\n\tTheme text,\n\tHost_city_ID number,\n\tHosts text,\n\tprimary key ( Competition_ID ),\n\tforeign key ( Host_city_ID ) references city ( City_ID )\n)\n\nCREATE TABLE competition_record (\n\tCompetition_ID number,\n\tFarm_ID number,\n\tRank number,\n\tprimary key ( Competition_ID , Farm_ID ),\n\tforeign key ( Farm_ID ) references farm ( Farm_ID ),\n\tforeign key ( Competition_ID ) references farm_competition ( Competition_ID )\n)\n\nValid Operators:\nThe following operators are available for query decomposition:\n- Scan: Direct table access with no sub-questions\n- Filter: Selection based on conditions\n- Aggregate: Group and compute aggregations\n- Sort: Order results\n- Topsort: Sort and limit results\n- Top: Limit results\n- Join: Combine two sub-queries\n- Except: Set difference between two sub-queries\n- Intersect: Set intersection between two sub-queries\n- Union: Set union of two sub-queries\n\nOperator Rules:\n1. Each decomposition MUST specify exactly one operator from the above list\n2. Operator constraints:\n - Scan: Cannot have sub-questions\n - Filter/Aggregate/Sort/Top/Topsort: Can have 1 sub-question\n - Join/Union/Intersect/Except: Must have exactly 2 sub-questions\n\nTask Description:\n1. You will receive a complex database question that needs to be decomposed\n2. For each question, you should:\n - First, determine the appropriate operator from the valid list\n - Then break it down into sub-questions according to the operator's rules\n - Explain how these sub-questions relate to the original question\n - Indicate the order in which these sub-questions should be answered\n\nResponse Format:\nFor each decomposition step, respond with this exact JSON format without any other text:\n{\n \"type\": \"object\",\n \"properties\": {\n \"index\": {\n \"type\": [\n \"integer\",\n \"null\"\n ]\n },\n \"question\": {\n \"type\": \"string\"\n },\n \"operator\": {\n \"type\": [\n \"string\",\n \"null\"\n ],\n \"enum\": [\n \"Scan\",\n \"Filter\",\n \"Aggregate\",\n \"Sort\",\n \"Top\",\n \"Join\",\n \"Union\",\n \"Intersect\",\n \"Except\",\n null\n ]\n },\n \"sub_questions\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#\"\n }\n }\n },\n \"required\": [\n \"index\",\n \"question\",\n \"operator\"\n ]\n}\n\nConversation Flow:\n1. User will provide the initial complex question\n2. You will:\n a. Choose an appropriate operator\n b. Decompose into sub-questions according to operator rules\n3. User will ask you to decompose one of the sub-questions if needed\n4. This process continues until we reach simple, directly answerable questions (Scan operations)\n\nImportant Rules:\n- Each decomposition MUST use exactly one operator from the valid list\n- Operator choice must be justified and appropriate for the question\n- Sub-questions must comply with the operator's requirements\n- Each sub-question should be simpler than the original question\n- Sub-questions should be clear and self-contained\n- Maintain context between decomposition steps\n- Use only tables and columns that exist in the provided schema\n",
"role": "system"
},
{
"content": "decompose the following question: Show the host city ids of all competitions.",
"role": "user"
},
{
"content": "{\"index\":1,\"question\":\"Show the host city ids of all competitions.\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
}
] |
a65f44a4ab12c64c23fc8a4a994c4e453a6f200fe69ad40b4ccd4e8c905361a8_4
|
farm
|
Show the ids and official names of all the cities.
|
[
"#1 = Scan Table [ city ] Output [ City_ID , Official_Name ]"
] |
[
"Show the ids and official names of all the cities."
] |
[
{
"content": "You are a question decomposition expert. You are given a database schema and a complex database input question in natural language, and your task is to break down the complex database input question into simpler sub-questions in a recursive way, like a tree. In each step you will be given a question to decompose, so that your answer will be the input for the next steps.\n\nInput Question:\nWhat are the official names of cities that have hosted more than one competition?\n\nDatabase Name:\nfarm\n\nDatabase Schema:\nCREATE TABLE city (\n\tCity_ID number,\n\tOfficial_Name text,\n\tStatus text,\n\tArea_km_2 number,\n\tPopulation number,\n\tCensus_Ranking text,\n\tprimary key ( City_ID )\n)\n\nCREATE TABLE farm (\n\tFarm_ID number,\n\tYear number,\n\tTotal_Horses number,\n\tWorking_Horses number,\n\tTotal_Cattle number,\n\tOxen number,\n\tBulls number,\n\tCows number,\n\tPigs number,\n\tSheep_and_Goats number,\n\tprimary key ( Farm_ID )\n)\n\nCREATE TABLE farm_competition (\n\tCompetition_ID number,\n\tYear number,\n\tTheme text,\n\tHost_city_ID number,\n\tHosts text,\n\tprimary key ( Competition_ID ),\n\tforeign key ( Host_city_ID ) references city ( City_ID )\n)\n\nCREATE TABLE competition_record (\n\tCompetition_ID number,\n\tFarm_ID number,\n\tRank number,\n\tprimary key ( Competition_ID , Farm_ID ),\n\tforeign key ( Farm_ID ) references farm ( Farm_ID ),\n\tforeign key ( Competition_ID ) references farm_competition ( Competition_ID )\n)\n\nValid Operators:\nThe following operators are available for query decomposition:\n- Scan: Direct table access with no sub-questions\n- Filter: Selection based on conditions\n- Aggregate: Group and compute aggregations\n- Sort: Order results\n- Topsort: Sort and limit results\n- Top: Limit results\n- Join: Combine two sub-queries\n- Except: Set difference between two sub-queries\n- Intersect: Set intersection between two sub-queries\n- Union: Set union of two sub-queries\n\nOperator Rules:\n1. Each decomposition MUST specify exactly one operator from the above list\n2. Operator constraints:\n - Scan: Cannot have sub-questions\n - Filter/Aggregate/Sort/Top/Topsort: Can have 1 sub-question\n - Join/Union/Intersect/Except: Must have exactly 2 sub-questions\n\nTask Description:\n1. You will receive a complex database question that needs to be decomposed\n2. For each question, you should:\n - First, determine the appropriate operator from the valid list\n - Then break it down into sub-questions according to the operator's rules\n - Explain how these sub-questions relate to the original question\n - Indicate the order in which these sub-questions should be answered\n\nResponse Format:\nFor each decomposition step, respond with this exact JSON format without any other text:\n{\n \"type\": \"object\",\n \"properties\": {\n \"index\": {\n \"type\": [\n \"integer\",\n \"null\"\n ]\n },\n \"question\": {\n \"type\": \"string\"\n },\n \"operator\": {\n \"type\": [\n \"string\",\n \"null\"\n ],\n \"enum\": [\n \"Scan\",\n \"Filter\",\n \"Aggregate\",\n \"Sort\",\n \"Top\",\n \"Join\",\n \"Union\",\n \"Intersect\",\n \"Except\",\n null\n ]\n },\n \"sub_questions\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#\"\n }\n }\n },\n \"required\": [\n \"index\",\n \"question\",\n \"operator\"\n ]\n}\n\nConversation Flow:\n1. User will provide the initial complex question\n2. You will:\n a. Choose an appropriate operator\n b. Decompose into sub-questions according to operator rules\n3. User will ask you to decompose one of the sub-questions if needed\n4. This process continues until we reach simple, directly answerable questions (Scan operations)\n\nImportant Rules:\n- Each decomposition MUST use exactly one operator from the valid list\n- Operator choice must be justified and appropriate for the question\n- Sub-questions must comply with the operator's requirements\n- Each sub-question should be simpler than the original question\n- Sub-questions should be clear and self-contained\n- Maintain context between decomposition steps\n- Use only tables and columns that exist in the provided schema\n",
"role": "system"
},
{
"content": "decompose the following question: Show the ids and official names of all the cities.",
"role": "user"
},
{
"content": "{\"index\":1,\"question\":\"Show the ids and official names of all the cities.\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
}
] |
80592e5d97f133869abf94a23234b3aee1f23c7307896f203d1ef7628a8fb305_0
|
farm
|
What is the status of the city that has hosted the most competitions?
|
[
"#1 = Scan Table [ farm_competition ] Output [ Host_city_ID ]",
"#2 = Aggregate [ #1 ] GroupBy [ Host_city_ID ] Output [ countstar AS Count_Star , Host_city_ID ]",
"#3 = Scan Table [ city ] Output [ Status , City_ID ]",
"#4 = Join [ #2 , #3 ] Predicate [ #2.Host_city_ID = #3.City_ID ] Output [ #3.Status , #2.Count_Star ]",
"#5 = TopSort [ #4 ] Rows [ 1 ] OrderBy [ Count_Star DESC ] Output [ Count_Star , Status ]"
] |
[
"What is the host city id of all competitions?",
"What are the different host city ids and the number of competitions has hosted?",
"What is the id and status of all cities?",
"For each host city id, what is the status of the city and the number of competitions has hosted.",
"What is the status of the city that has hosted the most competitions?"
] |
[
{
"content": "You are a question decomposition expert. You are given a database schema and a complex database input question in natural language, and your task is to break down the complex database input question into simpler sub-questions in a recursive way, like a tree. In each step you will be given a question to decompose, so that your answer will be the input for the next steps.\n\nInput Question:\nWhat is the status of the city that has hosted the most competitions?\n\nDatabase Name:\nfarm\n\nDatabase Schema:\nCREATE TABLE city (\n\tCity_ID number,\n\tOfficial_Name text,\n\tStatus text,\n\tArea_km_2 number,\n\tPopulation number,\n\tCensus_Ranking text,\n\tprimary key ( City_ID )\n)\n\nCREATE TABLE farm (\n\tFarm_ID number,\n\tYear number,\n\tTotal_Horses number,\n\tWorking_Horses number,\n\tTotal_Cattle number,\n\tOxen number,\n\tBulls number,\n\tCows number,\n\tPigs number,\n\tSheep_and_Goats number,\n\tprimary key ( Farm_ID )\n)\n\nCREATE TABLE farm_competition (\n\tCompetition_ID number,\n\tYear number,\n\tTheme text,\n\tHost_city_ID number,\n\tHosts text,\n\tprimary key ( Competition_ID ),\n\tforeign key ( Host_city_ID ) references city ( City_ID )\n)\n\nCREATE TABLE competition_record (\n\tCompetition_ID number,\n\tFarm_ID number,\n\tRank number,\n\tprimary key ( Competition_ID , Farm_ID ),\n\tforeign key ( Farm_ID ) references farm ( Farm_ID ),\n\tforeign key ( Competition_ID ) references farm_competition ( Competition_ID )\n)\n\nValid Operators:\nThe following operators are available for query decomposition:\n- Scan: Direct table access with no sub-questions\n- Filter: Selection based on conditions\n- Aggregate: Group and compute aggregations\n- Sort: Order results\n- Topsort: Sort and limit results\n- Top: Limit results\n- Join: Combine two sub-queries\n- Except: Set difference between two sub-queries\n- Intersect: Set intersection between two sub-queries\n- Union: Set union of two sub-queries\n\nOperator Rules:\n1. Each decomposition MUST specify exactly one operator from the above list\n2. Operator constraints:\n - Scan: Cannot have sub-questions\n - Filter/Aggregate/Sort/Top/Topsort: Can have 1 sub-question\n - Join/Union/Intersect/Except: Must have exactly 2 sub-questions\n\nTask Description:\n1. You will receive a complex database question that needs to be decomposed\n2. For each question, you should:\n - First, determine the appropriate operator from the valid list\n - Then break it down into sub-questions according to the operator's rules\n - Explain how these sub-questions relate to the original question\n - Indicate the order in which these sub-questions should be answered\n\nResponse Format:\nFor each decomposition step, respond with this exact JSON format without any other text:\n{\n \"type\": \"object\",\n \"properties\": {\n \"index\": {\n \"type\": [\n \"integer\",\n \"null\"\n ]\n },\n \"question\": {\n \"type\": \"string\"\n },\n \"operator\": {\n \"type\": [\n \"string\",\n \"null\"\n ],\n \"enum\": [\n \"Scan\",\n \"Filter\",\n \"Aggregate\",\n \"Sort\",\n \"Top\",\n \"Join\",\n \"Union\",\n \"Intersect\",\n \"Except\",\n null\n ]\n },\n \"sub_questions\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#\"\n }\n }\n },\n \"required\": [\n \"index\",\n \"question\",\n \"operator\"\n ]\n}\n\nConversation Flow:\n1. User will provide the initial complex question\n2. You will:\n a. Choose an appropriate operator\n b. Decompose into sub-questions according to operator rules\n3. User will ask you to decompose one of the sub-questions if needed\n4. This process continues until we reach simple, directly answerable questions (Scan operations)\n\nImportant Rules:\n- Each decomposition MUST use exactly one operator from the valid list\n- Operator choice must be justified and appropriate for the question\n- Sub-questions must comply with the operator's requirements\n- Each sub-question should be simpler than the original question\n- Sub-questions should be clear and self-contained\n- Maintain context between decomposition steps\n- Use only tables and columns that exist in the provided schema\n",
"role": "system"
},
{
"content": "decompose the following question: What is the status of the city that has hosted the most competitions?",
"role": "user"
},
{
"content": "{\"index\":1,\"question\":\"What is the status of the city that has hosted the most competitions?\",\"operator\":\"TopSort\",\"sub_questions\":[{\"index\":2,\"question\":\"For each host city id, what is the status of the city and the number of competitions has hosted.\",\"operator\":null,\"sub_questions\":[]}]}",
"role": "assistant"
},
{
"content": "given the decomposition: {\"index\":1,\"question\":\"What is the status of the city that has hosted the most competitions?\",\"operator\":\"TopSort\",\"sub_questions\":[{\"index\":2,\"question\":\"For each host city id, what is the status of the city and the number of competitions has hosted.\",\"operator\":null,\"sub_questions\":[]}]}\ndecompose the following question with index 2: For each host city id, what is the status of the city and the number of competitions has hosted.",
"role": "user"
},
{
"content": "{\"index\":2,\"question\":\"For each host city id, what is the status of the city and the number of competitions has hosted.\",\"operator\":\"Join\",\"sub_questions\":[{\"index\":3,\"question\":\"What are the different host city ids and the number of competitions has hosted?\",\"operator\":null,\"sub_questions\":[]},{\"index\":4,\"question\":\"What is the id and status of all cities?\",\"operator\":null,\"sub_questions\":[]}]}",
"role": "assistant"
},
{
"content": "given the decomposition: {\"index\":1,\"question\":\"What is the status of the city that has hosted the most competitions?\",\"operator\":\"TopSort\",\"sub_questions\":[{\"index\":2,\"question\":\"For each host city id, what is the status of the city and the number of competitions has hosted.\",\"operator\":\"Join\",\"sub_questions\":[{\"index\":3,\"question\":\"What are the different host city ids and the number of competitions has hosted?\",\"operator\":null,\"sub_questions\":[]},{\"index\":4,\"question\":\"What is the id and status of all cities?\",\"operator\":null,\"sub_questions\":[]}]}]}\ndecompose the following question with index 3: What are the different host city ids and the number of competitions has hosted?",
"role": "user"
},
{
"content": "{\"index\":3,\"question\":\"What are the different host city ids and the number of competitions has hosted?\",\"operator\":\"Aggregate\",\"sub_questions\":[{\"index\":5,\"question\":\"What is the host city id of all competitions?\",\"operator\":null,\"sub_questions\":[]}]}",
"role": "assistant"
},
{
"content": "given the decomposition: {\"index\":1,\"question\":\"What is the status of the city that has hosted the most competitions?\",\"operator\":\"TopSort\",\"sub_questions\":[{\"index\":2,\"question\":\"For each host city id, what is the status of the city and the number of competitions has hosted.\",\"operator\":\"Join\",\"sub_questions\":[{\"index\":3,\"question\":\"What are the different host city ids and the number of competitions has hosted?\",\"operator\":\"Aggregate\",\"sub_questions\":[{\"index\":5,\"question\":\"What is the host city id of all competitions?\",\"operator\":null,\"sub_questions\":[]}]},{\"index\":4,\"question\":\"What is the id and status of all cities?\",\"operator\":null,\"sub_questions\":[]}]}]}\ndecompose the following question with index 4: What is the id and status of all cities?",
"role": "user"
},
{
"content": "{\"index\":4,\"question\":\"What is the id and status of all cities?\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
},
{
"content": "given the decomposition: {\"index\":1,\"question\":\"What is the status of the city that has hosted the most competitions?\",\"operator\":\"TopSort\",\"sub_questions\":[{\"index\":2,\"question\":\"For each host city id, what is the status of the city and the number of competitions has hosted.\",\"operator\":\"Join\",\"sub_questions\":[{\"index\":3,\"question\":\"What are the different host city ids and the number of competitions has hosted?\",\"operator\":\"Aggregate\",\"sub_questions\":[{\"index\":5,\"question\":\"What is the host city id of all competitions?\",\"operator\":null,\"sub_questions\":[]}]},{\"index\":4,\"question\":\"What is the id and status of all cities?\",\"operator\":\"Scan\",\"sub_questions\":[]}]}]}\ndecompose the following question with index 5: What is the host city id of all competitions?",
"role": "user"
},
{
"content": "{\"index\":5,\"question\":\"What is the host city id of all competitions?\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
}
] |
80592e5d97f133869abf94a23234b3aee1f23c7307896f203d1ef7628a8fb305_1
|
farm
|
For each host city id, what is the status of the city and the number of competitions has hosted.
|
[
"#1 = Scan Table [ farm_competition ] Output [ Host_city_ID ]",
"#2 = Aggregate [ #1 ] GroupBy [ Host_city_ID ] Output [ countstar AS Count_Star , Host_city_ID ]",
"#3 = Scan Table [ city ] Output [ Status , City_ID ]",
"#4 = Join [ #2 , #3 ] Predicate [ #2.Host_city_ID = #3.City_ID ] Output [ #3.Status , #2.Count_Star ]"
] |
[
"What is the host city id of all competitions?",
"What are the different host city ids and the number of competitions has hosted?",
"What is the id and status of all cities?",
"For each host city id, what is the status of the city and the number of competitions has hosted."
] |
[
{
"content": "You are a question decomposition expert. You are given a database schema and a complex database input question in natural language, and your task is to break down the complex database input question into simpler sub-questions in a recursive way, like a tree. In each step you will be given a question to decompose, so that your answer will be the input for the next steps.\n\nInput Question:\nWhat is the status of the city that has hosted the most competitions?\n\nDatabase Name:\nfarm\n\nDatabase Schema:\nCREATE TABLE city (\n\tCity_ID number,\n\tOfficial_Name text,\n\tStatus text,\n\tArea_km_2 number,\n\tPopulation number,\n\tCensus_Ranking text,\n\tprimary key ( City_ID )\n)\n\nCREATE TABLE farm (\n\tFarm_ID number,\n\tYear number,\n\tTotal_Horses number,\n\tWorking_Horses number,\n\tTotal_Cattle number,\n\tOxen number,\n\tBulls number,\n\tCows number,\n\tPigs number,\n\tSheep_and_Goats number,\n\tprimary key ( Farm_ID )\n)\n\nCREATE TABLE farm_competition (\n\tCompetition_ID number,\n\tYear number,\n\tTheme text,\n\tHost_city_ID number,\n\tHosts text,\n\tprimary key ( Competition_ID ),\n\tforeign key ( Host_city_ID ) references city ( City_ID )\n)\n\nCREATE TABLE competition_record (\n\tCompetition_ID number,\n\tFarm_ID number,\n\tRank number,\n\tprimary key ( Competition_ID , Farm_ID ),\n\tforeign key ( Farm_ID ) references farm ( Farm_ID ),\n\tforeign key ( Competition_ID ) references farm_competition ( Competition_ID )\n)\n\nValid Operators:\nThe following operators are available for query decomposition:\n- Scan: Direct table access with no sub-questions\n- Filter: Selection based on conditions\n- Aggregate: Group and compute aggregations\n- Sort: Order results\n- Topsort: Sort and limit results\n- Top: Limit results\n- Join: Combine two sub-queries\n- Except: Set difference between two sub-queries\n- Intersect: Set intersection between two sub-queries\n- Union: Set union of two sub-queries\n\nOperator Rules:\n1. Each decomposition MUST specify exactly one operator from the above list\n2. Operator constraints:\n - Scan: Cannot have sub-questions\n - Filter/Aggregate/Sort/Top/Topsort: Can have 1 sub-question\n - Join/Union/Intersect/Except: Must have exactly 2 sub-questions\n\nTask Description:\n1. You will receive a complex database question that needs to be decomposed\n2. For each question, you should:\n - First, determine the appropriate operator from the valid list\n - Then break it down into sub-questions according to the operator's rules\n - Explain how these sub-questions relate to the original question\n - Indicate the order in which these sub-questions should be answered\n\nResponse Format:\nFor each decomposition step, respond with this exact JSON format without any other text:\n{\n \"type\": \"object\",\n \"properties\": {\n \"index\": {\n \"type\": [\n \"integer\",\n \"null\"\n ]\n },\n \"question\": {\n \"type\": \"string\"\n },\n \"operator\": {\n \"type\": [\n \"string\",\n \"null\"\n ],\n \"enum\": [\n \"Scan\",\n \"Filter\",\n \"Aggregate\",\n \"Sort\",\n \"Top\",\n \"Join\",\n \"Union\",\n \"Intersect\",\n \"Except\",\n null\n ]\n },\n \"sub_questions\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#\"\n }\n }\n },\n \"required\": [\n \"index\",\n \"question\",\n \"operator\"\n ]\n}\n\nConversation Flow:\n1. User will provide the initial complex question\n2. You will:\n a. Choose an appropriate operator\n b. Decompose into sub-questions according to operator rules\n3. User will ask you to decompose one of the sub-questions if needed\n4. This process continues until we reach simple, directly answerable questions (Scan operations)\n\nImportant Rules:\n- Each decomposition MUST use exactly one operator from the valid list\n- Operator choice must be justified and appropriate for the question\n- Sub-questions must comply with the operator's requirements\n- Each sub-question should be simpler than the original question\n- Sub-questions should be clear and self-contained\n- Maintain context between decomposition steps\n- Use only tables and columns that exist in the provided schema\n",
"role": "system"
},
{
"content": "decompose the following question: For each host city id, what is the status of the city and the number of competitions has hosted.",
"role": "user"
},
{
"content": "{\"index\":1,\"question\":\"For each host city id, what is the status of the city and the number of competitions has hosted.\",\"operator\":\"Join\",\"sub_questions\":[{\"index\":2,\"question\":\"What are the different host city ids and the number of competitions has hosted?\",\"operator\":null,\"sub_questions\":[]},{\"index\":3,\"question\":\"What is the id and status of all cities?\",\"operator\":null,\"sub_questions\":[]}]}",
"role": "assistant"
},
{
"content": "given the decomposition: {\"index\":1,\"question\":\"For each host city id, what is the status of the city and the number of competitions has hosted.\",\"operator\":\"Join\",\"sub_questions\":[{\"index\":2,\"question\":\"What are the different host city ids and the number of competitions has hosted?\",\"operator\":null,\"sub_questions\":[]},{\"index\":3,\"question\":\"What is the id and status of all cities?\",\"operator\":null,\"sub_questions\":[]}]}\ndecompose the following question with index 2: What are the different host city ids and the number of competitions has hosted?",
"role": "user"
},
{
"content": "{\"index\":2,\"question\":\"What are the different host city ids and the number of competitions has hosted?\",\"operator\":\"Aggregate\",\"sub_questions\":[{\"index\":4,\"question\":\"What is the host city id of all competitions?\",\"operator\":null,\"sub_questions\":[]}]}",
"role": "assistant"
},
{
"content": "given the decomposition: {\"index\":1,\"question\":\"For each host city id, what is the status of the city and the number of competitions has hosted.\",\"operator\":\"Join\",\"sub_questions\":[{\"index\":2,\"question\":\"What are the different host city ids and the number of competitions has hosted?\",\"operator\":\"Aggregate\",\"sub_questions\":[{\"index\":4,\"question\":\"What is the host city id of all competitions?\",\"operator\":null,\"sub_questions\":[]}]},{\"index\":3,\"question\":\"What is the id and status of all cities?\",\"operator\":null,\"sub_questions\":[]}]}\ndecompose the following question with index 3: What is the id and status of all cities?",
"role": "user"
},
{
"content": "{\"index\":3,\"question\":\"What is the id and status of all cities?\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
},
{
"content": "given the decomposition: {\"index\":1,\"question\":\"For each host city id, what is the status of the city and the number of competitions has hosted.\",\"operator\":\"Join\",\"sub_questions\":[{\"index\":2,\"question\":\"What are the different host city ids and the number of competitions has hosted?\",\"operator\":\"Aggregate\",\"sub_questions\":[{\"index\":4,\"question\":\"What is the host city id of all competitions?\",\"operator\":null,\"sub_questions\":[]}]},{\"index\":3,\"question\":\"What is the id and status of all cities?\",\"operator\":\"Scan\",\"sub_questions\":[]}]}\ndecompose the following question with index 4: What is the host city id of all competitions?",
"role": "user"
},
{
"content": "{\"index\":4,\"question\":\"What is the host city id of all competitions?\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
}
] |
80592e5d97f133869abf94a23234b3aee1f23c7307896f203d1ef7628a8fb305_2
|
farm
|
What are the different host city ids and the number of competitions has hosted?
|
[
"#1 = Scan Table [ farm_competition ] Output [ Host_city_ID ]",
"#2 = Aggregate [ #1 ] GroupBy [ Host_city_ID ] Output [ countstar AS Count_Star , Host_city_ID ]"
] |
[
"What is the host city id of all competitions?",
"What are the different host city ids and the number of competitions has hosted?"
] |
[
{
"content": "You are a question decomposition expert. You are given a database schema and a complex database input question in natural language, and your task is to break down the complex database input question into simpler sub-questions in a recursive way, like a tree. In each step you will be given a question to decompose, so that your answer will be the input for the next steps.\n\nInput Question:\nWhat is the status of the city that has hosted the most competitions?\n\nDatabase Name:\nfarm\n\nDatabase Schema:\nCREATE TABLE city (\n\tCity_ID number,\n\tOfficial_Name text,\n\tStatus text,\n\tArea_km_2 number,\n\tPopulation number,\n\tCensus_Ranking text,\n\tprimary key ( City_ID )\n)\n\nCREATE TABLE farm (\n\tFarm_ID number,\n\tYear number,\n\tTotal_Horses number,\n\tWorking_Horses number,\n\tTotal_Cattle number,\n\tOxen number,\n\tBulls number,\n\tCows number,\n\tPigs number,\n\tSheep_and_Goats number,\n\tprimary key ( Farm_ID )\n)\n\nCREATE TABLE farm_competition (\n\tCompetition_ID number,\n\tYear number,\n\tTheme text,\n\tHost_city_ID number,\n\tHosts text,\n\tprimary key ( Competition_ID ),\n\tforeign key ( Host_city_ID ) references city ( City_ID )\n)\n\nCREATE TABLE competition_record (\n\tCompetition_ID number,\n\tFarm_ID number,\n\tRank number,\n\tprimary key ( Competition_ID , Farm_ID ),\n\tforeign key ( Farm_ID ) references farm ( Farm_ID ),\n\tforeign key ( Competition_ID ) references farm_competition ( Competition_ID )\n)\n\nValid Operators:\nThe following operators are available for query decomposition:\n- Scan: Direct table access with no sub-questions\n- Filter: Selection based on conditions\n- Aggregate: Group and compute aggregations\n- Sort: Order results\n- Topsort: Sort and limit results\n- Top: Limit results\n- Join: Combine two sub-queries\n- Except: Set difference between two sub-queries\n- Intersect: Set intersection between two sub-queries\n- Union: Set union of two sub-queries\n\nOperator Rules:\n1. Each decomposition MUST specify exactly one operator from the above list\n2. Operator constraints:\n - Scan: Cannot have sub-questions\n - Filter/Aggregate/Sort/Top/Topsort: Can have 1 sub-question\n - Join/Union/Intersect/Except: Must have exactly 2 sub-questions\n\nTask Description:\n1. You will receive a complex database question that needs to be decomposed\n2. For each question, you should:\n - First, determine the appropriate operator from the valid list\n - Then break it down into sub-questions according to the operator's rules\n - Explain how these sub-questions relate to the original question\n - Indicate the order in which these sub-questions should be answered\n\nResponse Format:\nFor each decomposition step, respond with this exact JSON format without any other text:\n{\n \"type\": \"object\",\n \"properties\": {\n \"index\": {\n \"type\": [\n \"integer\",\n \"null\"\n ]\n },\n \"question\": {\n \"type\": \"string\"\n },\n \"operator\": {\n \"type\": [\n \"string\",\n \"null\"\n ],\n \"enum\": [\n \"Scan\",\n \"Filter\",\n \"Aggregate\",\n \"Sort\",\n \"Top\",\n \"Join\",\n \"Union\",\n \"Intersect\",\n \"Except\",\n null\n ]\n },\n \"sub_questions\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#\"\n }\n }\n },\n \"required\": [\n \"index\",\n \"question\",\n \"operator\"\n ]\n}\n\nConversation Flow:\n1. User will provide the initial complex question\n2. You will:\n a. Choose an appropriate operator\n b. Decompose into sub-questions according to operator rules\n3. User will ask you to decompose one of the sub-questions if needed\n4. This process continues until we reach simple, directly answerable questions (Scan operations)\n\nImportant Rules:\n- Each decomposition MUST use exactly one operator from the valid list\n- Operator choice must be justified and appropriate for the question\n- Sub-questions must comply with the operator's requirements\n- Each sub-question should be simpler than the original question\n- Sub-questions should be clear and self-contained\n- Maintain context between decomposition steps\n- Use only tables and columns that exist in the provided schema\n",
"role": "system"
},
{
"content": "decompose the following question: What are the different host city ids and the number of competitions has hosted?",
"role": "user"
},
{
"content": "{\"index\":1,\"question\":\"What are the different host city ids and the number of competitions has hosted?\",\"operator\":\"Aggregate\",\"sub_questions\":[{\"index\":2,\"question\":\"What is the host city id of all competitions?\",\"operator\":null,\"sub_questions\":[]}]}",
"role": "assistant"
},
{
"content": "given the decomposition: {\"index\":1,\"question\":\"What are the different host city ids and the number of competitions has hosted?\",\"operator\":\"Aggregate\",\"sub_questions\":[{\"index\":2,\"question\":\"What is the host city id of all competitions?\",\"operator\":null,\"sub_questions\":[]}]}\ndecompose the following question with index 2: What is the host city id of all competitions?",
"role": "user"
},
{
"content": "{\"index\":2,\"question\":\"What is the host city id of all competitions?\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
}
] |
80592e5d97f133869abf94a23234b3aee1f23c7307896f203d1ef7628a8fb305_3
|
farm
|
What is the id and status of all cities?
|
[
"#1 = Scan Table [ city ] Output [ Status , City_ID ]"
] |
[
"What is the id and status of all cities?"
] |
[
{
"content": "You are a question decomposition expert. You are given a database schema and a complex database input question in natural language, and your task is to break down the complex database input question into simpler sub-questions in a recursive way, like a tree. In each step you will be given a question to decompose, so that your answer will be the input for the next steps.\n\nInput Question:\nWhat is the status of the city that has hosted the most competitions?\n\nDatabase Name:\nfarm\n\nDatabase Schema:\nCREATE TABLE city (\n\tCity_ID number,\n\tOfficial_Name text,\n\tStatus text,\n\tArea_km_2 number,\n\tPopulation number,\n\tCensus_Ranking text,\n\tprimary key ( City_ID )\n)\n\nCREATE TABLE farm (\n\tFarm_ID number,\n\tYear number,\n\tTotal_Horses number,\n\tWorking_Horses number,\n\tTotal_Cattle number,\n\tOxen number,\n\tBulls number,\n\tCows number,\n\tPigs number,\n\tSheep_and_Goats number,\n\tprimary key ( Farm_ID )\n)\n\nCREATE TABLE farm_competition (\n\tCompetition_ID number,\n\tYear number,\n\tTheme text,\n\tHost_city_ID number,\n\tHosts text,\n\tprimary key ( Competition_ID ),\n\tforeign key ( Host_city_ID ) references city ( City_ID )\n)\n\nCREATE TABLE competition_record (\n\tCompetition_ID number,\n\tFarm_ID number,\n\tRank number,\n\tprimary key ( Competition_ID , Farm_ID ),\n\tforeign key ( Farm_ID ) references farm ( Farm_ID ),\n\tforeign key ( Competition_ID ) references farm_competition ( Competition_ID )\n)\n\nValid Operators:\nThe following operators are available for query decomposition:\n- Scan: Direct table access with no sub-questions\n- Filter: Selection based on conditions\n- Aggregate: Group and compute aggregations\n- Sort: Order results\n- Topsort: Sort and limit results\n- Top: Limit results\n- Join: Combine two sub-queries\n- Except: Set difference between two sub-queries\n- Intersect: Set intersection between two sub-queries\n- Union: Set union of two sub-queries\n\nOperator Rules:\n1. Each decomposition MUST specify exactly one operator from the above list\n2. Operator constraints:\n - Scan: Cannot have sub-questions\n - Filter/Aggregate/Sort/Top/Topsort: Can have 1 sub-question\n - Join/Union/Intersect/Except: Must have exactly 2 sub-questions\n\nTask Description:\n1. You will receive a complex database question that needs to be decomposed\n2. For each question, you should:\n - First, determine the appropriate operator from the valid list\n - Then break it down into sub-questions according to the operator's rules\n - Explain how these sub-questions relate to the original question\n - Indicate the order in which these sub-questions should be answered\n\nResponse Format:\nFor each decomposition step, respond with this exact JSON format without any other text:\n{\n \"type\": \"object\",\n \"properties\": {\n \"index\": {\n \"type\": [\n \"integer\",\n \"null\"\n ]\n },\n \"question\": {\n \"type\": \"string\"\n },\n \"operator\": {\n \"type\": [\n \"string\",\n \"null\"\n ],\n \"enum\": [\n \"Scan\",\n \"Filter\",\n \"Aggregate\",\n \"Sort\",\n \"Top\",\n \"Join\",\n \"Union\",\n \"Intersect\",\n \"Except\",\n null\n ]\n },\n \"sub_questions\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#\"\n }\n }\n },\n \"required\": [\n \"index\",\n \"question\",\n \"operator\"\n ]\n}\n\nConversation Flow:\n1. User will provide the initial complex question\n2. You will:\n a. Choose an appropriate operator\n b. Decompose into sub-questions according to operator rules\n3. User will ask you to decompose one of the sub-questions if needed\n4. This process continues until we reach simple, directly answerable questions (Scan operations)\n\nImportant Rules:\n- Each decomposition MUST use exactly one operator from the valid list\n- Operator choice must be justified and appropriate for the question\n- Sub-questions must comply with the operator's requirements\n- Each sub-question should be simpler than the original question\n- Sub-questions should be clear and self-contained\n- Maintain context between decomposition steps\n- Use only tables and columns that exist in the provided schema\n",
"role": "system"
},
{
"content": "decompose the following question: What is the id and status of all cities?",
"role": "user"
},
{
"content": "{\"index\":1,\"question\":\"What is the id and status of all cities?\",\"operator\":\"Scan\",\"sub_questions\":[]}",
"role": "assistant"
}
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.