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
 SQL Server 2000 Forums
 SQL Server Development (2000)
 DB Design

Author  Topic 

Vivaldi
Constraint Violating Yak Guru

298 Posts

Posted - 2006-03-01 : 12:55:42
Heres an open ended question on db design.
or, Whats the "right" way to do it?

I am implementing a web app that will allow users to recover their password if they
1. know their username
2. can answer two security questions.

1 of the questions is system defined (mother's maiden name, etc)
The second question will be user defined.

Currently:
Question table. (ID, questionText)
User table (ID, username, ....)
UserQuestion table.(id,userid,questionid,questionanswer,questionsalt)

The UserQuestion table holds their answer for the system generated question (encrypted of course)

So, the User Generated Question/Answer set.......

Would you put the User Defined Question(UDQ) in the tb_Question table? The issue with that is the question will never be used by more than one person. So, that UDQ shouldn't be put in a table that has no knowledge of the User. (given the 1:1 relationship)

Any design thoughts? I don't have anyone to bounce ideas off of here..


________________________________________________
The only cure for thinking is picking rocks, or drinking beer.

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2006-03-01 : 13:32:23
-- type defines is it system generated or user
create table Question (ID, questionText varchar, questionAnswer, questionSalt, ..., type)
create table User (ID, username, ....)
create table UserQuestion (id, userid, questionid)


Go with the flow & have fun! Else fight the flow
Go to Top of Page
   

- Advertisement -