In my previous post I introduced my Survey Suite extension. Today I managed to finish the database scheme. The main aspect of the design was the simplicity of the structure. You can see the relations between the database tables here (clicking on the picture will open it in full size view):

 

Some words about the tables:

survey_surveys: This table contains information about the surveys, like title, start and end date etc.
  - survey_survey_id: Primary key.

survey_questions: Contains information about the question, like title and question type.
  - survey_question_id: Primary key.
  - survey_survey_id: Foreign key to #__survey_surveys

survey_question_options: This table contains the options, from that a user can select at a question.
  - survey_question_option_id: Primary key.
  - survey_question_id: Foreign key to #__survey_questions

survey_responses: Contains information about a completed survey.
  - survey_response_id: Primary key.
  - survey_survey_id: Foreign key to #__survey_surves

survey_answers: Contains the details of the answer.
  - survey_answer_id: Primary key.
  - survey_response_id: Foreign key to #__survey_responses
  - survey_question_id: Foreign key to #__survey_questions
  - survey_survey_id: Foreign key to #__survey_surveys