Parent --------------
| |
| |
CHILD CHILD has Parentid (foreign key) AND schoolid so u can bind child to parent and school
| |
| |
EXAM EXAM has id of Child (foreign key) so u can bind exam on child/student
| |
| |
RESULTS RESULTS has id of Exam (foreign key) so u can bind results to exam1...*
Try solving it like this. Every parent can have multiple childs. Childs can do exams, exams have results. You can now acces data by asking the childs of a parent.
Select C.name
From Child C, Parent P
Where C.parentid = 1
You'd know the id of the parent, so u can then just query the Childs on that id.
Like this a Child record will know who the parent is.
When you want to add up the option to put a Child on a school, and parent can have 1...* childs on different schools:
Table: Child has schoolid (fk).
- Parent registers to your system. Parent has in ID now.
- Parent can register multiple children with different id's aswell.
- Children can be registered for a school.
- Children can take different exams with results.