Results 1 to 4 of 4

Thread: What additional tables are required for parents/kids

  1. #1

    Thread Starter
    PowerPoster Nitesh's Avatar
    Join Date
    Mar 2007
    Location
    Death Valley
    Posts
    2,556

    What additional tables are required for parents/kids

    Hi Guys,

    I have a shopping website. There is a user table(userid, password, name) etc. The client now wants each user to have a profile where they can add their kids.
    What other tables do I need to make this work?

  2. #2
    Super Moderator FunkyDexter's Avatar
    Join Date
    Apr 2005
    Location
    An obscure body in the SK system. The inhabitants call it Earth
    Posts
    7,957

    Re: What additional tables are required for parents/kids

    By the sound of things you just needs a Kid table with a foreign key to User.
    The best argument against democracy is a five minute conversation with the average voter - Winston Churchill

    Hadoop actually sounds more like the way they greet each other in Yorkshire - Inferrd

  3. #3
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: What additional tables are required for parents/kids

    or use the same table... with ParentID as an FKey back to itself. Then you could have a Type field that indicates if it's a Parent (0) or a child (1) record.... actually, you don't even need that... if the ParentID is 0 or NULL then it's a parent record... if it has a value, then you know it's a kid record.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  4. #4
    Super Moderator FunkyDexter's Avatar
    Join Date
    Apr 2005
    Location
    An obscure body in the SK system. The inhabitants call it Earth
    Posts
    7,957

    Re: What additional tables are required for parents/kids

    or use the same table
    Actually that's probably a better idea than mine. Apart from anything it'll let you recurse through a whole chain of kids, grand-kids, great grand kids etc.

    About the only argument I could come up with against TG's aproach would be if kids AREN'T users, in which case you probably need to separate the concept of a person from a user. After all, it's a person that has kids, not a user.
    The best argument against democracy is a five minute conversation with the average voter - Winston Churchill

    Hadoop actually sounds more like the way they greet each other in Yorkshire - Inferrd

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width