Show me the grant id for grants where the documents were sent before '1986-08-26 20:49:27'.
select t1.grant_id from grants as t1 join documents as t2 on t1.grant_id = t2.grant_id where t2.sent_date < '1986-08-26 20:49:27';
Which of those grant ended after '1989-03-16 18:27:16'? Show their id.
select t1.grant_id from grants as t1 join documents as t2 on t1.grant_id = t2.grant_id where t2.sent_date < '1986-08-26 20:49:27' intersect select grant_id from grants where grant_end_date > '1989-03-16 18:27:16'
What are the distinct grant amount of these grants?
select t1.grant_amount from grants as t1 join documents as t2 on t1.grant_id = t2.grant_id where t2.sent_date < '1986-08-26 20:49:27' intersect select grant_amount from grants where grant_end_date > '1989-03-16 18:27:16';