| form_id | date_submitted |
|---|---|
| 1 | 10/08/22 |
| completer_id | name | signature | form_id |
|---|---|---|---|
| 1 | Tom | 38ehdsdj | 1 |
I have a digital form that is submitted and stored in my SQL database. There are two tables that are relevant to my question. The 'forms' table, which includes form_id and date_submitted (forget any form input data exists for this question). I also want to store the unique employee email of the person who submitted the form, and also the signature that they made on the form. If it was just their email, I'd just have another column within the forms table. However, the signature has to be collected for each form submission by that person (the whole point of a signature, to verify it). Since signature belongs to the person, I've created a second table called form_completers, with four columns: completer_id, name, signature, and form_id (foreign key to forms table). Since the form_completers table references the forms table, form_completers is the child. From my understanding, parents should be able to exist and make sense independent of children. If a forms_completer entry was to be removed, the data for the form would be incomplete, so in a way the parent (forms) is dependent on the child (forms_completer) in order for the form data to be complete. Am I thinking about this in the right way?
Delete the
form_idcolumn fromcompleters.Add a
completers_idcolumn toforms.A person can complete many forms, but a form has exactly 1 completer.