My query is
select COUNT(*) from result
where test_id in (select test_id
from test_schedule
where scheduler_id in (select user_id
from users
where user_type=1))
The DISTINCT is necessary to keep rows from being multiplied by all the rows in the other tables that match.