Can a table be both parent and child to another table.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • user1980
    New Member
    • Dec 2009
    • 112

    Can a table be both parent and child to another table.

    hi there,

    Can someone please clear this for me with an example. Can one table, say T1, be parent to another table, say T2, and also be the child of T2 at the same time.

    to be more clear, T1 is parent of T2 and T1 is child of T2.
    is this possible, if so can you please give me a an example.

    thank you for your time
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    Parent and child are terms used to describe a hierarchical relationship. They are not properties of a table but rather descriptors of a particular way of laying out data.

    What is the purpose of this question?

    Comment

    • user1980
      New Member
      • Dec 2009
      • 112

      #3
      to elaborate my question, I have a primary key in T1 which is foreign key in T2 and similarly a priamry key in T2 is a foreign key for T1. is this possible? if so what would be the parent table in this relationship?

      this was asked in an interview.thank you

      Comment

      • Rabbit
        Recognized Expert MVP
        • Jan 2007
        • 12517

        #4
        It's certainly possible to create such a relationship but I don't see why someone would need to implement something like this.

        Which table would be considered the parent table in such a relationship, or whether a parent/child relationship is the correct term for this layout will always depend on what kind of data you're looking at. In a vacuum, none of them are parent tables and none of them are child tables. It is only with context that the labels parent and child can be applied.

        Comment

        Working...