This is a discussion on Database design with unknown number of parent/children within the MySQL Database forums, part of the Database Forums category; Hi, I'm having a question about a database design. I'm having objects which have a parent-child relationship. ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Hi,
I'm having a question about a database design. I'm having objects which have a parent-child relationship. E.g.: obj_a is parent of obj_b, objc is parent of obj_d which is parent of obj_e Parent | Child -------------------- obj_a | obj_b obj_c | obj_d obj_d | obj_e My question now is how do you design a database that can take care of this n-number of parent-children relationships and how do you query this information in a dynamical way? I should not know upfront how many parent-children relationships there are for a certain object. Thankx in advance. Pieter |
|
|||
|
On 18 Jan, 09:32, pieter.th...@gmail.com wrote:
> Hi, > > I'm having a question about a database design. I'm having objects > which have a parent-child relationship. > > E.g.: obj_a is parent of obj_b, objc is parent of obj_d which is > parent of obj_e > > Parent | Child > -------------------- > obj_a | obj_b > obj_c | obj_d > obj_d | obj_e > > My question now is how do you design a database that can take care of > this n-number of parent-children relationships and how do you query > this information in a dynamical way? I should not know upfront how > many parent-children relationships there are for a certain object. > > Thankx in advance. > > Pieter read the links on this page http://del.icio.us/Captain_Paralytic/hierarchical they reveal all (the last one in the list is particularly good) |
|
|||
|
On Jan 18, 10:51 am, Captain Paralytic <paul_laut...@yahoo.com> wrote:
> On 18 Jan, 09:32, pieter.th...@gmail.com wrote: > > > > > Hi, > > > I'm having a question about a database design. I'm having objects > > which have a parent-child relationship. > > > E.g.: obj_a is parent of obj_b, objc is parent of obj_d which is > > parent of obj_e > > > Parent | Child > > -------------------- > > obj_a | obj_b > > obj_c | obj_d > > obj_d | obj_e > > > My question now is how do you design a database that can take care of > > this n-number of parent-children relationships and how do you query > > this information in a dynamical way? I should not know upfront how > > many parent-children relationships there are for a certain object. > > > Thankx in advance. > > > Pieter > > read the links on this pagehttp://del.icio.us/Captain_Paralytic/hierarchical > they reveal all (the last one in the list is particularly good) Thanks for your suggestion! |