Assume I use MySQL, and there are two tables,
parents_guardians table. Table
students is used to store students' data. The
parents_guardians table is used to store students' parents and students' guardians.
So either a student can have a father and a mother as his parents, or a student can have an uncle and an aunt as his guardians. To do that, I add one more table as pivot table, which is
This pivot table contains 3 columns:
The question is: Is this good design? And how can I do that in Laravel?
So far, I'm unable to do that. What I can do is create 5 table:
studentstable to store student's data
parentstable to store parents' data
students_parentsas pivot table to perform relationship between students and parents.
guardianstable to store guardian's data
students_guardiansas pivot table to perform relationship bwtween students and guardians.
I believe this is a bad idea, and I should normalize all of it.