select question_id, sort_order, active_p, required_p, section_id
from survey_questions
where section_id in ( select section_id from survey_sections where survey_id=:survey_id)
order by section_id, sort_order
select section_id from survey_sections
where survey_id=:survey_id