sert121/SpiderSQL huggingface dataset:
-- Language PostgreSQL
        -- Tables: 
             -- Table: document types 
columns : [['document type code', 'text'], ['document description', 'text']]

 -- Table: documents 
columns : [['document id', 'number'], ['document type code', 'text'], ['grant id', 'number'], ['sent date', 'time'], ['response received date', 'time'], ['other details', 'text']]

 -- Table: grants 
columns : [['grant id', 'number'], ['organisation id', 'number'], ['grant amount', 'number'], ['grant start date', 'time'], ['grant end date', 'time'], ['other details', 'text']]

 -- Table: organisation types 
columns : [['organisation type', 'text'], ['organisation type description', 'text']]

 -- Table: organisations 
columns : [['organisation id', 'number'], ['organisation type', 'text'], ['organisation details', 'text']]

 -- Table: project outcomes 
columns : [['project id', 'number'], ['outcome code', 'text'], ['outcome details', 'text']]

 -- Table: project staff 
columns : [['staff id', 'number'], ['project id', 'number'], ['role code', 'text'], ['date from', 'time'], ['date to', 'time'], ['other details', 'text']]

 -- Table: projects 
columns : [['project id', 'number'], ['organisation id', 'number'], ['project details', 'text']]

 -- Table: research outcomes 
columns : [['outcome code', 'text'], ['outcome description', 'text']]

 -- Table: research staff 
columns : [['staff id', 'number'], ['employer organisation id', 'number'], ['staff details', 'text']]

 -- Table: staff roles 
columns : [['role code', 'text'], ['role description', 'text']]

 -- Table: tasks 
