id
string | db_id
string | question
string | qpl
sequence | qd
sequence | 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"
}
] |
End of preview. Expand
in Data Studio
README.md exists but content is empty.
- Downloads last month
- 2