create table #Project (id int, name varchar(50))
create table #Task (id int, ProjectID int, name varchar(50), Status varchar(20))
insert into #Project (id, name) values(1,'Победить всех')
insert into #Project (id, name) values(2,'Захватить власть')
insert into #Project (id, name) values(3,'Развязать войну')
insert into #Task (id, ProjectID, name, Status) values(1, 1, 'Накопить денег', 'Выполнено')
insert into #Task (id, ProjectID, name, Status) values(2, 1, 'Набрать армию', 'В процессе')
insert into #Task (id, ProjectID, name, Status) values(3, 2, 'Устроить переворот', 'В процессе')
insert into #Task (id, ProjectID, name, Status) values(4, 2, 'Захватить массмедиа', 'В процессе')
insert into #Task (id, ProjectID, name, Status) values(5, 2, 'Напечатать деньги', 'В процессе')
insert into #Task (id, ProjectID, name, Status) values(6, 3, 'Поссорится со всеми', 'В процессе')
insert into #Task (id, ProjectID, name, Status) values(7, 3, 'Захватить винный завод', 'В процессе')
select * from #Project
where Exists(select * from #Task
where #Project.Id=#Task.ProjectId and #Task.Status <> 'Выполнено')
select * from #Project
where not Exists(select * from #Task
where #Project.Id=#Task.ProjectId and #Task.Status <> 'Выполнено')