dbTalk Databases Forums  

Re: versioning system for sets of sets?

comp.databases comp.databases


Discuss Re: versioning system for sets of sets? in the comp.databases forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Philipp Post
 
Posts: n/a

Default Re: versioning system for sets of sets? - 04-26-2010 , 08:59 AM






Quote:
The rub I'm getting hung up on is guaranteeing that ChecklistAnswers
associates a proper question-and-answer pair -- the relationship
that
exists in the version of the Template that its Checklist parent is
referencing. <

I am not sure if I understand correctly, but I notice that you seem to
have "ID" in each table as a primary key what might cause problems to
you as you do not use DRI properly then.

Does this help?

CREATE TABLE TemplateQuestionAnswers
(question_id INT NOT NULL
REFERENCES Questions(question_id),
answer_id INT NOT NULL
REFERENCES Answers(answer_id),
-- I would throw out the ID and create a proper primary key:
PRIMARY KEY (question_id, answer_id));


CREATE TABLE ChecklistAnswers
(checklist_id INT NOT NULL,
question_id INT NOT NULL,
answer_id INT NOT NULL,
FOREIGN KEY (question_id, answer_id)
REFERENCES TemplateQuestionAnswers(question_id, answer_id),
PRIMARY KEY (checklist_id, question_id, answer_id));

brgds

Philipp Post

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.