sql server - SQL Questionaire Database Design (EAV Model) Issue -


im building friendship site try , match users share similar interests.

  • i have 25 questions defined answers(drop down answers) user must fill out.
  • im using entity–attribute–value model store users id question id answered id user selects.
  • i use count function see users have matches profile.

current table structure

  1. question table
  2. answer table
  3. question_answer_user table

the problem im running have 2 question , im not sure best place store them is.

  1. the question country?
  2. the question state?

im not sure if should store them other 25 questions or if should store them in 3 separate tables seen below.

  1. country table
  2. state table
  3. user_country_state table

there going alot of answer entries these 2 questions. example there 25 countries user can answer , total of 900 states / provinces user can answer from.

i want able consider users location similarity count im not sure best approach incorporate is?

i think selected country , state should live in user table, along other necessary user information such name , email address. don't think belongs in answers table, work there.

for list of options user select when setting account, storing them in pre-defined q , tables place any. depends, guess, on how data , functionality broken apart aren't crossing responsibility boundaries q&a table storing survey-type answers user-setup answers.


Comments

Popular posts from this blog

cakephp - simple blog with croogo -

How to group boxplot outliers in gnuplot -

bash - Performing variable substitution in a string -