开发者

problem in analysis phase for building shcool portal

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.


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.


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

Then retrieve based on that.


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.
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