Can a table be both parent and child to another table? Newsdatabase with comments

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Smitche88
    New Member
    • Dec 2012
    • 1

    Can a table be both parent and child to another table? Newsdatabase with comments

    I'm writing a school project where i have the following three tables:

    users_tbl (t1), news_tbl (t2) and comments_tbl (t3).

    news_tbl contains a foreign key(username) to users_tbl, and comments_tbl containes a foreign key (news_id) to news_tbl.

    I'm not sure if t1 or t2 is the parent table and the two others is child tables, in case which one is it then?

    Or if t1 and t2 is both parent and child tables to each other?
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    users is the "parent" of news. news is the "parent" of comments.

    Comment

    Working...