1
Good afternoon.
I have three tables: tbl_students, tbl_financial responsibility, tbl_responsavel_pedagogico.
The idea is that a student has a financial manager and a teacher.
But there are three situations:
A) A student can be responsible for himself, both financially and pedagogically.
B) A single person may be responsible for a student, both financially and pedagogically.
C) A parent may be responsible for more than one student (in the case of a parent and several children).
So I’m not able to assemble the structure in a way that is coherent. For example:
In situation A, I end up having to create the data in the student table and repeat the same data in the other tables. For the student is responsible for himself.
In situation B, I have to create the same data in the tables of financial and pedagogical responsible. For the same person plays the role of the two responsible.
The way I thought (creating tbl_students with foreign keys of tbl_responsavel_financial tables and tbl_responsavel_pedagogico, is not good). So we assume that there may be a student with 0, 1 or more responsible.
But considering that there is no student without responsibility, it would completely change the relationships that I created.
How I could create the tables and relationships, but attending the three situations, without repeating information and that is coherent?
From what I understand, that would solve the problem of the student being responsible himself. But and for cases where student, financial officer and pedagogical officer are different people?
– bur
saved as edit to get better, an example @Bur
– arllondias
Wonderful! It fell like a glove. This way (from what I understand, self relationship) makes perfect sense. I will insert the rest of the fields and proceed. Thank you!
– bur
That’s right, you’re welcome!
– arllondias