Q&A Database Schema

database-design

Need suggestions for a Q&A database design that I will use to interview small business owners. Below is a screenshot of the project and the tables that I came up with. Wanted to know which table should I add the introduction, video and audio urls to?

enter image description here

[People Table]
id
first_name
last_name
job_title
company
photo_url

[Questions Table]
id
question

[Answers Table]
id
person_id
question_id
answer
order_no

Best Answer

There are some details of your application that could change this model, but hopefully it's enough to get started.

Database model

Defining an Interviews entity is useful because you can store data that is associated with the Interview itself, for example when the interview happened and who the interviewer was.

There are three types of Interviews here: TextInterviews, VideoInterviews, and AudioInterviews. Since the question-answer pairs only apply to TextInterviews (assumption), the foreign key is to this table.

Each question has up to one answer (assumption). Because of this, the Questions and Answers could be combined into a QuestionAnswers table, although it doesn't have to.