Here is an example of what I have (take Stack Overflow). I have 2 tables, Questions
and Answers
. I also have a Comments
table. The Comments table will reference both Questions and Answers.
How should I set up the database? Have 2 columns in Comments, a QuestionId and AnswerId. Have one table for both Questions and Answers? Have a table in between that somehow tells me Question or Answer?
EDIT: Found the SO Data explorer, it uses one table for both Questions and Answers ... I just don't like the POSTS
table having so many NULLS in it. Does that have any negative effects, like on performance?