A
Alex
Hello everybody,
I created a survey questions table with the following fields:
SurvID
QstnID
QstnText
QstnCtrlType
AnswCtrlType
QstnType
Grp1ID
Grp2ID
Grp3ID
PageID
PageType
OrderByID
The Group fields imply that each question can belong to a max three
independent groups.
So, I’ve created another table for Groups with the following fields:
SurvID
QstnID
Grp1ID
Grp1Name
Grp1Vis
Grp2ID
Grp2Name
Grp2Vis
Grp3ID
Grp3Name
Grp3Vis
QstnID is identity incremental field so it’s unique without having SurveyID
to be primary key as well. But we need SurveyID for making tables join
connections.
The number of questions and the questions themselves are different per survey.
The questions’ grouping per survey can be different as well. So, the
separate table with only groups without SurveyID won’t work.
My question is how to link those two tables.
Will it work:
Questions.SurveyID -> Groups.SurveyID
Questions.Grp1ID -> Groups.Grp1ID
Questions.Grp2ID -> Groups.Grp2ID
Questions.Grp3ID -> Groups.Grp3ID
Or it’s needed to be three instances of the table Groups to be linked to
the Questions table: Groups as A, Groups As B, and Groups As C:
Questions.SurveyID -> A.SurveyID
Questions.Grp1ID -> A.Grp1ID
Questions.SurveyID -> A.SurveyID
Questions.Grp2ID -> B.Grp2ID
Questions.SurveyID -> A.SurveyID
Questions.Grp3ID -> C.Grp3ID
Or it should be something else?
What would be the better practice here?
Thanks
I created a survey questions table with the following fields:
SurvID
QstnID
QstnText
QstnCtrlType
AnswCtrlType
QstnType
Grp1ID
Grp2ID
Grp3ID
PageID
PageType
OrderByID
The Group fields imply that each question can belong to a max three
independent groups.
So, I’ve created another table for Groups with the following fields:
SurvID
QstnID
Grp1ID
Grp1Name
Grp1Vis
Grp2ID
Grp2Name
Grp2Vis
Grp3ID
Grp3Name
Grp3Vis
QstnID is identity incremental field so it’s unique without having SurveyID
to be primary key as well. But we need SurveyID for making tables join
connections.
The number of questions and the questions themselves are different per survey.
The questions’ grouping per survey can be different as well. So, the
separate table with only groups without SurveyID won’t work.
My question is how to link those two tables.
Will it work:
Questions.SurveyID -> Groups.SurveyID
Questions.Grp1ID -> Groups.Grp1ID
Questions.Grp2ID -> Groups.Grp2ID
Questions.Grp3ID -> Groups.Grp3ID
Or it’s needed to be three instances of the table Groups to be linked to
the Questions table: Groups as A, Groups As B, and Groups As C:
Questions.SurveyID -> A.SurveyID
Questions.Grp1ID -> A.Grp1ID
Questions.SurveyID -> A.SurveyID
Questions.Grp2ID -> B.Grp2ID
Questions.SurveyID -> A.SurveyID
Questions.Grp3ID -> C.Grp3ID
Or it should be something else?
What would be the better practice here?
Thanks