select parties.email as sender_email,
persons.first_names as sender_first_names,
persons.last_name as sender_last_name
from parties,
persons
where parties.party_id = :sender_id
and persons.person_id = :sender_id
select rel_segments.segment_id
from rel_segments
where rel_segments.group_id = :community_id
and rel_segments.rel_type = :rel_type
select count(*) from survey_responses_latest
where survey_id=:survey_id