Data modeling.

vshah804 1 Reputation point
2021-03-04T21:56:02.497+00:00

Hello Team,

We have to conditionally show the questions based on the selection made.

E.X :

  1. choices X,Y,X - Select one
  2. choices A,B,C,D,E,F - Can select multiple

So depending upon #1 and #2 selection, we have to show the set of questions. Can someone give some idea how the data model should look like?

Thanks.

Azure SQL Database
{count} votes

1 answer

Sort by: Most helpful
  1. Alberto Morillo 33,956 Reputation points MVP
    2021-03-05T18:56:03.217+00:00

    Let me know if the following tables satisfy your requirements:

    • Table SelectionCategoryChoice (SelectionCategoryId [PK], Description)
    • Table SecondChoices (SelectSecondChoiceId [PK], Description)
    • Table Questionares (SelectionCategoryId [PK][FK, SelectSecondChoiceId [PK][FK], QuestionId [PK][FK])
    • Table Questions (QuestionId [PK], question, CorrectPossibleAnswerId[FK])
    • Table QuestionsPosiibleAnswers(QuestionId [PK][FK], PossibleAnswerId [PK][FK])
    • PossibleAnswers(PossibleAnswerId [PK], AnswerDisplayed)

    I added answers to questions also, despite you did no ask for them. Maybe you find it useful.

    PK = Primary Key
    FK = Foreign Key

    1 person found this answer helpful.
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.