I am making an application where I have to ask questions and depending on answers given, I have to ask other questions until the end of the process.
Example: Next question depends on A1
Scenario 1:
Q1: Are you married ? Y / N
A1: Y
Q2: Enter the date of marriage? ...
Scenario 2:
A1: N
Q2: Do you intend to get married? Y/N
A2: Y
Q3: In which country you like to get married? 1.USA 2.Canada 3.Others ...
End scenarios
Questions can be simple Yes/No, input value, Selection from multiple choices
How do I save these in a database together with the flow control of questions and answers?