Quais são os detalhes das tarefas, o ID da tarefa e o ID do projeto para os projetos que são descritos como "omnis" ou que têm mais de 2 resultados?
CREATE TABLE Projects (project_id VARCHAR, project_details VARCHAR); CREATE TABLE Project_outcomes (project_id VARCHAR); CREATE TABLE Tasks (task_details VARCHAR, task_id VARCHAR, project_id VARCHAR)
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