Which investors have some transactions?
select * from investors as t1 join transactions as t2 on t1.investor_id = t2.investor_id
How many of these investors have at least three transactions?
select count(*) from (select count(*) from investors as t1 join transactions as t2 on t1.investor_id = t2.investor_id group by t2.investor_id having count(*) >= 3)
Next, how many of these investors have at least two transactions?
select count(*) from (select count(*) from investors as t1 join transactions as t2 on t1.investor_id = t2.investor_id group by t2.investor_id having count(*) >= 2)
Please give their ids.
select t2.investor_id from investors as t1 join transactions as t2 on t1.investor_id = t2.investor_id group by t2.investor_id having count(*) >= 2