[thelist] Re: Survey database design for storing responses to multiple-choi ce questions

Ben Gustafson Ben_Gustafson at lionbridge.com
Tue May 21 10:25:01 CDT 2002


--
[ Picked text/plain from multipart/alternative ]
Rudy,

Thanks for your mind-expanding essay on foreign and primary keys (which I
will reference by its archive link
[http://lists.evolt.org/archive/Week-of-Mon-20020520/112934.html] and the
link to my original message
[http://lists.evolt.org/archive/Week-of-Mon-20020520/112921.html] instead of
quoting them). I was trying to avoid using a surrogate key on tblResponses,
but I hadn't thought of not having a primary key. Instead, I added a UNIQUE
constraint on the question_id and respondent_id combination in tblResponses.
Since no other table will be referencing tblResponses and I wouldn't be
referencing a response_id in a WHERE clause, it should work. I did declare
question_id and respondent_id as foreign keys, for referential integrity in
SQL Server.

--Ben



More information about the thelist mailing list