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 are the details of all organizations that are described as Sponsors and sort the results in 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
-- 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 Patent outcomes are generated from all the projects?
SQL: SELECT count(*) FROM Project_outcomes WHERE outcome_code  =  'Patent'
-- 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 patents outcomes were listed for all the projects?
SQL: SELECT count(*) FROM Project_outcomes WHERE outcome_code  =  'Patent'
-- 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 project staff worked as leaders or started working before '1989-04-24 23:51:54'?
SQL: SELECT count(*) FROM Project_Staff WHERE role_code  =  'leader' OR date_from  <  '1989-04-24 23:51:54'
-- 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 project members were leaders or started working before '1989-04-24 23:51:54'?
SQL: SELECT count(*) FROM Project_Staff WHERE role_code  =  'leader' OR date_from  <  '1989-04-24 23:51:54'
-- 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 last date of the staff leaving the projects?
SQL: SELECT date_to FROM Project_Staff ORDER BY date_to 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 is the last date that a staff member left a project?
SQL: SELECT date_to FROM Project_Staff ORDER BY date_to 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 result description of the project whose detail is 'sint'?
SQL: SELECT T1.outcome_description FROM Research_outcomes AS T1 JOIN Project_outcomes AS T2 ON T1.outcome_code  =  T2.outcome_code JOIN Projects AS T3 ON T2.project_id  =  T3.project_id WHERE T3.project_details  =  'sint'
-- 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 description for the results whose project detail is 'sint'?
SQL: SELECT T1.outcome_description FROM Research_outcomes AS T1 JOIN Project_outcomes AS T2 ON T1.outcome_code  =  T2.outcome_code JOIN Projects AS T3 ON T2.project_id  =  T3.project_id WHERE T3.project_details  =  'sint'
-- 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: List the organisation id with the maximum outcome count, and the count.
SQL: SELECT T1.organisation_id ,  count(*) FROM Projects AS T1 JOIN Project_outcomes AS T2 ON T1.project_id  =  T2.project_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 is the id of the organization with the maximum number of outcomes and how many outcomes are there?
SQL: SELECT T1.organisation_id ,  count(*) FROM Projects AS T1 JOIN Project_outcomes AS T2 ON T1.project_id  =  T2.project_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: List the project details of the projects launched by the organisation
SQL: SELECT project_details FROM Projects WHERE organisation_id IN ( SELECT organisation_id FROM Projects GROUP BY 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 details for the projects which were launched by the organization with the most projects?
SQL: SELECT project_details FROM Projects WHERE organisation_id IN ( SELECT organisation_id FROM Projects GROUP BY 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: List the research staff details, and order in ascending order.
SQL: SELECT staff_details FROM Research_Staff ORDER BY staff_details ASC
-- 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 details are there on the research staff? List the result in ascending alphabetical order.
SQL: SELECT staff_details FROM Research_Staff ORDER BY staff_details ASC
-- 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 tasks are there in total?
SQL: SELECT count(*) FROM Tasks
-- 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 tasks are there?
SQL: SELECT count(*) FROM Tasks
-- 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 tasks does each project have? List the task count and the project detail.
SQL: SELECT count(*) ,  T1.project_details FROM Projects AS T1 JOIN Tasks AS T2 ON T1.project_id  =  T2.project_id GROUP BY T1.project_id
-- 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 project id, how many tasks are there?
SQL: SELECT count(*) ,  T1.project_details FROM Projects AS T1 JOIN Tasks AS T2 ON T1.project_id  =  T2.project_id GROUP BY T1.project_id
-- 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 staff roles of the staff who
SQL: SELECT role_code FROM Project_Staff WHERE date_from  >  '2003-04-19 15:06:20' AND date_to  <  '2016-03-15 00:33:18'
-- 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 roles did staff members play between '2003-04-19 15:06:20' and '2016-03-15 00:33:18'?
SQL: SELECT role_code FROM Project_Staff WHERE date_from  >  '2003-04-19 15:06:20' AND date_to  <  '2016-03-15 00:33:18'
-- 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 descriptions of all the project outcomes?
SQL: SELECT T1.outcome_description FROM Research_outcomes AS T1 JOIN Project_outcomes AS T2 ON T1.outcome_code  =  T2.outcome_code