input
stringlengths
191
7.13k
output
stringlengths
19
578
Tables: Ref_Document_Types, Ref_Budget_Codes, Projects, Documents, Statements, Documents_with_Expenses, Accounts Columns: Ref_Document_Types.Document_Type_Code, Ref_Document_Types.Document_Type_Name, Ref_Document_Types.Document_Type_Description, Ref_Budget_Codes.Budget_Type_Code, Ref_Budget_Codes.Budget_Type_Descriptio...
SELECT count(*) FROM Documents;
Tables: Ref_Document_Types, Ref_Budget_Codes, Projects, Documents, Statements, Documents_with_Expenses, Accounts Columns: Ref_Document_Types.Document_Type_Code, Ref_Document_Types.Document_Type_Name, Ref_Document_Types.Document_Type_Description, Ref_Budget_Codes.Budget_Type_Code, Ref_Budget_Codes.Budget_Type_Descriptio...
SELECT document_type_code , document_name , document_description FROM Documents WHERE document_name = 'Noel CV' OR document_name = 'King Book';
Tables: Ref_Document_Types, Ref_Budget_Codes, Projects, Documents, Statements, Documents_with_Expenses, Accounts Columns: Ref_Document_Types.Document_Type_Code, Ref_Document_Types.Document_Type_Name, Ref_Document_Types.Document_Type_Description, Ref_Budget_Codes.Budget_Type_Code, Ref_Budget_Codes.Budget_Type_Descriptio...
SELECT document_type_code , document_name , document_description FROM Documents WHERE document_name = 'Noel CV' OR document_name = 'King Book';
Tables: Ref_Document_Types, Ref_Budget_Codes, Projects, Documents, Statements, Documents_with_Expenses, Accounts Columns: Ref_Document_Types.Document_Type_Code, Ref_Document_Types.Document_Type_Name, Ref_Document_Types.Document_Type_Description, Ref_Budget_Codes.Budget_Type_Code, Ref_Budget_Codes.Budget_Type_Descriptio...
SELECT document_id , document_name FROM Documents;
Tables: Ref_Document_Types, Ref_Budget_Codes, Projects, Documents, Statements, Documents_with_Expenses, Accounts Columns: Ref_Document_Types.Document_Type_Code, Ref_Document_Types.Document_Type_Name, Ref_Document_Types.Document_Type_Description, Ref_Budget_Codes.Budget_Type_Code, Ref_Budget_Codes.Budget_Type_Descriptio...
SELECT document_id , document_name FROM Documents;
Tables: Ref_Document_Types, Ref_Budget_Codes, Projects, Documents, Statements, Documents_with_Expenses, Accounts Columns: Ref_Document_Types.Document_Type_Code, Ref_Document_Types.Document_Type_Name, Ref_Document_Types.Document_Type_Description, Ref_Budget_Codes.Budget_Type_Code, Ref_Budget_Codes.Budget_Type_Descriptio...
SELECT document_name , document_id FROM Documents WHERE document_type_code = "BK";
Tables: Ref_Document_Types, Ref_Budget_Codes, Projects, Documents, Statements, Documents_with_Expenses, Accounts Columns: Ref_Document_Types.Document_Type_Code, Ref_Document_Types.Document_Type_Name, Ref_Document_Types.Document_Type_Description, Ref_Budget_Codes.Budget_Type_Code, Ref_Budget_Codes.Budget_Type_Descriptio...
SELECT document_name , document_id FROM Documents WHERE document_type_code = "BK";
Tables: Ref_Document_Types, Ref_Budget_Codes, Projects, Documents, Statements, Documents_with_Expenses, Accounts Columns: Ref_Document_Types.Document_Type_Code, Ref_Document_Types.Document_Type_Name, Ref_Document_Types.Document_Type_Description, Ref_Budget_Codes.Budget_Type_Code, Ref_Budget_Codes.Budget_Type_Descriptio...
SELECT count(*) , project_id FROM Documents WHERE document_type_code = "BK" GROUP BY project_id;
Tables: Ref_Document_Types, Ref_Budget_Codes, Projects, Documents, Statements, Documents_with_Expenses, Accounts Columns: Ref_Document_Types.Document_Type_Code, Ref_Document_Types.Document_Type_Name, Ref_Document_Types.Document_Type_Description, Ref_Budget_Codes.Budget_Type_Code, Ref_Budget_Codes.Budget_Type_Descriptio...
SELECT count(*) , project_id FROM Documents WHERE document_type_code = "BK" GROUP BY project_id;
Tables: Ref_Document_Types, Ref_Budget_Codes, Projects, Documents, Statements, Documents_with_Expenses, Accounts Columns: Ref_Document_Types.Document_Type_Code, Ref_Document_Types.Document_Type_Name, Ref_Document_Types.Document_Type_Description, Ref_Budget_Codes.Budget_Type_Code, Ref_Budget_Codes.Budget_Type_Descriptio...
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';
Tables: Ref_Document_Types, Ref_Budget_Codes, Projects, Documents, Statements, Documents_with_Expenses, Accounts Columns: Ref_Document_Types.Document_Type_Code, Ref_Document_Types.Document_Type_Name, Ref_Document_Types.Document_Type_Description, Ref_Budget_Codes.Budget_Type_Code, Ref_Budget_Codes.Budget_Type_Descriptio...
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';
Tables: Ref_Document_Types, Ref_Budget_Codes, Projects, Documents, Statements, Documents_with_Expenses, Accounts Columns: Ref_Document_Types.Document_Type_Code, Ref_Document_Types.Document_Type_Name, Ref_Document_Types.Document_Type_Description, Ref_Budget_Codes.Budget_Type_Code, Ref_Budget_Codes.Budget_Type_Descriptio...
SELECT project_id , count(*) FROM Documents GROUP BY project_id;
Tables: Ref_Document_Types, Ref_Budget_Codes, Projects, Documents, Statements, Documents_with_Expenses, Accounts Columns: Ref_Document_Types.Document_Type_Code, Ref_Document_Types.Document_Type_Name, Ref_Document_Types.Document_Type_Description, Ref_Budget_Codes.Budget_Type_Code, Ref_Budget_Codes.Budget_Type_Descriptio...
SELECT project_id , count(*) FROM Documents GROUP BY project_id;
Tables: Ref_Document_Types, Ref_Budget_Codes, Projects, Documents, Statements, Documents_with_Expenses, Accounts Columns: Ref_Document_Types.Document_Type_Code, Ref_Document_Types.Document_Type_Name, Ref_Document_Types.Document_Type_Description, Ref_Budget_Codes.Budget_Type_Code, Ref_Budget_Codes.Budget_Type_Descriptio...
SELECT project_id FROM Documents GROUP BY project_id ORDER BY count(*) ASC LIMIT 1;
Tables: Ref_Document_Types, Ref_Budget_Codes, Projects, Documents, Statements, Documents_with_Expenses, Accounts Columns: Ref_Document_Types.Document_Type_Code, Ref_Document_Types.Document_Type_Name, Ref_Document_Types.Document_Type_Description, Ref_Budget_Codes.Budget_Type_Code, Ref_Budget_Codes.Budget_Type_Descriptio...
SELECT project_id FROM Documents GROUP BY project_id ORDER BY count(*) ASC LIMIT 1;
Tables: Ref_Document_Types, Ref_Budget_Codes, Projects, Documents, Statements, Documents_with_Expenses, Accounts Columns: Ref_Document_Types.Document_Type_Code, Ref_Document_Types.Document_Type_Name, Ref_Document_Types.Document_Type_Description, Ref_Budget_Codes.Budget_Type_Code, Ref_Budget_Codes.Budget_Type_Descriptio...
SELECT project_id FROM Documents GROUP BY project_id HAVING count(*) >= 2;
Tables: Ref_Document_Types, Ref_Budget_Codes, Projects, Documents, Statements, Documents_with_Expenses, Accounts Columns: Ref_Document_Types.Document_Type_Code, Ref_Document_Types.Document_Type_Name, Ref_Document_Types.Document_Type_Description, Ref_Budget_Codes.Budget_Type_Code, Ref_Budget_Codes.Budget_Type_Descriptio...
SELECT project_id FROM Documents GROUP BY project_id HAVING count(*) >= 2;
Tables: Ref_Document_Types, Ref_Budget_Codes, Projects, Documents, Statements, Documents_with_Expenses, Accounts Columns: Ref_Document_Types.Document_Type_Code, Ref_Document_Types.Document_Type_Name, Ref_Document_Types.Document_Type_Description, Ref_Budget_Codes.Budget_Type_Code, Ref_Budget_Codes.Budget_Type_Descriptio...
SELECT document_type_code , count(*) FROM Documents GROUP BY document_type_code;
Tables: Ref_Document_Types, Ref_Budget_Codes, Projects, Documents, Statements, Documents_with_Expenses, Accounts Columns: Ref_Document_Types.Document_Type_Code, Ref_Document_Types.Document_Type_Name, Ref_Document_Types.Document_Type_Description, Ref_Budget_Codes.Budget_Type_Code, Ref_Budget_Codes.Budget_Type_Descriptio...
SELECT document_type_code , count(*) FROM Documents GROUP BY document_type_code;
Tables: Ref_Document_Types, Ref_Budget_Codes, Projects, Documents, Statements, Documents_with_Expenses, Accounts Columns: Ref_Document_Types.Document_Type_Code, Ref_Document_Types.Document_Type_Name, Ref_Document_Types.Document_Type_Description, Ref_Budget_Codes.Budget_Type_Code, Ref_Budget_Codes.Budget_Type_Descriptio...
SELECT document_type_code FROM Documents GROUP BY document_type_code ORDER BY count(*) DESC LIMIT 1;
Tables: Ref_Document_Types, Ref_Budget_Codes, Projects, Documents, Statements, Documents_with_Expenses, Accounts Columns: Ref_Document_Types.Document_Type_Code, Ref_Document_Types.Document_Type_Name, Ref_Document_Types.Document_Type_Description, Ref_Budget_Codes.Budget_Type_Code, Ref_Budget_Codes.Budget_Type_Descriptio...
SELECT document_type_code FROM Documents GROUP BY document_type_code ORDER BY count(*) DESC LIMIT 1;
Tables: Ref_Document_Types, Ref_Budget_Codes, Projects, Documents, Statements, Documents_with_Expenses, Accounts Columns: Ref_Document_Types.Document_Type_Code, Ref_Document_Types.Document_Type_Name, Ref_Document_Types.Document_Type_Description, Ref_Budget_Codes.Budget_Type_Code, Ref_Budget_Codes.Budget_Type_Descriptio...
SELECT document_type_code FROM Documents GROUP BY document_type_code HAVING count(*) < 3;
Tables: Ref_Document_Types, Ref_Budget_Codes, Projects, Documents, Statements, Documents_with_Expenses, Accounts Columns: Ref_Document_Types.Document_Type_Code, Ref_Document_Types.Document_Type_Name, Ref_Document_Types.Document_Type_Description, Ref_Budget_Codes.Budget_Type_Code, Ref_Budget_Codes.Budget_Type_Descriptio...
SELECT document_type_code FROM Documents GROUP BY document_type_code HAVING count(*) < 3;
Tables: Ref_Document_Types, Ref_Budget_Codes, Projects, Documents, Statements, Documents_with_Expenses, Accounts Columns: Ref_Document_Types.Document_Type_Code, Ref_Document_Types.Document_Type_Name, Ref_Document_Types.Document_Type_Description, Ref_Budget_Codes.Budget_Type_Code, Ref_Budget_Codes.Budget_Type_Descriptio...
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';
Tables: Ref_Document_Types, Ref_Budget_Codes, Projects, Documents, Statements, Documents_with_Expenses, Accounts Columns: Ref_Document_Types.Document_Type_Code, Ref_Document_Types.Document_Type_Name, Ref_Document_Types.Document_Type_Description, Ref_Budget_Codes.Budget_Type_Code, Ref_Budget_Codes.Budget_Type_Descriptio...
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';
Tables: Ref_Document_Types, Ref_Budget_Codes, Projects, Documents, Statements, Documents_with_Expenses, Accounts Columns: Ref_Document_Types.Document_Type_Code, Ref_Document_Types.Document_Type_Name, Ref_Document_Types.Document_Type_Description, Ref_Budget_Codes.Budget_Type_Code, Ref_Budget_Codes.Budget_Type_Descriptio...
SELECT document_type_code , document_type_name , document_type_description FROM Ref_document_types;
Tables: Ref_Document_Types, Ref_Budget_Codes, Projects, Documents, Statements, Documents_with_Expenses, Accounts Columns: Ref_Document_Types.Document_Type_Code, Ref_Document_Types.Document_Type_Name, Ref_Document_Types.Document_Type_Description, Ref_Budget_Codes.Budget_Type_Code, Ref_Budget_Codes.Budget_Type_Descriptio...
SELECT document_type_code , document_type_name , document_type_description FROM Ref_document_types;
Tables: Ref_Document_Types, Ref_Budget_Codes, Projects, Documents, Statements, Documents_with_Expenses, Accounts Columns: Ref_Document_Types.Document_Type_Code, Ref_Document_Types.Document_Type_Name, Ref_Document_Types.Document_Type_Description, Ref_Budget_Codes.Budget_Type_Code, Ref_Budget_Codes.Budget_Type_Descriptio...
SELECT document_type_description FROM Ref_document_types WHERE document_type_name = "Film";
Tables: Ref_Document_Types, Ref_Budget_Codes, Projects, Documents, Statements, Documents_with_Expenses, Accounts Columns: Ref_Document_Types.Document_Type_Code, Ref_Document_Types.Document_Type_Name, Ref_Document_Types.Document_Type_Description, Ref_Budget_Codes.Budget_Type_Code, Ref_Budget_Codes.Budget_Type_Descriptio...
SELECT document_type_description FROM Ref_document_types WHERE document_type_name = "Film";
Tables: Ref_Document_Types, Ref_Budget_Codes, Projects, Documents, Statements, Documents_with_Expenses, Accounts Columns: Ref_Document_Types.Document_Type_Code, Ref_Document_Types.Document_Type_Name, Ref_Document_Types.Document_Type_Description, Ref_Budget_Codes.Budget_Type_Code, Ref_Budget_Codes.Budget_Type_Descriptio...
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;
Tables: Ref_Document_Types, Ref_Budget_Codes, Projects, Documents, Statements, Documents_with_Expenses, Accounts Columns: Ref_Document_Types.Document_Type_Code, Ref_Document_Types.Document_Type_Name, Ref_Document_Types.Document_Type_Description, Ref_Budget_Codes.Budget_Type_Code, Ref_Budget_Codes.Budget_Type_Descriptio...
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;
Tables: Ref_Document_Types, Ref_Budget_Codes, Projects, Documents, Statements, Documents_with_Expenses, Accounts Columns: Ref_Document_Types.Document_Type_Code, Ref_Document_Types.Document_Type_Name, Ref_Document_Types.Document_Type_Description, Ref_Budget_Codes.Budget_Type_Code, Ref_Budget_Codes.Budget_Type_Descriptio...
SELECT count(*) FROM Projects;
Tables: Ref_Document_Types, Ref_Budget_Codes, Projects, Documents, Statements, Documents_with_Expenses, Accounts Columns: Ref_Document_Types.Document_Type_Code, Ref_Document_Types.Document_Type_Name, Ref_Document_Types.Document_Type_Description, Ref_Budget_Codes.Budget_Type_Code, Ref_Budget_Codes.Budget_Type_Descriptio...
SELECT count(*) FROM Projects;
Tables: Ref_Document_Types, Ref_Budget_Codes, Projects, Documents, Statements, Documents_with_Expenses, Accounts Columns: Ref_Document_Types.Document_Type_Code, Ref_Document_Types.Document_Type_Name, Ref_Document_Types.Document_Type_Description, Ref_Budget_Codes.Budget_Type_Code, Ref_Budget_Codes.Budget_Type_Descriptio...
SELECT project_id , project_details FROM Projects;
Tables: Ref_Document_Types, Ref_Budget_Codes, Projects, Documents, Statements, Documents_with_Expenses, Accounts Columns: Ref_Document_Types.Document_Type_Code, Ref_Document_Types.Document_Type_Name, Ref_Document_Types.Document_Type_Description, Ref_Budget_Codes.Budget_Type_Code, Ref_Budget_Codes.Budget_Type_Descriptio...
SELECT project_id , project_details FROM Projects;
Tables: Ref_Document_Types, Ref_Budget_Codes, Projects, Documents, Statements, Documents_with_Expenses, Accounts Columns: Ref_Document_Types.Document_Type_Code, Ref_Document_Types.Document_Type_Name, Ref_Document_Types.Document_Type_Description, Ref_Budget_Codes.Budget_Type_Code, Ref_Budget_Codes.Budget_Type_Descriptio...
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;
Tables: Ref_Document_Types, Ref_Budget_Codes, Projects, Documents, Statements, Documents_with_Expenses, Accounts Columns: Ref_Document_Types.Document_Type_Code, Ref_Document_Types.Document_Type_Name, Ref_Document_Types.Document_Type_Description, Ref_Budget_Codes.Budget_Type_Code, Ref_Budget_Codes.Budget_Type_Descriptio...
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;
Tables: Ref_Document_Types, Ref_Budget_Codes, Projects, Documents, Statements, Documents_with_Expenses, Accounts Columns: Ref_Document_Types.Document_Type_Code, Ref_Document_Types.Document_Type_Name, Ref_Document_Types.Document_Type_Description, Ref_Budget_Codes.Budget_Type_Code, Ref_Budget_Codes.Budget_Type_Descriptio...
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";
Tables: Ref_Document_Types, Ref_Budget_Codes, Projects, Documents, Statements, Documents_with_Expenses, Accounts Columns: Ref_Document_Types.Document_Type_Code, Ref_Document_Types.Document_Type_Name, Ref_Document_Types.Document_Type_Description, Ref_Budget_Codes.Budget_Type_Code, Ref_Budget_Codes.Budget_Type_Descriptio...
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";
Tables: Ref_Document_Types, Ref_Budget_Codes, Projects, Documents, Statements, Documents_with_Expenses, Accounts Columns: Ref_Document_Types.Document_Type_Code, Ref_Document_Types.Document_Type_Name, Ref_Document_Types.Document_Type_Description, Ref_Budget_Codes.Budget_Type_Code, Ref_Budget_Codes.Budget_Type_Descriptio...
SELECT count(*) FROM Ref_budget_codes;
Tables: Ref_Document_Types, Ref_Budget_Codes, Projects, Documents, Statements, Documents_with_Expenses, Accounts Columns: Ref_Document_Types.Document_Type_Code, Ref_Document_Types.Document_Type_Name, Ref_Document_Types.Document_Type_Description, Ref_Budget_Codes.Budget_Type_Code, Ref_Budget_Codes.Budget_Type_Descriptio...
SELECT count(*) FROM Ref_budget_codes;
Tables: Ref_Document_Types, Ref_Budget_Codes, Projects, Documents, Statements, Documents_with_Expenses, Accounts Columns: Ref_Document_Types.Document_Type_Code, Ref_Document_Types.Document_Type_Name, Ref_Document_Types.Document_Type_Description, Ref_Budget_Codes.Budget_Type_Code, Ref_Budget_Codes.Budget_Type_Descriptio...
SELECT budget_type_code , budget_type_description FROM Ref_budget_codes;
Tables: Ref_Document_Types, Ref_Budget_Codes, Projects, Documents, Statements, Documents_with_Expenses, Accounts Columns: Ref_Document_Types.Document_Type_Code, Ref_Document_Types.Document_Type_Name, Ref_Document_Types.Document_Type_Description, Ref_Budget_Codes.Budget_Type_Code, Ref_Budget_Codes.Budget_Type_Descriptio...
SELECT budget_type_code , budget_type_description FROM Ref_budget_codes;
Tables: Ref_Document_Types, Ref_Budget_Codes, Projects, Documents, Statements, Documents_with_Expenses, Accounts Columns: Ref_Document_Types.Document_Type_Code, Ref_Document_Types.Document_Type_Name, Ref_Document_Types.Document_Type_Description, Ref_Budget_Codes.Budget_Type_Code, Ref_Budget_Codes.Budget_Type_Descriptio...
SELECT budget_type_description FROM Ref_budget_codes WHERE budget_type_code = "ORG";
Tables: Ref_Document_Types, Ref_Budget_Codes, Projects, Documents, Statements, Documents_with_Expenses, Accounts Columns: Ref_Document_Types.Document_Type_Code, Ref_Document_Types.Document_Type_Name, Ref_Document_Types.Document_Type_Description, Ref_Budget_Codes.Budget_Type_Code, Ref_Budget_Codes.Budget_Type_Descriptio...
SELECT budget_type_description FROM Ref_budget_codes WHERE budget_type_code = "ORG";
Tables: Ref_Document_Types, Ref_Budget_Codes, Projects, Documents, Statements, Documents_with_Expenses, Accounts Columns: Ref_Document_Types.Document_Type_Code, Ref_Document_Types.Document_Type_Name, Ref_Document_Types.Document_Type_Description, Ref_Budget_Codes.Budget_Type_Code, Ref_Budget_Codes.Budget_Type_Descriptio...
SELECT count(*) FROM Documents_with_expenses;
Tables: Ref_Document_Types, Ref_Budget_Codes, Projects, Documents, Statements, Documents_with_Expenses, Accounts Columns: Ref_Document_Types.Document_Type_Code, Ref_Document_Types.Document_Type_Name, Ref_Document_Types.Document_Type_Description, Ref_Budget_Codes.Budget_Type_Code, Ref_Budget_Codes.Budget_Type_Descriptio...
SELECT count(*) FROM Documents_with_expenses;
Tables: Ref_Document_Types, Ref_Budget_Codes, Projects, Documents, Statements, Documents_with_Expenses, Accounts Columns: Ref_Document_Types.Document_Type_Code, Ref_Document_Types.Document_Type_Name, Ref_Document_Types.Document_Type_Description, Ref_Budget_Codes.Budget_Type_Code, Ref_Budget_Codes.Budget_Type_Descriptio...
SELECT document_id FROM Documents_with_expenses WHERE budget_type_code = 'SF';
Tables: Ref_Document_Types, Ref_Budget_Codes, Projects, Documents, Statements, Documents_with_Expenses, Accounts Columns: Ref_Document_Types.Document_Type_Code, Ref_Document_Types.Document_Type_Name, Ref_Document_Types.Document_Type_Description, Ref_Budget_Codes.Budget_Type_Code, Ref_Budget_Codes.Budget_Type_Descriptio...
SELECT document_id FROM Documents_with_expenses WHERE budget_type_code = 'SF';
Tables: Ref_Document_Types, Ref_Budget_Codes, Projects, Documents, Statements, Documents_with_Expenses, Accounts Columns: Ref_Document_Types.Document_Type_Code, Ref_Document_Types.Document_Type_Name, Ref_Document_Types.Document_Type_Description, Ref_Budget_Codes.Budget_Type_Code, Ref_Budget_Codes.Budget_Type_Descriptio...
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;
Tables: Ref_Document_Types, Ref_Budget_Codes, Projects, Documents, Statements, Documents_with_Expenses, Accounts Columns: Ref_Document_Types.Document_Type_Code, Ref_Document_Types.Document_Type_Name, Ref_Document_Types.Document_Type_Description, Ref_Budget_Codes.Budget_Type_Code, Ref_Budget_Codes.Budget_Type_Descriptio...
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;
Tables: Ref_Document_Types, Ref_Budget_Codes, Projects, Documents, Statements, Documents_with_Expenses, Accounts Columns: Ref_Document_Types.Document_Type_Code, Ref_Document_Types.Document_Type_Name, Ref_Document_Types.Document_Type_Description, Ref_Budget_Codes.Budget_Type_Code, Ref_Budget_Codes.Budget_Type_Descriptio...
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";
Tables: Ref_Document_Types, Ref_Budget_Codes, Projects, Documents, Statements, Documents_with_Expenses, Accounts Columns: Ref_Document_Types.Document_Type_Code, Ref_Document_Types.Document_Type_Name, Ref_Document_Types.Document_Type_Description, Ref_Budget_Codes.Budget_Type_Code, Ref_Budget_Codes.Budget_Type_Descriptio...
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";
Tables: Ref_Document_Types, Ref_Budget_Codes, Projects, Documents, Statements, Documents_with_Expenses, Accounts Columns: Ref_Document_Types.Document_Type_Code, Ref_Document_Types.Document_Type_Name, Ref_Document_Types.Document_Type_Description, Ref_Budget_Codes.Budget_Type_Code, Ref_Budget_Codes.Budget_Type_Descriptio...
SELECT budget_type_code , count(*) FROM Documents_with_expenses GROUP BY budget_type_code;
Tables: Ref_Document_Types, Ref_Budget_Codes, Projects, Documents, Statements, Documents_with_Expenses, Accounts Columns: Ref_Document_Types.Document_Type_Code, Ref_Document_Types.Document_Type_Name, Ref_Document_Types.Document_Type_Description, Ref_Budget_Codes.Budget_Type_Code, Ref_Budget_Codes.Budget_Type_Descriptio...
SELECT budget_type_code , count(*) FROM Documents_with_expenses GROUP BY budget_type_code;
Tables: Ref_Document_Types, Ref_Budget_Codes, Projects, Documents, Statements, Documents_with_Expenses, Accounts Columns: Ref_Document_Types.Document_Type_Code, Ref_Document_Types.Document_Type_Name, Ref_Document_Types.Document_Type_Description, Ref_Budget_Codes.Budget_Type_Code, Ref_Budget_Codes.Budget_Type_Descriptio...
SELECT budget_type_code FROM Documents_with_expenses GROUP BY budget_type_code ORDER BY count(*) DESC LIMIT 1;
Tables: Ref_Document_Types, Ref_Budget_Codes, Projects, Documents, Statements, Documents_with_Expenses, Accounts Columns: Ref_Document_Types.Document_Type_Code, Ref_Document_Types.Document_Type_Name, Ref_Document_Types.Document_Type_Description, Ref_Budget_Codes.Budget_Type_Code, Ref_Budget_Codes.Budget_Type_Descriptio...
SELECT budget_type_code FROM Documents_with_expenses GROUP BY budget_type_code ORDER BY count(*) DESC LIMIT 1;
Tables: Ref_Document_Types, Ref_Budget_Codes, Projects, Documents, Statements, Documents_with_Expenses, Accounts Columns: Ref_Document_Types.Document_Type_Code, Ref_Document_Types.Document_Type_Name, Ref_Document_Types.Document_Type_Description, Ref_Budget_Codes.Budget_Type_Code, Ref_Budget_Codes.Budget_Type_Descriptio...
SELECT document_id FROM Documents EXCEPT SELECT document_id FROM Documents_with_expenses;
Tables: Ref_Document_Types, Ref_Budget_Codes, Projects, Documents, Statements, Documents_with_Expenses, Accounts Columns: Ref_Document_Types.Document_Type_Code, Ref_Document_Types.Document_Type_Name, Ref_Document_Types.Document_Type_Description, Ref_Budget_Codes.Budget_Type_Code, Ref_Budget_Codes.Budget_Type_Descriptio...
SELECT document_id FROM Documents EXCEPT SELECT document_id FROM Documents_with_expenses;
Tables: Ref_Document_Types, Ref_Budget_Codes, Projects, Documents, Statements, Documents_with_Expenses, Accounts Columns: Ref_Document_Types.Document_Type_Code, Ref_Document_Types.Document_Type_Name, Ref_Document_Types.Document_Type_Description, Ref_Budget_Codes.Budget_Type_Code, Ref_Budget_Codes.Budget_Type_Descriptio...
SELECT document_id FROM Documents WHERE document_type_code = "CV" EXCEPT SELECT document_id FROM Documents_with_expenses;
Tables: Ref_Document_Types, Ref_Budget_Codes, Projects, Documents, Statements, Documents_with_Expenses, Accounts Columns: Ref_Document_Types.Document_Type_Code, Ref_Document_Types.Document_Type_Name, Ref_Document_Types.Document_Type_Description, Ref_Budget_Codes.Budget_Type_Code, Ref_Budget_Codes.Budget_Type_Descriptio...
SELECT document_id FROM Documents WHERE document_type_code = "CV" EXCEPT SELECT document_id FROM Documents_with_expenses;
Tables: Ref_Document_Types, Ref_Budget_Codes, Projects, Documents, Statements, Documents_with_Expenses, Accounts Columns: Ref_Document_Types.Document_Type_Code, Ref_Document_Types.Document_Type_Name, Ref_Document_Types.Document_Type_Description, Ref_Budget_Codes.Budget_Type_Code, Ref_Budget_Codes.Budget_Type_Descriptio...
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%';
Tables: Ref_Document_Types, Ref_Budget_Codes, Projects, Documents, Statements, Documents_with_Expenses, Accounts Columns: Ref_Document_Types.Document_Type_Code, Ref_Document_Types.Document_Type_Name, Ref_Document_Types.Document_Type_Description, Ref_Budget_Codes.Budget_Type_Code, Ref_Budget_Codes.Budget_Type_Descriptio...
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%';
Tables: Ref_Document_Types, Ref_Budget_Codes, Projects, Documents, Statements, Documents_with_Expenses, Accounts Columns: Ref_Document_Types.Document_Type_Code, Ref_Document_Types.Document_Type_Name, Ref_Document_Types.Document_Type_Description, Ref_Budget_Codes.Budget_Type_Code, Ref_Budget_Codes.Budget_Type_Descriptio...
SELECT count(*) FROM Documents WHERE document_id NOT IN ( SELECT document_id FROM Documents_with_expenses );
Tables: Ref_Document_Types, Ref_Budget_Codes, Projects, Documents, Statements, Documents_with_Expenses, Accounts Columns: Ref_Document_Types.Document_Type_Code, Ref_Document_Types.Document_Type_Name, Ref_Document_Types.Document_Type_Description, Ref_Budget_Codes.Budget_Type_Code, Ref_Budget_Codes.Budget_Type_Descriptio...
SELECT count(*) FROM Documents WHERE document_id NOT IN ( SELECT document_id FROM Documents_with_expenses );
Tables: Ref_Document_Types, Ref_Budget_Codes, Projects, Documents, Statements, Documents_with_Expenses, Accounts Columns: Ref_Document_Types.Document_Type_Code, Ref_Document_Types.Document_Type_Name, Ref_Document_Types.Document_Type_Description, Ref_Budget_Codes.Budget_Type_Code, Ref_Budget_Codes.Budget_Type_Descriptio...
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';
Tables: Ref_Document_Types, Ref_Budget_Codes, Projects, Documents, Statements, Documents_with_Expenses, Accounts Columns: Ref_Document_Types.Document_Type_Code, Ref_Document_Types.Document_Type_Name, Ref_Document_Types.Document_Type_Description, Ref_Budget_Codes.Budget_Type_Code, Ref_Budget_Codes.Budget_Type_Descriptio...
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';
Tables: Ref_Document_Types, Ref_Budget_Codes, Projects, Documents, Statements, Documents_with_Expenses, Accounts Columns: Ref_Document_Types.Document_Type_Code, Ref_Document_Types.Document_Type_Name, Ref_Document_Types.Document_Type_Description, Ref_Budget_Codes.Budget_Type_Code, Ref_Budget_Codes.Budget_Type_Descriptio...
SELECT max(Account_details) FROM Accounts UNION SELECT Account_details FROM Accounts WHERE Account_details LIKE "%5%";
Tables: Ref_Document_Types, Ref_Budget_Codes, Projects, Documents, Statements, Documents_with_Expenses, Accounts Columns: Ref_Document_Types.Document_Type_Code, Ref_Document_Types.Document_Type_Name, Ref_Document_Types.Document_Type_Description, Ref_Budget_Codes.Budget_Type_Code, Ref_Budget_Codes.Budget_Type_Descriptio...
SELECT max(Account_details) FROM Accounts UNION SELECT Account_details FROM Accounts WHERE Account_details LIKE "%5%";
Tables: Scientists, Projects, AssignedTo Columns: Scientists.SSN, Scientists.Name, Projects.Code, Projects.Name, Projects.Hours, AssignedTo.Scientist, AssignedTo.Project Question: Find the total number of scientists. [/INST]
SELECT count(*) FROM scientists;
Tables: Scientists, Projects, AssignedTo Columns: Scientists.SSN, Scientists.Name, Projects.Code, Projects.Name, Projects.Hours, AssignedTo.Scientist, AssignedTo.Project Question: How many scientists are there? [/INST]
SELECT count(*) FROM scientists;
Tables: Scientists, Projects, AssignedTo Columns: Scientists.SSN, Scientists.Name, Projects.Code, Projects.Name, Projects.Hours, AssignedTo.Scientist, AssignedTo.Project Question: Find the total hours of all projects. [/INST]
SELECT sum(hours) FROM projects;
Tables: Scientists, Projects, AssignedTo Columns: Scientists.SSN, Scientists.Name, Projects.Code, Projects.Name, Projects.Hours, AssignedTo.Scientist, AssignedTo.Project Question: What is the total number of hours for all projects? [/INST]
SELECT sum(hours) FROM projects;
Tables: Scientists, Projects, AssignedTo Columns: Scientists.SSN, Scientists.Name, Projects.Code, Projects.Name, Projects.Hours, AssignedTo.Scientist, AssignedTo.Project Question: How many different scientists are assigned to any project? [/INST]
SELECT count(DISTINCT scientist) FROM assignedto;
Tables: Scientists, Projects, AssignedTo Columns: Scientists.SSN, Scientists.Name, Projects.Code, Projects.Name, Projects.Hours, AssignedTo.Scientist, AssignedTo.Project Question: Count the number of different scientists assigned to any project. [/INST]
SELECT count(DISTINCT scientist) FROM assignedto;
Tables: Scientists, Projects, AssignedTo Columns: Scientists.SSN, Scientists.Name, Projects.Code, Projects.Name, Projects.Hours, AssignedTo.Scientist, AssignedTo.Project Question: Find the number of distinct projects. [/INST]
SELECT count(DISTINCT name) FROM projects;
Tables: Scientists, Projects, AssignedTo Columns: Scientists.SSN, Scientists.Name, Projects.Code, Projects.Name, Projects.Hours, AssignedTo.Scientist, AssignedTo.Project Question: How many different projects are there? [/INST]
SELECT count(DISTINCT name) FROM projects;
Tables: Scientists, Projects, AssignedTo Columns: Scientists.SSN, Scientists.Name, Projects.Code, Projects.Name, Projects.Hours, AssignedTo.Scientist, AssignedTo.Project Question: Find the average hours of all projects. [/INST]
SELECT avg(hours) FROM projects;
Tables: Scientists, Projects, AssignedTo Columns: Scientists.SSN, Scientists.Name, Projects.Code, Projects.Name, Projects.Hours, AssignedTo.Scientist, AssignedTo.Project Question: What is the average hours across all projects? [/INST]
SELECT avg(hours) FROM projects;
Tables: Scientists, Projects, AssignedTo Columns: Scientists.SSN, Scientists.Name, Projects.Code, Projects.Name, Projects.Hours, AssignedTo.Scientist, AssignedTo.Project Question: Find the name of project that continues for the longest time. [/INST]
SELECT name FROM projects ORDER BY hours DESC LIMIT 1;
Tables: Scientists, Projects, AssignedTo Columns: Scientists.SSN, Scientists.Name, Projects.Code, Projects.Name, Projects.Hours, AssignedTo.Scientist, AssignedTo.Project Question: What is the name of the project with the most hours? [/INST]
SELECT name FROM projects ORDER BY hours DESC LIMIT 1;
Tables: Scientists, Projects, AssignedTo Columns: Scientists.SSN, Scientists.Name, Projects.Code, Projects.Name, Projects.Hours, AssignedTo.Scientist, AssignedTo.Project Question: List the name of all projects that are operated longer than the average working hours of all projects. [/INST]
SELECT name FROM projects WHERE hours > (SELECT avg(hours) FROM projects);
Tables: Scientists, Projects, AssignedTo Columns: Scientists.SSN, Scientists.Name, Projects.Code, Projects.Name, Projects.Hours, AssignedTo.Scientist, AssignedTo.Project Question: What are the names of projects that have taken longer than the average number of hours for all projects? [/INST]
SELECT name FROM projects WHERE hours > (SELECT avg(hours) FROM projects);
Tables: Scientists, Projects, AssignedTo Columns: Scientists.SSN, Scientists.Name, Projects.Code, Projects.Name, Projects.Hours, AssignedTo.Scientist, AssignedTo.Project Question: Find the name and hours of project that has the most number of scientists. [/INST]
SELECT T1.name , T1.hours FROM projects AS T1 JOIN assignedto AS T2 ON T1.code = T2.project GROUP BY T2.project ORDER BY count(*) DESC LIMIT 1;
Tables: Scientists, Projects, AssignedTo Columns: Scientists.SSN, Scientists.Name, Projects.Code, Projects.Name, Projects.Hours, AssignedTo.Scientist, AssignedTo.Project Question: What is the name and hours for the project which has the most scientists assigned to it? [/INST]
SELECT T1.name , T1.hours FROM projects AS T1 JOIN assignedto AS T2 ON T1.code = T2.project GROUP BY T2.project ORDER BY count(*) DESC LIMIT 1;
Tables: Scientists, Projects, AssignedTo Columns: Scientists.SSN, Scientists.Name, Projects.Code, Projects.Name, Projects.Hours, AssignedTo.Scientist, AssignedTo.Project Question: Find the name of the project for which a scientist whose name contains ‘Smith’ is assigned to. [/INST]
SELECT T2.name FROM assignedto AS T1 JOIN projects AS T2 ON T1.project = T2.code JOIN scientists AS T3 ON T1.scientist = T3.SSN WHERE T3.name LIKE '%Smith%';
Tables: Scientists, Projects, AssignedTo Columns: Scientists.SSN, Scientists.Name, Projects.Code, Projects.Name, Projects.Hours, AssignedTo.Scientist, AssignedTo.Project Question: What is the name of the project that has a scientist assigned to it whose name contains 'Smith'? [/INST]
SELECT T2.name FROM assignedto AS T1 JOIN projects AS T2 ON T1.project = T2.code JOIN scientists AS T3 ON T1.scientist = T3.SSN WHERE T3.name LIKE '%Smith%';
Tables: Scientists, Projects, AssignedTo Columns: Scientists.SSN, Scientists.Name, Projects.Code, Projects.Name, Projects.Hours, AssignedTo.Scientist, AssignedTo.Project Question: Find the total hours of the projects that scientists named Michael Rogers or Carol Smith are assigned to. [/INST]
SELECT sum(T2.hours) FROM assignedto AS T1 JOIN projects AS T2 ON T1.project = T2.code JOIN scientists AS T3 ON T1.scientist = T3.SSN WHERE T3.name = 'Michael Rogers' OR T3.name = 'Carol Smith';
Tables: Scientists, Projects, AssignedTo Columns: Scientists.SSN, Scientists.Name, Projects.Code, Projects.Name, Projects.Hours, AssignedTo.Scientist, AssignedTo.Project Question: What is the sum of hours for projects that scientists with the name Michael Rogers or Carol Smith are assigned to? [/INST]
SELECT sum(T2.hours) FROM assignedto AS T1 JOIN projects AS T2 ON T1.project = T2.code JOIN scientists AS T3 ON T1.scientist = T3.SSN WHERE T3.name = 'Michael Rogers' OR T3.name = 'Carol Smith';
Tables: Scientists, Projects, AssignedTo Columns: Scientists.SSN, Scientists.Name, Projects.Code, Projects.Name, Projects.Hours, AssignedTo.Scientist, AssignedTo.Project Question: Find the name of projects that require between 100 and 300 hours of work. [/INST]
SELECT name FROM projects WHERE hours BETWEEN 100 AND 300;
Tables: Scientists, Projects, AssignedTo Columns: Scientists.SSN, Scientists.Name, Projects.Code, Projects.Name, Projects.Hours, AssignedTo.Scientist, AssignedTo.Project Question: What are the names of projects that require between 100 and 300 hours? [/INST]
SELECT name FROM projects WHERE hours BETWEEN 100 AND 300;
Tables: Scientists, Projects, AssignedTo Columns: Scientists.SSN, Scientists.Name, Projects.Code, Projects.Name, Projects.Hours, AssignedTo.Scientist, AssignedTo.Project Question: Find the name of the scientist who worked on both a project named 'Matter of Time' and a project named 'A Puzzling Parallax'. [/INST]
SELECT T3.name FROM assignedto AS T1 JOIN projects AS T2 ON T1.project = T2.code JOIN scientists AS T3 ON T1.scientist = T3.SSN WHERE T2.name = 'Matter of Time' INTERSECT SELECT T3.name FROM assignedto AS T1 JOIN projects AS T2 ON T1.project = T2.code JOIN scientists AS T3 ON T1.scientist = T3.SSN WHERE T2.na...
Tables: Scientists, Projects, AssignedTo Columns: Scientists.SSN, Scientists.Name, Projects.Code, Projects.Name, Projects.Hours, AssignedTo.Scientist, AssignedTo.Project Question: What are the names of any scientists who worked on projects named 'Matter of Time' and 'A Puzzling Pattern'? [/INST]
SELECT T3.name FROM assignedto AS T1 JOIN projects AS T2 ON T1.project = T2.code JOIN scientists AS T3 ON T1.scientist = T3.SSN WHERE T2.name = 'Matter of Time' INTERSECT SELECT T3.name FROM assignedto AS T1 JOIN projects AS T2 ON T1.project = T2.code JOIN scientists AS T3 ON T1.scientist = T3.SSN WHERE T2.na...
Tables: Scientists, Projects, AssignedTo Columns: Scientists.SSN, Scientists.Name, Projects.Code, Projects.Name, Projects.Hours, AssignedTo.Scientist, AssignedTo.Project Question: List the names of all scientists sorted in alphabetical order. [/INST]
SELECT name FROM scientists ORDER BY name;
Tables: Scientists, Projects, AssignedTo Columns: Scientists.SSN, Scientists.Name, Projects.Code, Projects.Name, Projects.Hours, AssignedTo.Scientist, AssignedTo.Project Question: What are the names of all the scientists in alphabetical order? [/INST]
SELECT name FROM scientists ORDER BY name;
Tables: Scientists, Projects, AssignedTo Columns: Scientists.SSN, Scientists.Name, Projects.Code, Projects.Name, Projects.Hours, AssignedTo.Scientist, AssignedTo.Project Question: Find the number of scientists involved for each project name. [/INST]
SELECT count(*) , T1.name FROM projects AS T1 JOIN assignedto AS T2 ON T1.code = T2.project GROUP BY T1.name;
Tables: Scientists, Projects, AssignedTo Columns: Scientists.SSN, Scientists.Name, Projects.Code, Projects.Name, Projects.Hours, AssignedTo.Scientist, AssignedTo.Project Question: What are the naems of all the projects, and how many scientists were assigned to each of them? [/INST]
SELECT count(*) , T1.name FROM projects AS T1 JOIN assignedto AS T2 ON T1.code = T2.project GROUP BY T1.name;
Tables: Scientists, Projects, AssignedTo Columns: Scientists.SSN, Scientists.Name, Projects.Code, Projects.Name, Projects.Hours, AssignedTo.Scientist, AssignedTo.Project Question: Find the number of scientists involved for the projects that require more than 300 hours. [/INST]
SELECT count(*) , T1.name FROM projects AS T1 JOIN assignedto AS T2 ON T1.code = T2.project WHERE T1.hours > 300 GROUP BY T1.name;
Tables: Scientists, Projects, AssignedTo Columns: Scientists.SSN, Scientists.Name, Projects.Code, Projects.Name, Projects.Hours, AssignedTo.Scientist, AssignedTo.Project Question: What are the names of projects that require more than 300 hours, and how many scientists are assigned to each? [/INST]
SELECT count(*) , T1.name FROM projects AS T1 JOIN assignedto AS T2 ON T1.code = T2.project WHERE T1.hours > 300 GROUP BY T1.name;
Tables: Scientists, Projects, AssignedTo Columns: Scientists.SSN, Scientists.Name, Projects.Code, Projects.Name, Projects.Hours, AssignedTo.Scientist, AssignedTo.Project Question: Find the number of projects which each scientist is working on and scientist's name. [/INST]
SELECT count(*) , T1.name FROM scientists AS T1 JOIN assignedto AS T2 ON T1.ssn = T2.scientist GROUP BY T1.name;