简体   繁体   中英

Database Design for a survey system

I'm currently trying to design a database for a survey system but I'm having trouble. The concept of the system is to collect & store survey responses from employees that complete the survey. The survey will be sent to the employee's email and from there the employee will complete the survey and their response will be stored. Higher ups for the company will then be able to view the responses. If no response is recorded within a week of the survey being sent, the system will send a reminder to the employee to complete the survey.

The tables I have so far are Employee, Survey, Questions, Responses, and Reminder.

My main issue is that I'm not sure how or where to connect the reminder table.

few ways to do it, subject to how you want to send out the reminder.

if reminder is sent based on survey (regardless if the employee has answered it before), you can just link to survey_id.

if you want to target by employee by survey, you may store both employee_id and survey_id in the reminder table. thus, the reminder will only send to the particular employee who doesn't complete the survey

That depends on the requirements. If you will only send one reminder, then you don't need a separate table. Just put a "sent reminder flag" in the Survey table. Or maybe "sent reminder date" if you care when you sent it.

If you may send multiple reminders, and you want to keep track of reminders that you have sent, then you need a many-to-one relationship from Reminder to Survey, ie put a survey id into the reminder table. I'm assuming that you send a reminder for a survey, not for individual questions, and that if there are multiple surveys, you might send a reminder for each survey.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM