aherntech/sparc huggingface dataset:
Database: cre_Docs_and_Epenses
Question sequence:
List the type codes, names, and descriptions for all documents.
How about for the document named 'Noel CV'.
Also include results for the document named 'King Book'.
SQL query sequence:
SELECT document_type_code ,  document_name ,  document_description FROM Documents
SELECT document_type_code ,  document_name ,  document_description FROM Documents WHERE document_name  =  'Noel CV'
SELECT document_type_code ,  document_name ,  document_description FROM Documents WHERE document_name  =  'Noel CV' OR document_name  =  'King Book'
Final question: List the document type code, document name, and document description for the document with name 'Noel CV' or name 'King Book'.
Final SQL: SELECT document_type_code ,  document_name ,  document_description FROM Documents WHERE document_name  =  'Noel CV' OR document_name  =  'King Book'
Database: cre_Docs_and_Epenses
Question sequence:
Show all information for documents.
Show just the ids.
Also show their names.
SQL query sequence:
SELECT * FROM Documents
SELECT document_id  FROM Documents
SELECT document_id ,  document_name FROM Documents
Final question: Show the ids and names of all documents.
Final SQL: SELECT document_id ,  document_name FROM Documents
Database: cre_Docs_and_Epenses
Question sequence:
Show all document names.
What are the names for the documents with type code BK?
Also find their ids.
SQL query sequence:
SELECT document_name  FROM Documents
SELECT document_name  FROM Documents WHERE document_type_code  =  "BK"
SELECT document_name ,  document_id FROM Documents WHERE document_type_code  =  "BK"
Final question: Find names and ids of all documents with document type code BK.
Final SQL: SELECT document_name ,  document_id FROM Documents WHERE document_type_code  =  "BK"
Database: cre_Docs_and_Epenses
Question sequence:
Show the project id for documents.
Show the ids only for the documents with type code BK.
For each project id, show the number of such documents.
SQL query sequence:
SELECT project_id FROM Documents
SELECT project_id FROM Documents WHERE document_type_code  =  "BK"
SELECT count(*) ,  project_id FROM Documents WHERE document_type_code  =  "BK" GROUP BY project_id
Final question: How many documents are with document type code BK for each product id?
Final SQL: SELECT count(*) ,  project_id FROM Documents WHERE document_type_code  =  "BK" GROUP BY project_id
Database: cre_Docs_and_Epenses
Question sequence:
Show the name and date for all documents.
For those documents, also show their project details.
What are the names and dates for documents with 'Graph Database project' as their details?
SQL query sequence:
SELECT document_name ,  document_date FROM Documents
SELECT document_name ,  document_date, T2.project_details FROM Documents AS T1 JOIN projects AS T2 ON T1.project_id  =  T2.project_id
SELECT document_name ,  document_date FROM Documents AS T1 JOIN projects AS T2 ON T1.project_id  =  T2.project_id WHERE T2.project_details  =  'Graph Database project'
Final question: Show the document name and the document date for all documents on project with details 'Graph Database project'.
Final SQL: SELECT document_name ,  document_date FROM Documents AS T1 JOIN projects AS T2 ON T1.project_id  =  T2.project_id WHERE T2.project_details  =  'Graph Database project'
Database: cre_Docs_and_Epenses
Question sequence:
Show the project id for the documents.
For each of id, count the number of documents.
SQL query sequence:
SELECT project_id FROM Documents
SELECT project_id ,  count(*) FROM Documents GROUP BY project_id
Final question: Show project ids and the number of documents in each project.
Final SQL: SELECT project_id ,  count(*) FROM Documents GROUP BY project_id
Database: cre_Docs_and_Epenses
Question sequence:
Show the project id for all documents.
For each of them, count the number of documents.
Sort the ids by these counts.
Which project id has the fewest?
SQL query sequence:
SELECT project_id FROM Documents
SELECT project_id, count(*) FROM Documents GROUP BY project_id
SELECT project_id FROM Documents GROUP BY project_id ORDER BY count(*)
SELECT project_id FROM Documents GROUP BY project_id ORDER BY count(*) ASC LIMIT 1
Final question: What is the id of the project with least number of documents?
Final SQL: SELECT project_id FROM Documents GROUP BY project_id ORDER BY count(*) ASC LIMIT 1
Database: cre_Docs_and_Epenses
Question sequence:
Show the project ids for documents.
For each of them, also show the number of documents.
Which of them have at least 2 documents?
SQL query sequence:
SELECT project_id FROM Documents
SELECT project_id, count(*) FROM Documents GROUP BY project_id
SELECT project_id FROM Documents GROUP BY project_id HAVING count(*)  >=  2
Final question: Show the ids for projects with at least 2 documents.
Final SQL: SELECT project_id FROM Documents GROUP BY project_id HAVING count(*)  >=  2
Database: cre_Docs_and_Epenses
Question sequence:
Show the type code for all documents.
For each of these codes, also show the number of documents.
SQL query sequence:
SELECT document_type_code FROM Documents
SELECT document_type_code ,  count(*) FROM Documents GROUP BY document_type_code
Final question: List document type codes and the number of documents in each code.
Final SQL: SELECT document_type_code ,  count(*) FROM Documents GROUP BY document_type_code
Database: cre_Docs_and_Epenses
Question sequence:
Show the type codes for all documents.
For each of the codes, count the number of documents.
Which code has the most documents?
SQL query sequence:
SELECT document_type_code FROM Documents
SELECT document_type_code, count(*) FROM Documents GROUP BY document_type_code
SELECT document_type_code FROM Documents GROUP BY document_type_code ORDER BY count(*) DESC LIMIT 1
Final question: What is the document type code with most number of documents?
Final SQL: SELECT document_type_code FROM Documents GROUP BY document_type_code ORDER BY count(*) DESC LIMIT 1
Database: cre_Docs_and_Epenses
Question sequence:
Show the type code for all documents.
For each of the codes, also count the number of documents.
Which codes have fewer than 3 documents?
SQL query sequence:
SELECT document_type_code FROM Documents
SELECT document_type_code, count(*) FROM Documents GROUP BY document_type_code
SELECT document_type_code FROM Documents GROUP BY document_type_code HAVING count(*)  <  3
Final question: Show the document type code with fewer than 3 documents.
Final SQL: SELECT document_type_code FROM Documents GROUP BY document_type_code HAVING count(*)  <  3
Database: cre_Docs_and_Epenses
Question sequence:
Show the details for all statements.
Also show their corresponding document names.
Only show the results for the statement with detail 'Private Project'.
SQL query sequence:
SELECT statement_details from Statements
SELECT T1.statement_details ,  T2.document_name FROM Statements AS T1 JOIN Documents AS T2 ON T1.statement_id  =  T2.document_id
SELECT T1.statement_details ,  T2.document_name FROM Statements AS T1 JOIN Documents AS T2 ON T1.statement_id  =  T2.document_id WHERE T1.statement_details  =  'Private Project'
Final question: Show the statement detail and the corresponding document name for the statement with detail 'Private Project'.
Final SQL: SELECT T1.statement_details ,  T2.document_name FROM Statements AS T1 JOIN Documents AS T2 ON T1.statement_id  =  T2.document_id WHERE T1.statement_details  =  'Private Project'
Database: cre_Docs_and_Epenses
Question sequence:
Show the type codes for all documents.
Also show the document type names and descriptions.
SQL query sequence:
SELECT document_type_code FROM Ref_document_types
SELECT document_type_code ,  document_type_name ,  document_type_description FROM Ref_document_types
Final question: Show all document type codes, document type names, document type descriptions.
Final SQL: SELECT document_type_code ,  document_type_name ,  document_type_description FROM Ref_document_types
Database: cre_Docs_and_Epenses
Question sequence:
Show the descriptions for all document types.
Only show the result for the document type "Film".
SQL query sequence:
SELECT document_type_description FROM Ref_document_types
SELECT document_type_description FROM Ref_document_types WHERE document_type_name  =  "Film"
Final question: What is the document type description for document type named Film?
Final SQL: SELECT document_type_description FROM Ref_document_types WHERE document_type_name  =  "Film"
Database: cre_Docs_and_Epenses
Question sequence:
What are the creation dates for all documents?
Also show their document type names and descriptions.
SQL query sequence:
SELECT Document_date FROM Documents
SELECT T1.document_type_name ,  T1.document_type_description ,  T2.Document_date FROM Ref_document_types AS T1 JOIN Documents AS T2 ON T1.document_type_code  =  T2.document_type_code
Final question: What is the document type name and the document type description and creation date for all the documents?
Final SQL: SELECT T1.document_type_name ,  T1.document_type_description ,  T2.Document_date FROM Ref_document_types AS T1 JOIN Documents AS T2 ON T1.document_type_code  =  T2.document_type_code
Database: cre_Docs_and_Epenses
Question sequence:
Show the information for all projects.
How many are there?
SQL query sequence:
SELECT * FROM Projects
SELECT count(*) FROM Projects
Final question: Show the number of projects.
Final SQL: SELECT count(*) FROM Projects
Database: cre_Docs_and_Epenses
Question sequence:
Show the id for all projects.
Also show their details.
SQL query sequence:
SELECT project_id FROM Projects
SELECT project_id ,  project_details FROM Projects
Final question: List ids and details for all projects.
Final SQL: SELECT project_id ,  project_details FROM Projects
Database: cre_Docs_and_Epenses
Question sequence:
Show the ids and details for all projects.
For each of them, also show the number of documents.
Which of them have at least two documents?
SQL query sequence:
SELECT project_id ,  project_details FROM Projects
SELECT T1.project_id ,  T1.project_details, count(*) FROM Projects AS T1 JOIN Documents AS T2 ON T1.project_id  =  T2.project_id GROUP BY T1.project_id
SELECT T1.project_id ,  T1.project_details FROM Projects AS T1 JOIN Documents AS T2 ON T1.project_id  =  T2.project_id GROUP BY T1.project_id HAVING count(*)  >  2
Final question: What is the project id and detail for the project with at least two documents?
Final SQL: SELECT T1.project_id ,  T1.project_details FROM Projects AS T1 JOIN Documents AS T2 ON T1.project_id  =  T2.project_id GROUP BY T1.project_id HAVING count(*)  >  2
Database: cre_Docs_and_Epenses
Question sequence:
What are all the details from projects?
Also show the document names corresponding to the projects.
Show those details only for projects with a document named "King Book".
SQL query sequence:
SELECT project_details FROM Projects
SELECT T1.project_details, T2.document_name FROM Projects AS T1 JOIN Documents AS T2 ON T1.project_id  =  T2.project_id
SELECT T1.project_details FROM Projects AS T1 JOIN Documents AS T2 ON T1.project_id  =  T2.project_id WHERE T2.document_name  =  "King Book"
Final question: What is the project detail for the project with document "King Book"?
Final SQL: SELECT T1.project_details FROM Projects AS T1 JOIN Documents AS T2 ON T1.project_id  =  T2.project_id WHERE T2.document_name  =  "King Book"
Database: cre_Docs_and_Epenses
Question sequence:
Show the information for budget codes.
How many of them do we have?
SQL query sequence:
SELECT * FROM Ref_budget_codes
SELECT count(*) FROM Ref_budget_codes
Final question: How many budget types do we have?
Final SQL: SELECT count(*) FROM Ref_budget_codes
Database: cre_Docs_and_Epenses
Question sequence:
List all budget type codes.
Add their descriptions.
SQL query sequence:
SELECT budget_type_code FROM Ref_budget_codes
SELECT budget_type_code ,  budget_type_description FROM Ref_budget_codes
Final question: List all budget type codes and descriptions.
Final SQL: SELECT budget_type_code ,  budget_type_description FROM Ref_budget_codes
Database: cre_Docs_and_Epenses
Question sequence:
What are the descriptions for the budget codes?
How about the description for the budget with code ORG?
SQL query sequence:
SELECT budget_type_description FROM Ref_budget_codes
SELECT budget_type_description FROM Ref_budget_codes WHERE budget_type_code  =  "ORG"
Final question: What is the description for the budget type with code ORG?
Final SQL: SELECT budget_type_description FROM Ref_budget_codes WHERE budget_type_code  =  "ORG"
Database: cre_Docs_and_Epenses
Question sequence:
Show information for all documents with expenses.
How many are there?
SQL query sequence:
SELECT * FROM Documents_with_expenses
SELECT count(*) FROM Documents_with_expenses
Final question: How many documents have expenses?
Final SQL: SELECT count(*) FROM Documents_with_expenses
Database: cre_Docs_and_Epenses
Question sequence:
Show the ids for documents with expenses.
Also show their budget type code.
What is the id for the documents with the budget type code 'SF'?
SQL query sequence:
SELECT document_id FROM Documents_with_expenses
SELECT document_id, budget_type_code FROM Documents_with_expenses
SELECT document_id FROM Documents_with_expenses WHERE budget_type_code  =  'SF'
Final question: What are the document ids for the budget type code 'SF'?
Final SQL: SELECT document_id FROM Documents_with_expenses WHERE budget_type_code  =  'SF'
Database: cre_Docs_and_Epenses
Question sequence:
Show the budget type code and description for all budget types.
Also show the corresponding document ids for them.
SQL query sequence:
SELECT budget_type_code ,  budget_type_description from Ref_budget_codes
SELECT T2.budget_type_code ,  T2.budget_type_description ,  T1.document_id FROM Documents_with_expenses AS T1 JOIN Ref_budget_codes AS T2 ON T1.budget_type_code  =  T2.budget_type_code
Final question: Show the budget type code and description and the corresponding document id.
Final SQL: SELECT T2.budget_type_code ,  T2.budget_type_description ,  T1.document_id FROM Documents_with_expenses AS T1 JOIN Ref_budget_codes AS T2 ON T1.budget_type_code  =  T2.budget_type_code
Database: cre_Docs_and_Epenses
Question sequence:
Show ids for all documents.
Also show their budget type descriptions.
Show ids for those documents with budget types described as 'Government'.
SQL query sequence:
SELECT document_id FROM Documents_with_expenses
SELECT T1.document_id , T2.budget_type_Description FROM Documents_with_expenses AS T1 JOIN Ref_Budget_Codes AS T2 ON T1.Budget_Type_code  =  T2.Budget_Type_code
SELECT T1.document_id FROM Documents_with_expenses AS T1 JOIN Ref_Budget_Codes AS T2 ON T1.Budget_Type_code  =  T2.Budget_Type_code WHERE T2.budget_type_Description  =  "Government"
Final question: Show ids for all documents with budget types described as 'Government'.
Final SQL: SELECT T1.document_id FROM Documents_with_expenses AS T1 JOIN Ref_Budget_Codes AS T2 ON T1.Budget_Type_code  =  T2.Budget_Type_code WHERE T2.budget_type_Description  =  "Government"
Database: cre_Docs_and_Epenses
Question sequence:
Show all the budget type codes for documents with expenses.
For each code, show the number of corresponding documents.
SQL query sequence:
SELECT budget_type_code from Documents_with_expenses
SELECT budget_type_code ,  count(*) FROM Documents_with_expenses GROUP BY budget_type_code
Final question: Show budget type codes and the number of documents in each budget type.
Final SQL: SELECT budget_type_code ,  count(*) FROM Documents_with_expenses GROUP BY budget_type_code
Database: cre_Docs_and_Epenses
Question sequence:
Show all the budget type codes for documents with expenses.
For each code, show the number of documents.
Sort the codes in descending order of the count.
Which has the most?
SQL query sequence:
SELECT budget_type_code from Documents_with_expenses
SELECT budget_type_code ,  count(*) FROM Documents_with_expenses GROUP BY budget_type_code
SELECT budget_type_code FROM Documents_with_expenses GROUP BY budget_type_code ORDER BY count(*) DESC
SELECT budget_type_code FROM Documents_with_expenses GROUP BY budget_type_code ORDER BY count(*) DESC LIMIT 1
Final question: What is the budget type code with most number of documents.
Final SQL: SELECT budget_type_code FROM Documents_with_expenses GROUP BY budget_type_code ORDER BY count(*) DESC LIMIT 1
Database: cre_Docs_and_Epenses
Question sequence:
Show document ids with an expense budget.
Show all document ids.
Among them, which documents don't have expense budgets?
SQL query sequence:
SELECT document_id FROM Documents_with_expenses
SELECT document_id FROM Documents
SELECT document_id FROM Documents EXCEPT SELECT document_id FROM Documents_with_expenses
Final question: What are the ids of documents which don't have expense budgets?
Final SQL: SELECT document_id FROM Documents EXCEPT SELECT document_id FROM Documents_with_expenses
Database: cre_Docs_and_Epenses
Question sequence:
Show all document ids with an expense budget.
Show ids for all documents in type CV.
Which of them don't have expense budgets?
SQL query sequence:
SELECT document_id FROM Documents_with_expenses
SELECT document_id FROM Documents WHERE document_type_code  =  "CV"
SELECT document_id FROM Documents WHERE document_type_code  =  "CV" EXCEPT SELECT document_id FROM Documents_with_expenses
Final question: Show ids for all documents in type CV without expense budgets.
Final SQL: SELECT document_id FROM Documents WHERE document_type_code  =  "CV" EXCEPT SELECT document_id FROM Documents_with_expenses
Database: cre_Docs_and_Epenses
Question sequence:
Show ids for all documents.
How about those with the letter 's' in the name?
Which of them have any expense budgets.
SQL query sequence:
SELECT document_id FROM Documents
SELECT document_id FROM Documents WHERE document_name LIKE '%s%'
SELECT T1.document_id FROM Documents AS T1 JOIN Documents_with_expenses AS T2 ON T1.document_id  =  T2.document_id WHERE T1.document_name LIKE '%s%'
Final question: What are the ids of documents with letter 's' in the name with any expense budgets.
Final SQL: SELECT T1.document_id FROM Documents AS T1 JOIN Documents_with_expenses AS T2 ON T1.document_id  =  T2.document_id WHERE T1.document_name LIKE '%s%'
Database: cre_Docs_and_Epenses
Question sequence:
Show the ids of documents with expenses.
Show ids for those which don't.
How many of such documents are there?
SQL query sequence:
SELECT document_id FROM Documents_with_expenses
SELECT document_id FROM Documents WHERE document_id NOT IN ( SELECT document_id FROM Documents_with_expenses )
SELECT count(*) FROM Documents WHERE document_id NOT IN ( SELECT document_id FROM Documents_with_expenses )
Final question: How many documents do not have any expense?
Final SQL: SELECT count(*) FROM Documents WHERE document_id NOT IN ( SELECT document_id FROM Documents_with_expenses )
Database: cre_Docs_and_Epenses
Question sequence:
What are the dates of all documents?
What about those with 'GV' type expenses?
What about those with 'SF' type expenses?
Show the dates for the documents with both types.
SQL query sequence:
SELECT document_date FROM Documents
SELECT T1.document_date FROM Documents AS T1 JOIN Documents_with_Expenses AS T2 ON T1.document_id  =  T2.document_id WHERE T2.budget_type_code  =  'GV'
SELECT T1.document_date FROM Documents AS T1 JOIN Documents_with_Expenses AS T2 ON T1.document_id  =  T2.document_id WHERE T2.budget_type_code  =  'SF'
SELECT T1.document_date FROM Documents AS T1 JOIN Documents_with_Expenses AS T2 ON T1.document_id  =  T2.document_id WHERE T2.budget_type_code  =  'GV' INTERSECT SELECT T1.document_date FROM Documents AS T1 JOIN Documents_with_Expenses AS T2 ON T1.document_id  =  T2.document_id WHERE T2.budget_type_code  =  'SF'
Final question: What are the dates for the documents with both 'GV' type and 'SF' type expenses?
Final SQL: SELECT T1.document_date FROM Documents AS T1 JOIN Documents_with_Expenses AS T2 ON T1.document_id  =  T2.document_id WHERE T2.budget_type_code  =  'GV' INTERSECT SELECT T1.document_date FROM Documents AS T1 JOIN Documents_with_Expenses AS T2 ON T1.document_id  =  T2.document_id WHERE T2.budget_type_code  =  'SF'
Database: manufactory_1
Question sequence:
show the name and revenue of all companies.
what is their average revenue?
please return maximum and total revenues too.
SQL query sequence:
SELECT name, revenue FROM manufacturers
SELECT avg(revenue) FROM manufacturers
SELECT avg(revenue) ,  max(revenue) ,  sum(revenue) FROM manufacturers
Final question: What are the average, maximum and total revenues of all companies?
Final SQL: SELECT avg(revenue) ,  max(revenue) ,  sum(revenue) FROM manufacturers
Database: manufactory_1
Question sequence:
find the names of manufactures that are based in Tokyo.
how about in Beijing?
what is the total number of companies based in these two places?
SQL query sequence:
SELECT name FROM manufacturers WHERE headquarter  =  'Tokyo'
SELECT name FROM manufacturers WHERE headquarter  =  'Beijing'
SELECT count(*) FROM manufacturers WHERE headquarter  =  'Tokyo' OR headquarter  =  'Beijing'
Final question: Find the number of manufactures that are based in Tokyo or Beijing.
Final SQL: SELECT count(*) FROM manufacturers WHERE headquarter  =  'Tokyo' OR headquarter  =  'Beijing'
Database: manufactory_1
Question sequence:
list the names of all manufacturers.
show the names of manufacturers that begin with the letter 'S'.
who are their founders?
SQL query sequence:
SELECT name FROM manufacturers
SELECT name FROM manufacturers WHERE name LIKE 'S%'
SELECT founder FROM manufacturers WHERE name LIKE 'S%'
Final question: Find the founder of the company whose name begins with the letter 'S'.
Final SQL: SELECT founder FROM manufacturers WHERE name LIKE 'S%'
Database: manufactory_1
Question sequence:
find the names of companies whose main office is in Tokyo.
What is the total revenue of these companies?
add the revenue of Taiwan companies too.
SQL query sequence:
SELECT name FROM manufacturers WHERE Headquarter  =  'Tokyo'
SELECT sum(revenue) FROM manufacturers WHERE Headquarter  =  'Tokyo'
SELECT sum(revenue) FROM manufacturers WHERE Headquarter  =  'Tokyo' OR Headquarter  =  'Taiwan'
Final question: What is the total revenue of all companies whose main office is at Tokyo or Taiwan?
Final SQL: SELECT sum(revenue) FROM manufacturers WHERE Headquarter  =  'Tokyo' OR Headquarter  =  'Taiwan'
Database: manufactory_1
Question sequence:
list the names of all of the products.
which products are produced by the company Creative Labs?
among them, find the products that Sony also produces.
SQL query sequence:
SELECT name FROM products
SELECT T1.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer  =  T2.code WHERE T2.name  =  'Creative Labs'
SELECT T1.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer  =  T2.code WHERE T2.name  =  'Creative Labs' INTERSECT SELECT T1.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer  =  T2.code WHERE T2.name  =  'Sony'
Final question: Find the name of product that is produced by both companies Creative Labs and Sony.
Final SQL: SELECT T1.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer  =  T2.code WHERE T2.name  =  'Creative Labs' INTERSECT SELECT T1.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer  =  T2.code WHERE T2.name  =  'Sony'
Database: manufactory_1
Question sequence:
find the name of the company that earned the least revenue.
show its headquarter location and founder too.
what is the info for the company with the highest revenue?
SQL query sequence:
SELECT name FROM manufacturers ORDER BY revenue LIMIT 1
SELECT name,  headquarter,  founder FROM manufacturers ORDER BY revenue LIMIT 1
SELECT name,  headquarter,  founder FROM manufacturers ORDER BY revenue DESC LIMIT 1
Final question: Find the name, headquarter and founder of the manufacturer that has the highest revenue.
Final SQL: SELECT name,  headquarter,  founder FROM manufacturers ORDER BY revenue DESC LIMIT 1