Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 Database Design and Application Architecture
 Simple questionnaire design

Author  Topic 

btx
Starting Member

1 Post

Posted - 2009-06-15 : 11:36:35
I would like to design a simple questionnaire system, I don't know whether the following DB design is suitable, please give me some comments. THX!

--------------------------
Q: What pet do you like most?
A. Dog B. Cat C. Fish D. Rabbit

Q: What is your name?
A: Peter (input by the user)

--------------------------

Table 1: questionaire
questionaireID (int) [pk]
title varchar(100)

Table 2: questions
questionID (int) [pk]
questionaireID (int) [relationship with questionaire.questionaireID]
title varchar(255)

Table 3: answers
answerID (int) [pk]
questionID (int) [relationship with questions.questionID]
answer varchar(255)

Table 4: userAnswers
userAnswerID (int) [pk]
questionID int [relationship with questions.questionID]
answer varchar(255)
userID int
responseDate datetime

SQLRatankalwa
Starting Member

42 Posts

Posted - 2009-06-16 : 08:49:26
Hi

You have not specified whether there would be an option for the user to answer more than one question.

The only change would be In the userAnswers table, you can put the AnswerId instead of storing the Answer.

Ratan Kalwa
SQL Server Professionals User Group

http://www.revalsys.com
Go to Top of Page
   

- Advertisement -