Relationship Database

3

I am doubtful about the Relationship in the following case: I have the Question table and the Answer table. 1 Question can have N Answers. 1 Answer may be for N Questions. It can be said that the relation is N: N? If yes, how is the 3rd table, the relationship table between the two?

    
asked by anonymous 03.05.2017 / 22:18

1 answer

5

Yes, "N: N".

Simply a table with 3 fields: id, question_id, answer_id - and preferably everything should be an index, so that you can do the two-way search.

Depending on how you are using it, you will not need the "id" column.

    
03.05.2017 / 22:24