Database: tracking_grants_for_research

Question: What are the response received dates for the documents described as 'Regular' or granted with more than 100?
SQL: SELECT T1.response_received_date FROM Documents AS T1 JOIN Document_Types AS T2 ON T1.document_type_code  =  T2.document_type_code JOIN Grants AS T3 ON T1.grant_id  =  T3.grant_id WHERE T2.document_description  =  'Regular' OR T3.grant_amount  >  100

Question: List the project details of the projects which did not hire any staff for a researcher role.
SQL: SELECT project_details FROM Projects WHERE project_id NOT IN ( SELECT project_id FROM Project_Staff WHERE role_code  =  'researcher' )

Question: What are the task details, task id and project id for the projects which are detailed as 'omnis' or  have more than 2 outcomes?
SQL: SELECT T1.task_details ,  T1.task_id ,  T2.project_id FROM Tasks AS T1 JOIN Projects AS T2 ON T1.project_id  =  T2.project_id WHERE T2.project_details  =  'omnis' UNION SELECT T1.task_details ,  T1.task_id ,  T2.project_id FROM Tasks AS T1 JOIN Projects AS T2 ON T1.project_id  =  T2.project_id JOIN Project_outcomes AS T3 ON T2.project_id  =  T3.project_id GROUP BY T2.project_id HAVING count(*)  >  2

Question: List the project details of the projects with the research outcome described with the substring 'Published'.
SQL: SELECT T1.project_details FROM Projects AS T1 JOIN Project_outcomes AS T2 ON T1.project_id  =  T2.project_id JOIN Research_outcomes AS T3 ON T2.outcome_code  =  T3.outcome_code WHERE T3.outcome_description LIKE '%Published%';

Question: How many staff does each project has? List the project id and the number in an ascending order.
SQL: SELECT T1.project_id ,  count(*) FROM Project_Staff AS T1 JOIN Projects AS T2 ON T1.project_id  =  T2.project_id GROUP BY T1.project_id ORDER BY count(*) ASC;

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;

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;

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 );

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;

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;