columns : [['task id', 'number'], ['project id', 'number'], ['task details', 'text'], ['eg agree objectives', 'text']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: What is the complete description of the researcher role.
SQL: SELECT role_description FROM Staff_Roles WHERE role_code  =  'researcher'
-- Language PostgreSQL
        -- Tables: 
             -- Table: document types 
columns : [['document type code', 'text'], ['document description', 'text']]

 -- Table: documents 
columns : [['document id', 'number'], ['document type code', 'text'], ['grant id', 'number'], ['sent date', 'time'], ['response received date', 'time'], ['other details', 'text']]

 -- Table: grants 
columns : [['grant id', 'number'], ['organisation id', 'number'], ['grant amount', 'number'], ['grant start date', 'time'], ['grant end date', 'time'], ['other details', 'text']]

 -- Table: organisation types 
columns : [['organisation type', 'text'], ['organisation type description', 'text']]

 -- Table: organisations 
columns : [['organisation id', 'number'], ['organisation type', 'text'], ['organisation details', 'text']]

 -- Table: project outcomes 
columns : [['project id', 'number'], ['outcome code', 'text'], ['outcome details', 'text']]

 -- Table: project staff 
columns : [['staff id', 'number'], ['project id', 'number'], ['role code', 'text'], ['date from', 'time'], ['date to', 'time'], ['other details', 'text']]

 -- Table: projects 
columns : [['project id', 'number'], ['organisation id', 'number'], ['project details', 'text']]

 -- Table: research outcomes 
columns : [['outcome code', 'text'], ['outcome description', 'text']]

 -- Table: research staff 
columns : [['staff id', 'number'], ['employer organisation id', 'number'], ['staff details', 'text']]

 -- Table: staff roles 
columns : [['role code', 'text'], ['role description', 'text']]

 -- Table: tasks 
columns : [['task id', 'number'], ['project id', 'number'], ['task details', 'text'], ['eg agree objectives', 'text']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: What is the complete description of the job of a researcher?
SQL: SELECT role_description FROM Staff_Roles WHERE role_code  =  'researcher'
-- Language PostgreSQL
        -- Tables: 
             -- Table: document types 
columns : [['document type code', 'text'], ['document description', 'text']]

 -- Table: documents 
columns : [['document id', 'number'], ['document type code', 'text'], ['grant id', 'number'], ['sent date', 'time'], ['response received date', 'time'], ['other details', 'text']]

 -- Table: grants 
columns : [['grant id', 'number'], ['organisation id', 'number'], ['grant amount', 'number'], ['grant start date', 'time'], ['grant end date', 'time'], ['other details', 'text']]

 -- Table: organisation types 
columns : [['organisation type', 'text'], ['organisation type description', 'text']]

 -- Table: organisations 
columns : [['organisation id', 'number'], ['organisation type', 'text'], ['organisation details', 'text']]

 -- Table: project outcomes 
columns : [['project id', 'number'], ['outcome code', 'text'], ['outcome details', 'text']]

 -- Table: project staff 
columns : [['staff id', 'number'], ['project id', 'number'], ['role code', 'text'], ['date from', 'time'], ['date to', 'time'], ['other details', 'text']]

 -- Table: projects 
columns : [['project id', 'number'], ['organisation id', 'number'], ['project details', 'text']]

 -- Table: research outcomes 
columns : [['outcome code', 'text'], ['outcome description', 'text']]

 -- Table: research staff 
columns : [['staff id', 'number'], ['employer organisation id', 'number'], ['staff details', 'text']]

 -- Table: staff roles 
columns : [['role code', 'text'], ['role description', 'text']]

 -- Table: tasks 
columns : [['task id', 'number'], ['project id', 'number'], ['task details', 'text'], ['eg agree objectives', 'text']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: When did the first staff for the projects started working?
SQL: SELECT date_from FROM Project_Staff ORDER BY date_from ASC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: document types 
columns : [['document type code', 'text'], ['document description', 'text']]

 -- Table: documents 
columns : [['document id', 'number'], ['document type code', 'text'], ['grant id', 'number'], ['sent date', 'time'], ['response received date', 'time'], ['other details', 'text']]

 -- Table: grants 
columns : [['grant id', 'number'], ['organisation id', 'number'], ['grant amount', 'number'], ['grant start date', 'time'], ['grant end date', 'time'], ['other details', 'text']]

 -- Table: organisation types 
columns : [['organisation type', 'text'], ['organisation type description', 'text']]

 -- Table: organisations 
columns : [['organisation id', 'number'], ['organisation type', 'text'], ['organisation details', 'text']]

 -- Table: project outcomes 
columns : [['project id', 'number'], ['outcome code', 'text'], ['outcome details', 'text']]

 -- Table: project staff 
columns : [['staff id', 'number'], ['project id', 'number'], ['role code', 'text'], ['date from', 'time'], ['date to', 'time'], ['other details', 'text']]

 -- Table: projects 
columns : [['project id', 'number'], ['organisation id', 'number'], ['project details', 'text']]

 -- Table: research outcomes 
columns : [['outcome code', 'text'], ['outcome description', 'text']]

 -- Table: research staff 
columns : [['staff id', 'number'], ['employer organisation id', 'number'], ['staff details', 'text']]

 -- Table: staff roles 
columns : [['role code', 'text'], ['role description', 'text']]

 -- Table: tasks 
columns : [['task id', 'number'], ['project id', 'number'], ['task details', 'text'], ['eg agree objectives', 'text']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: When did the first staff member start working?
SQL: SELECT date_from FROM Project_Staff ORDER BY date_from ASC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: document types 
columns : [['document type code', 'text'], ['document description', 'text']]

 -- Table: documents 
columns : [['document id', 'number'], ['document type code', 'text'], ['grant id', 'number'], ['sent date', 'time'], ['response received date', 'time'], ['other details', 'text']]

 -- Table: grants 
columns : [['grant id', 'number'], ['organisation id', 'number'], ['grant amount', 'number'], ['grant start date', 'time'], ['grant end date', 'time'], ['other details', 'text']]

 -- Table: organisation types 
columns : [['organisation type', 'text'], ['organisation type description', 'text']]

 -- Table: organisations 
columns : [['organisation id', 'number'], ['organisation type', 'text'], ['organisation details', 'text']]

 -- Table: project outcomes 
columns : [['project id', 'number'], ['outcome code', 'text'], ['outcome details', 'text']]

 -- Table: project staff 
columns : [['staff id', 'number'], ['project id', 'number'], ['role code', 'text'], ['date from', 'time'], ['date to', 'time'], ['other details', 'text']]

 -- Table: projects 
columns : [['project id', 'number'], ['organisation id', 'number'], ['project details', 'text']]

 -- Table: research outcomes 
columns : [['outcome code', 'text'], ['outcome description', 'text']]

 -- Table: research staff 
columns : [['staff id', 'number'], ['employer organisation id', 'number'], ['staff details', 'text']]

 -- Table: staff roles 
columns : [['role code', 'text'], ['role description', 'text']]

 -- Table: tasks 
columns : [['task id', 'number'], ['project id', 'number'], ['task details', 'text'], ['eg agree objectives', 'text']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: Which project made the most number of outcomes? List the project details and the project id.
SQL: SELECT T1.project_details ,  T1.project_id FROM Projects AS T1 JOIN Project_outcomes AS T2 ON T1.project_id  =  T2.project_id GROUP BY T1.project_id ORDER BY count(*) DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: document types 
columns : [['document type code', 'text'], ['document description', 'text']]

 -- Table: documents 
columns : [['document id', 'number'], ['document type code', 'text'], ['grant id', 'number'], ['sent date', 'time'], ['response received date', 'time'], ['other details', 'text']]

 -- Table: grants 
columns : [['grant id', 'number'], ['organisation id', 'number'], ['grant amount', 'number'], ['grant start date', 'time'], ['grant end date', 'time'], ['other details', 'text']]

 -- Table: organisation types 
columns : [['organisation type', 'text'], ['organisation type description', 'text']]

 -- Table: organisations 
columns : [['organisation id', 'number'], ['organisation type', 'text'], ['organisation details', 'text']]

 -- Table: project outcomes 
columns : [['project id', 'number'], ['outcome code', 'text'], ['outcome details', 'text']]

 -- Table: project staff 
columns : [['staff id', 'number'], ['project id', 'number'], ['role code', 'text'], ['date from', 'time'], ['date to', 'time'], ['other details', 'text']]

 -- Table: projects 
columns : [['project id', 'number'], ['organisation id', 'number'], ['project details', 'text']]

 -- Table: research outcomes 
columns : [['outcome code', 'text'], ['outcome description', 'text']]

 -- Table: research staff 
columns : [['staff id', 'number'], ['employer organisation id', 'number'], ['staff details', 'text']]

 -- Table: staff roles 
columns : [['role code', 'text'], ['role description', 'text']]

 -- Table: tasks 
columns : [['task id', 'number'], ['project id', 'number'], ['task details', 'text'], ['eg agree objectives', 'text']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: What are the details and id of the project with the most outcomes?
SQL: SELECT T1.project_details ,  T1.project_id FROM Projects AS T1 JOIN Project_outcomes AS T2 ON T1.project_id  =  T2.project_id GROUP BY T1.project_id ORDER BY count(*) DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: document types 
columns : [['document type code', 'text'], ['document description', 'text']]

 -- Table: documents 
columns : [['document id', 'number'], ['document type code', 'text'], ['grant id', 'number'], ['sent date', 'time'], ['response received date', 'time'], ['other details', 'text']]

 -- Table: grants 
columns : [['grant id', 'number'], ['organisation id', 'number'], ['grant amount', 'number'], ['grant start date', 'time'], ['grant end date', 'time'], ['other details', 'text']]

 -- Table: organisation types 
columns : [['organisation type', 'text'], ['organisation type description', 'text']]

 -- Table: organisations 
columns : [['organisation id', 'number'], ['organisation type', 'text'], ['organisation details', 'text']]

 -- Table: project outcomes 
columns : [['project id', 'number'], ['outcome code', 'text'], ['outcome details', 'text']]

 -- Table: project staff 
columns : [['staff id', 'number'], ['project id', 'number'], ['role code', 'text'], ['date from', 'time'], ['date to', 'time'], ['other details', 'text']]

 -- Table: projects 
columns : [['project id', 'number'], ['organisation id', 'number'], ['project details', 'text']]

 -- Table: research outcomes 
columns : [['outcome code', 'text'], ['outcome description', 'text']]

 -- Table: research staff 
columns : [['staff id', 'number'], ['employer organisation id', 'number'], ['staff details', 'text']]

 -- Table: staff roles 
columns : [['role code', 'text'], ['role description', 'text']]

 -- Table: tasks 
columns : [['task id', 'number'], ['project id', 'number'], ['task details', 'text'], ['eg agree objectives', 'text']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: Which projects have no outcome? List the project details.
SQL: SELECT project_details FROM Projects WHERE project_id NOT IN ( SELECT project_id FROM Project_outcomes )
-- Language PostgreSQL
        -- Tables: 
             -- Table: document types 
columns : [['document type code', 'text'], ['document description', 'text']]

 -- Table: documents 
columns : [['document id', 'number'], ['document type code', 'text'], ['grant id', 'number'], ['sent date', 'time'], ['response received date', 'time'], ['other details', 'text']]

 -- Table: grants 
columns : [['grant id', 'number'], ['organisation id', 'number'], ['grant amount', 'number'], ['grant start date', 'time'], ['grant end date', 'time'], ['other details', 'text']]

 -- Table: organisation types 
columns : [['organisation type', 'text'], ['organisation type description', 'text']]

 -- Table: organisations 
columns : [['organisation id', 'number'], ['organisation type', 'text'], ['organisation details', 'text']]

 -- Table: project outcomes 
columns : [['project id', 'number'], ['outcome code', 'text'], ['outcome details', 'text']]

 -- Table: project staff 
columns : [['staff id', 'number'], ['project id', 'number'], ['role code', 'text'], ['date from', 'time'], ['date to', 'time'], ['other details', 'text']]

 -- Table: projects 
columns : [['project id', 'number'], ['organisation id', 'number'], ['project details', 'text']]

 -- Table: research outcomes 
columns : [['outcome code', 'text'], ['outcome description', 'text']]

 -- Table: research staff 
columns : [['staff id', 'number'], ['employer organisation id', 'number'], ['staff details', 'text']]

 -- Table: staff roles 
columns : [['role code', 'text'], ['role description', 'text']]

 -- Table: tasks 
columns : [['task id', 'number'], ['project id', 'number'], ['task details', 'text'], ['eg agree objectives', 'text']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: What are the details of the project with no outcomes?
SQL: SELECT project_details FROM Projects WHERE project_id NOT IN ( SELECT project_id FROM Project_outcomes )
-- Language PostgreSQL
        -- Tables: 
             -- Table: document types 
columns : [['document type code', 'text'], ['document description', 'text']]

 -- Table: documents 
columns : [['document id', 'number'], ['document type code', 'text'], ['grant id', 'number'], ['sent date', 'time'], ['response received date', 'time'], ['other details', 'text']]

 -- Table: grants 
columns : [['grant id', 'number'], ['organisation id', 'number'], ['grant amount', 'number'], ['grant start date', 'time'], ['grant end date', 'time'], ['other details', 'text']]

 -- Table: organisation types 
columns : [['organisation type', 'text'], ['organisation type description', 'text']]

 -- Table: organisations 
columns : [['organisation id', 'number'], ['organisation type', 'text'], ['organisation details', 'text']]

 -- Table: project outcomes 
columns : [['project id', 'number'], ['outcome code', 'text'], ['outcome details', 'text']]

 -- Table: project staff 
columns : [['staff id', 'number'], ['project id', 'number'], ['role code', 'text'], ['date from', 'time'], ['date to', 'time'], ['other details', 'text']]

 -- Table: projects 
columns : [['project id', 'number'], ['organisation id', 'number'], ['project details', 'text']]

 -- Table: research outcomes 
columns : [['outcome code', 'text'], ['outcome description', 'text']]

 -- Table: research staff 
columns : [['staff id', 'number'], ['employer organisation id', 'number'], ['staff details', 'text']]

 -- Table: staff roles 
columns : [['role code', 'text'], ['role description', 'text']]

 -- Table: tasks 
columns : [['task id', 'number'], ['project id', 'number'], ['task details', 'text'], ['eg agree objectives', 'text']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: Which organisation hired the most number of research staff? List the organisation id, type and detail.
SQL: SELECT T1.organisation_id ,  T1.organisation_type ,  T1.organisation_details FROM Organisations AS T1 JOIN Research_Staff AS T2 ON T1.organisation_id  =  T2.employer_organisation_id GROUP BY T1.organisation_id ORDER BY count(*) DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: document types 
columns : [['document type code', 'text'], ['document description', 'text']]

 -- Table: documents 
columns : [['document id', 'number'], ['document type code', 'text'], ['grant id', 'number'], ['sent date', 'time'], ['response received date', 'time'], ['other details', 'text']]

 -- Table: grants 
columns : [['grant id', 'number'], ['organisation id', 'number'], ['grant amount', 'number'], ['grant start date', 'time'], ['grant end date', 'time'], ['other details', 'text']]

 -- Table: organisation types 
columns : [['organisation type', 'text'], ['organisation type description', 'text']]

 -- Table: organisations 
columns : [['organisation id', 'number'], ['organisation type', 'text'], ['organisation details', 'text']]

 -- Table: project outcomes 
columns : [['project id', 'number'], ['outcome code', 'text'], ['outcome details', 'text']]

 -- Table: project staff 
columns : [['staff id', 'number'], ['project id', 'number'], ['role code', 'text'], ['date from', 'time'], ['date to', 'time'], ['other details', 'text']]

 -- Table: projects 
columns : [['project id', 'number'], ['organisation id', 'number'], ['project details', 'text']]

 -- Table: research outcomes 
columns : [['outcome code', 'text'], ['outcome description', 'text']]

 -- Table: research staff 
columns : [['staff id', 'number'], ['employer organisation id', 'number'], ['staff details', 'text']]

 -- Table: staff roles 
columns : [['role code', 'text'], ['role description', 'text']]

 -- Table: tasks 
columns : [['task id', 'number'], ['project id', 'number'], ['task details', 'text'], ['eg agree objectives', 'text']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: What are the ids, types, and details of the organization with the most research staff?
SQL: SELECT T1.organisation_id ,  T1.organisation_type ,  T1.organisation_details FROM Organisations AS T1 JOIN Research_Staff AS T2 ON T1.organisation_id  =  T2.employer_organisation_id GROUP BY T1.organisation_id ORDER BY count(*) DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: document types 
columns : [['document type code', 'text'], ['document description', 'text']]

 -- Table: documents 
columns : [['document id', 'number'], ['document type code', 'text'], ['grant id', 'number'], ['sent date', 'time'], ['response received date', 'time'], ['other details', 'text']]

 -- Table: grants 
columns : [['grant id', 'number'], ['organisation id', 'number'], ['grant amount', 'number'], ['grant start date', 'time'], ['grant end date', 'time'], ['other details', 'text']]

 -- Table: organisation types 
columns : [['organisation type', 'text'], ['organisation type description', 'text']]

 -- Table: organisations 
columns : [['organisation id', 'number'], ['organisation type', 'text'], ['organisation details', 'text']]

 -- Table: project outcomes 
columns : [['project id', 'number'], ['outcome code', 'text'], ['outcome details', 'text']]

 -- Table: project staff 
columns : [['staff id', 'number'], ['project id', 'number'], ['role code', 'text'], ['date from', 'time'], ['date to', 'time'], ['other details', 'text']]

 -- Table: projects 
columns : [['project id', 'number'], ['organisation id', 'number'], ['project details', 'text']]

 -- Table: research outcomes 
columns : [['outcome code', 'text'], ['outcome description', 'text']]

 -- Table: research staff 
columns : [['staff id', 'number'], ['employer organisation id', 'number'], ['staff details', 'text']]

 -- Table: staff roles 
columns : [['role code', 'text'], ['role description', 'text']]

 -- Table: tasks 
columns : [['task id', 'number'], ['project id', 'number'], ['task details', 'text'], ['eg agree objectives', 'text']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: Show the role description and the id of the project staff involved in most number of project outcomes?
SQL: SELECT T1.role_description ,  T2.staff_id FROM Staff_Roles AS T1 JOIN Project_Staff AS T2 ON T1.role_code  =  T2.role_code JOIN Project_outcomes AS T3 ON T2.project_id  =  T3.project_id GROUP BY T2.staff_id ORDER BY count(*) DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: document types 
columns : [['document type code', 'text'], ['document description', 'text']]

 -- Table: documents 
columns : [['document id', 'number'], ['document type code', 'text'], ['grant id', 'number'], ['sent date', 'time'], ['response received date', 'time'], ['other details', 'text']]

 -- Table: grants 
columns : [['grant id', 'number'], ['organisation id', 'number'], ['grant amount', 'number'], ['grant start date', 'time'], ['grant end date', 'time'], ['other details', 'text']]

 -- Table: organisation types 
columns : [['organisation type', 'text'], ['organisation type description', 'text']]

 -- Table: organisations 
columns : [['organisation id', 'number'], ['organisation type', 'text'], ['organisation details', 'text']]

 -- Table: project outcomes 
columns : [['project id', 'number'], ['outcome code', 'text'], ['outcome details', 'text']]

 -- Table: project staff 
columns : [['staff id', 'number'], ['project id', 'number'], ['role code', 'text'], ['date from', 'time'], ['date to', 'time'], ['other details', 'text']]

 -- Table: projects 
columns : [['project id', 'number'], ['organisation id', 'number'], ['project details', 'text']]

 -- Table: research outcomes 
columns : [['outcome code', 'text'], ['outcome description', 'text']]

 -- Table: research staff 
columns : [['staff id', 'number'], ['employer organisation id', 'number'], ['staff details', 'text']]

 -- Table: staff roles 
columns : [['role code', 'text'], ['role description', 'text']]

 -- Table: tasks 
columns : [['task id', 'number'], ['project id', 'number'], ['task details', 'text'], ['eg agree objectives', 'text']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: For each staff id, what is the description of the role that is involved with the most number of projects?
SQL: SELECT T1.role_description ,  T2.staff_id FROM Staff_Roles AS T1 JOIN Project_Staff AS T2 ON T1.role_code  =  T2.role_code JOIN Project_outcomes AS T3 ON T2.project_id  =  T3.project_id GROUP BY T2.staff_id ORDER BY count(*) DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: document types 
columns : [['document type code', 'text'], ['document description', 'text']]

 -- Table: documents 
columns : [['document id', 'number'], ['document type code', 'text'], ['grant id', 'number'], ['sent date', 'time'], ['response received date', 'time'], ['other details', 'text']]

 -- Table: grants 
columns : [['grant id', 'number'], ['organisation id', 'number'], ['grant amount', 'number'], ['grant start date', 'time'], ['grant end date', 'time'], ['other details', 'text']]

 -- Table: organisation types 
columns : [['organisation type', 'text'], ['organisation type description', 'text']]

 -- Table: organisations 
columns : [['organisation id', 'number'], ['organisation type', 'text'], ['organisation details', 'text']]

 -- Table: project outcomes 
columns : [['project id', 'number'], ['outcome code', 'text'], ['outcome details', 'text']]

 -- Table: project staff 
columns : [['staff id', 'number'], ['project id', 'number'], ['role code', 'text'], ['date from', 'time'], ['date to', 'time'], ['other details', 'text']]

 -- Table: projects 
columns : [['project id', 'number'], ['organisation id', 'number'], ['project details', 'text']]

 -- Table: research outcomes 
columns : [['outcome code', 'text'], ['outcome description', 'text']]

 -- Table: research staff 
columns : [['staff id', 'number'], ['employer organisation id', 'number'], ['staff details', 'text']]

 -- Table: staff roles 
columns : [['role code', 'text'], ['role description', 'text']]

 -- Table: tasks 
columns : [['task id', 'number'], ['project id', 'number'], ['task details', 'text'], ['eg agree objectives', 'text']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: Which document type is described with the prefix 'Initial'?
SQL: SELECT document_type_code FROM Document_Types WHERE document_description LIKE 'Initial%'
-- Language PostgreSQL
        -- Tables: 
             -- Table: document types 
columns : [['document type code', 'text'], ['document description', 'text']]

 -- Table: documents 
columns : [['document id', 'number'], ['document type code', 'text'], ['grant id', 'number'], ['sent date', 'time'], ['response received date', 'time'], ['other details', 'text']]

 -- Table: grants 
columns : [['grant id', 'number'], ['organisation id', 'number'], ['grant amount', 'number'], ['grant start date', 'time'], ['grant end date', 'time'], ['other details', 'text']]

 -- Table: organisation types 
columns : [['organisation type', 'text'], ['organisation type description', 'text']]

 -- Table: organisations 
columns : [['organisation id', 'number'], ['organisation type', 'text'], ['organisation details', 'text']]

 -- Table: project outcomes 
columns : [['project id', 'number'], ['outcome code', 'text'], ['outcome details', 'text']]

 -- Table: project staff 
columns : [['staff id', 'number'], ['project id', 'number'], ['role code', 'text'], ['date from', 'time'], ['date to', 'time'], ['other details', 'text']]

 -- Table: projects 
columns : [['project id', 'number'], ['organisation id', 'number'], ['project details', 'text']]

 -- Table: research outcomes 
columns : [['outcome code', 'text'], ['outcome description', 'text']]

 -- Table: research staff 
columns : [['staff id', 'number'], ['employer organisation id', 'number'], ['staff details', 'text']]

 -- Table: staff roles 
columns : [['role code', 'text'], ['role description', 'text']]

 -- Table: tasks 
columns : [['task id', 'number'], ['project id', 'number'], ['task details', 'text'], ['eg agree objectives', 'text']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: What is the type of the document whose description starts with the word 'Initial'?
SQL: SELECT document_type_code FROM Document_Types WHERE document_description LIKE 'Initial%'
-- Language PostgreSQL
        -- Tables: 
             -- Table: document types 
columns : [['document type code', 'text'], ['document description', 'text']]

 -- Table: documents 
columns : [['document id', 'number'], ['document type code', 'text'], ['grant id', 'number'], ['sent date', 'time'], ['response received date', 'time'], ['other details', 'text']]

 -- Table: grants 
columns : [['grant id', 'number'], ['organisation id', 'number'], ['grant amount', 'number'], ['grant start date', 'time'], ['grant end date', 'time'], ['other details', 'text']]

 -- Table: organisation types 
columns : [['organisation type', 'text'], ['organisation type description', 'text']]

 -- Table: organisations 
columns : [['organisation id', 'number'], ['organisation type', 'text'], ['organisation details', 'text']]

 -- Table: project outcomes 
columns : [['project id', 'number'], ['outcome code', 'text'], ['outcome details', 'text']]

 -- Table: project staff 
columns : [['staff id', 'number'], ['project id', 'number'], ['role code', 'text'], ['date from', 'time'], ['date to', 'time'], ['other details', 'text']]

 -- Table: projects 
columns : [['project id', 'number'], ['organisation id', 'number'], ['project details', 'text']]

 -- Table: research outcomes 
columns : [['outcome code', 'text'], ['outcome description', 'text']]

 -- Table: research staff 
columns : [['staff id', 'number'], ['employer organisation id', 'number'], ['staff details', 'text']]

 -- Table: staff roles 
columns : [['role code', 'text'], ['role description', 'text']]

 -- Table: tasks 
columns : [['task id', 'number'], ['project id', 'number'], ['task details', 'text'], ['eg agree objectives', 'text']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: For grants with both documents described as 'Regular' and documents described as 'Initial Application', list its start date.
SQL: SELECT T1.grant_start_date FROM Grants AS T1 JOIN Documents AS T2 ON T1.grant_id  =  T2.grant_id JOIN Document_Types AS T3 ON T2.document_type_code  =  T3.document_type_code WHERE T3.document_description  =  'Regular' INTERSECT SELECT T1.grant_start_date FROM Grants AS T1 JOIN Documents AS T2 ON T1.grant_id  =  T2.grant_id JOIN Document_Types AS T3 ON T2.document_type_code  =  T3.document_type_code WHERE T3.document_description  =  'Initial Application'
-- Language PostgreSQL
        -- Tables: 
             -- Table: document types 
columns : [['document type code', 'text'], ['document description', 'text']]

 -- Table: documents 
columns : [['document id', 'number'], ['document type code', 'text'], ['grant id', 'number'], ['sent date', 'time'], ['response received date', 'time'], ['other details', 'text']]

 -- Table: grants 
columns : [['grant id', 'number'], ['organisation id', 'number'], ['grant amount', 'number'], ['grant start date', 'time'], ['grant end date', 'time'], ['other details', 'text']]

 -- Table: organisation types 
columns : [['organisation type', 'text'], ['organisation type description', 'text']]

 -- Table: organisations 
columns : [['organisation id', 'number'], ['organisation type', 'text'], ['organisation details', 'text']]

 -- Table: project outcomes 
columns : [['project id', 'number'], ['outcome code', 'text'], ['outcome details', 'text']]

 -- Table: project staff 
columns : [['staff id', 'number'], ['project id', 'number'], ['role code', 'text'], ['date from', 'time'], ['date to', 'time'], ['other details', 'text']]

 -- Table: projects 
columns : [['project id', 'number'], ['organisation id', 'number'], ['project details', 'text']]

 -- Table: research outcomes 
columns : [['outcome code', 'text'], ['outcome description', 'text']]

 -- Table: research staff 
columns : [['staff id', 'number'], ['employer organisation id', 'number'], ['staff details', 'text']]

 -- Table: staff roles 
columns : [['role code', 'text'], ['role description', 'text']]

 -- Table: tasks 
columns : [['task id', 'number'], ['project id', 'number'], ['task details', 'text'], ['eg agree objectives', 'text']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: For grants that have descriptions of Regular and Initial Applications, what are their start dates?
SQL: SELECT T1.grant_start_date FROM Grants AS T1 JOIN Documents AS T2 ON T1.grant_id  =  T2.grant_id JOIN Document_Types AS T3 ON T2.document_type_code  =  T3.document_type_code WHERE T3.document_description  =  'Regular' INTERSECT SELECT T1.grant_start_date FROM Grants AS T1 JOIN Documents AS T2 ON T1.grant_id  =  T2.grant_id JOIN Document_Types AS T3 ON T2.document_type_code  =  T3.document_type_code WHERE T3.document_description  =  'Initial Application'
-- Language PostgreSQL
        -- Tables: 
             -- Table: document types 
columns : [['document type code', 'text'], ['document description', 'text']]

 -- Table: documents 
columns : [['document id', 'number'], ['document type code', 'text'], ['grant id', 'number'], ['sent date', 'time'], ['response received date', 'time'], ['other details', 'text']]

 -- Table: grants 
columns : [['grant id', 'number'], ['organisation id', 'number'], ['grant amount', 'number'], ['grant start date', 'time'], ['grant end date', 'time'], ['other details', 'text']]

 -- Table: organisation types 
columns : [['organisation type', 'text'], ['organisation type description', 'text']]

 -- Table: organisations 
columns : [['organisation id', 'number'], ['organisation type', 'text'], ['organisation details', 'text']]

 -- Table: project outcomes 
columns : [['project id', 'number'], ['outcome code', 'text'], ['outcome details', 'text']]

 -- Table: project staff 
columns : [['staff id', 'number'], ['project id', 'number'], ['role code', 'text'], ['date from', 'time'], ['date to', 'time'], ['other details', 'text']]

 -- Table: projects 
columns : [['project id', 'number'], ['organisation id', 'number'], ['project details', 'text']]

 -- Table: research outcomes 
columns : [['outcome code', 'text'], ['outcome description', 'text']]

 -- Table: research staff 
columns : [['staff id', 'number'], ['employer organisation id', 'number'], ['staff details', 'text']]

 -- Table: staff roles 
columns : [['role code', 'text'], ['role description', 'text']]

 -- Table: tasks 
columns : [['task id', 'number'], ['project id', 'number'], ['task details', 'text'], ['eg agree objectives', 'text']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: How many documents can one grant have at most? List the grant id and number.
SQL: SELECT grant_id ,  count(*) FROM Documents GROUP BY grant_id ORDER BY count(*) DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: document types 
columns : [['document type code', 'text'], ['document description', 'text']]

 -- Table: documents 
columns : [['document id', 'number'], ['document type code', 'text'], ['grant id', 'number'], ['sent date', 'time'], ['response received date', 'time'], ['other details', 'text']]

 -- Table: grants 
columns : [['grant id', 'number'], ['organisation id', 'number'], ['grant amount', 'number'], ['grant start date', 'time'], ['grant end date', 'time'], ['other details', 'text']]

 -- Table: organisation types 
columns : [['organisation type', 'text'], ['organisation type description', 'text']]

 -- Table: organisations 
columns : [['organisation id', 'number'], ['organisation type', 'text'], ['organisation details', 'text']]

 -- Table: project outcomes 
columns : [['project id', 'number'], ['outcome code', 'text'], ['outcome details', 'text']]

 -- Table: project staff 
columns : [['staff id', 'number'], ['project id', 'number'], ['role code', 'text'], ['date from', 'time'], ['date to', 'time'], ['other details', 'text']]

 -- Table: projects 
columns : [['project id', 'number'], ['organisation id', 'number'], ['project details', 'text']]

 -- Table: research outcomes 
columns : [['outcome code', 'text'], ['outcome description', 'text']]

 -- Table: research staff 
columns : [['staff id', 'number'], ['employer organisation id', 'number'], ['staff details', 'text']]

 -- Table: staff roles 
columns : [['role code', 'text'], ['role description', 'text']]

 -- Table: tasks 
columns : [['task id', 'number'], ['project id', 'number'], ['task details', 'text'], ['eg agree objectives', 'text']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: For each grant id, how many documents does it have, and which one has the most?
SQL: SELECT grant_id ,  count(*) FROM Documents GROUP BY grant_id ORDER BY count(*) DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: document types 
columns : [['document type code', 'text'], ['document description', 'text']]

 -- Table: documents 
columns : [['document id', 'number'], ['document type code', 'text'], ['grant id', 'number'], ['sent date', 'time'], ['response received date', 'time'], ['other details', 'text']]

 -- Table: grants 
columns : [['grant id', 'number'], ['organisation id', 'number'], ['grant amount', 'number'], ['grant start date', 'time'], ['grant end date', 'time'], ['other details', 'text']]

 -- Table: organisation types 
columns : [['organisation type', 'text'], ['organisation type description', 'text']]

 -- Table: organisations 
columns : [['organisation id', 'number'], ['organisation type', 'text'], ['organisation details', 'text']]

 -- Table: project outcomes 
columns : [['project id', 'number'], ['outcome code', 'text'], ['outcome details', 'text']]

 -- Table: project staff 
columns : [['staff id', 'number'], ['project id', 'number'], ['role code', 'text'], ['date from', 'time'], ['date to', 'time'], ['other details', 'text']]

 -- Table: projects 
columns : [['project id', 'number'], ['organisation id', 'number'], ['project details', 'text']]

 -- Table: research outcomes 
columns : [['outcome code', 'text'], ['outcome description', 'text']]

 -- Table: research staff 
columns : [['staff id', 'number'], ['employer organisation id', 'number'], ['staff details', 'text']]

 -- Table: staff roles 
columns : [['role code', 'text'], ['role description', 'text']]

 -- Table: tasks 
columns : [['task id', 'number'], ['project id', 'number'], ['task details', 'text'], ['eg agree objectives', 'text']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: Find the organisation type description of the organisation detailed as 'quo'.
SQL: SELECT T1.organisation_type_description FROM organisation_Types AS T1 JOIN Organisations AS T2 ON T1.organisation_type  =  T2.organisation_type WHERE T2.organisation_details  =  'quo'
-- Language PostgreSQL
        -- Tables: 
             -- Table: document types 
columns : [['document type code', 'text'], ['document description', 'text']]

 -- Table: documents 
columns : [['document id', 'number'], ['document type code', 'text'], ['grant id', 'number'], ['sent date', 'time'], ['response received date', 'time'], ['other details', 'text']]

 -- Table: grants 
columns : [['grant id', 'number'], ['organisation id', 'number'], ['grant amount', 'number'], ['grant start date', 'time'], ['grant end date', 'time'], ['other details', 'text']]

 -- Table: organisation types 
columns : [['organisation type', 'text'], ['organisation type description', 'text']]

 -- Table: organisations 
columns : [['organisation id', 'number'], ['organisation type', 'text'], ['organisation details', 'text']]

 -- Table: project outcomes 
columns : [['project id', 'number'], ['outcome code', 'text'], ['outcome details', 'text']]

 -- Table: project staff 
columns : [['staff id', 'number'], ['project id', 'number'], ['role code', 'text'], ['date from', 'time'], ['date to', 'time'], ['other details', 'text']]

 -- Table: projects 
columns : [['project id', 'number'], ['organisation id', 'number'], ['project details', 'text']]

 -- Table: research outcomes 
columns : [['outcome code', 'text'], ['outcome description', 'text']]

 -- Table: research staff 
columns : [['staff id', 'number'], ['employer organisation id', 'number'], ['staff details', 'text']]

 -- Table: staff roles 
columns : [['role code', 'text'], ['role description', 'text']]

 -- Table: tasks 
columns : [['task id', 'number'], ['project id', 'number'], ['task details', 'text'], ['eg agree objectives', 'text']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: What is the type description of the organization whose detail is listed as 'quo'?
SQL: SELECT T1.organisation_type_description FROM organisation_Types AS T1 JOIN Organisations AS T2 ON T1.organisation_type  =  T2.organisation_type WHERE T2.organisation_details  =  'quo'
-- Language PostgreSQL
        -- Tables: 
             -- Table: document types 
columns : [['document type code', 'text'], ['document description', 'text']]

 -- Table: documents 
columns : [['document id', 'number'], ['document type code', 'text'], ['grant id', 'number'], ['sent date', 'time'], ['response received date', 'time'], ['other details', 'text']]

 -- Table: grants 
columns : [['grant id', 'number'], ['organisation id', 'number'], ['grant amount', 'number'], ['grant start date', 'time'], ['grant end date', 'time'], ['other details', 'text']]

 -- Table: organisation types 
columns : [['organisation type', 'text'], ['organisation type description', 'text']]

 -- Table: organisations 
columns : [['organisation id', 'number'], ['organisation type', 'text'], ['organisation details', 'text']]

 -- Table: project outcomes 
columns : [['project id', 'number'], ['outcome code', 'text'], ['outcome details', 'text']]

 -- Table: project staff 
columns : [['staff id', 'number'], ['project id', 'number'], ['role code', 'text'], ['date from', 'time'], ['date to', 'time'], ['other details', 'text']]

 -- Table: projects 
columns : [['project id', 'number'], ['organisation id', 'number'], ['project details', 'text']]

 -- Table: research outcomes 
columns : [['outcome code', 'text'], ['outcome description', 'text']]

 -- Table: research staff 
columns : [['staff id', 'number'], ['employer organisation id', 'number'], ['staff details', 'text']]

 -- Table: staff roles 
columns : [['role code', 'text'], ['role description', 'text']]

 -- Table: tasks 
columns : [['task id', 'number'], ['project id', 'number'], ['task details', 'text'], ['eg agree objectives', 'text']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: What are all the details of the organisations described as 'Sponsor'? Sort the result in an ascending order.
SQL: SELECT organisation_details FROM Organisations AS T1 JOIN organisation_Types AS T2 ON T1.organisation_type  =  T2.organisation_type WHERE T2.organisation_type_description  =  'Sponsor' ORDER BY organisation_details