select cr.criteria_id,
cr.criteria_name,
round(avg(r.rating),1) as rating
from recruiting_ratings r,
recruiting_criteria cr
where cr.criteria_id = r.criteria_id
and r.interview_id = recruiting_interviews.interview_id
and recruiting_interviews.candidate_id = :candidate_id
group by cr.criteria_id, cr.criteria_name
select round(avg(r.rating),1)
from recruiting_ratings r,
recruiting_interviews i
where r.interview_id = i.interview_id
and i.candidate_id = :candidate_id
select count(*)
from recruiting_interviews i
where i.candidate_id = :candidate_id
and i.should_hire_p = 't'
select count(*)
from recruiting_interviews i
where i.candidate_id = :candidate_id
and i.should_hire_p = 'f'