views:

23

answers:

3

hi, i'm building a school portal and im stucked at analysis phase, the issue is :

in school portal there's a student profile and a parent profile, now the problem is how can i achieve a relationship between this two.Actually the scenario is "one dad can have multiple childrens studying in different school", now suppose "dad wants to look out the Result/Remarks of his all childrens" on what basis he can achieve that, this is my Question.

A: 
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.
Younes
@Younes, i agree this, but still i have 1 scenario, consider i have built the portal, now i will add schools into it after that i will add classes to schools..., now atlast i'll add children to classes, now at this time childrens table have null in parentID feild unless parents of that particular child have registered to my portal, now while registering how can he make sure that he is registering for his child only... my question may confuse you, if so please ping me back
FosterZ
I editted my answer to solve this.
Younes
@Younes, hm..i was having 2 solutions but they fail, that are:1: I'll have a unique ID for each child, by using that ID's, parent can register to his child, but the problem was parent can take a guess of random ID and register to an unknown child. so this solution fails.2:I'll send a request link to child's home-page in portal right after a parent register, so that child can make sure that the guy is my dad, by clicking that link. but the problem is, bratty children may never accept that link, if they don't want his parent to register, coz parent can check results..
FosterZ
A: 

The child should have a representation for who their father is.

Then retrieve based on that.

steve
Indeed... It shouldn't be too hard :P
Younes
+1  A: 

Child belongs to parent and school Parent has children School has children

To get the results he will have to be assigned children. He can claim 'ownership' of a child. An administrator in a school should be responsible for confirming or denying this, otherwise you have serious head aches.

steve