select name from survsimp_surveys where survey_id=:survey_id
select question_text
from survsimp_questions
where question_id = :question_id
select variable_name, survsimp_variables.variable_id as variable_id
from survsimp_variables, survsimp_variables_surveys_map
where survsimp_variables.variable_id = survsimp_variables_surveys_map.variable_id
and survey_id = :survey_id
order by variable_name
select choice_id, label from survsimp_question_choices where question_id = :question_id order by choice_id
select score, survsimp_variables.variable_id as variable_id
from survsimp_choice_scores, survsimp_variables
where survsimp_choice_scores.choice_id = :choice_id
and survsimp_choice_scores.variable_id = survsimp_variables.variable_id
order by variable_name