How to implement IF THEN logic in a database?

How to implement IF THEN logic in a database?

I have an app idea where I don't want the IF THEN logic coded in the app.  I instead was thinking that it would be easier to manage and change if it were in its own database.  Think of it like a conditional question and answer flow.  The answer to a particular question will lead you to a different question. 

In the table I was thinking: Question1 IF answer x THEN goto Question2 ELSE goto Question3.

Is this possible like this or does it need to be coded in the logic of the form?