Results 1 to 2 of 2

Thread: Design Question

  1. #1
    Join Date
    Oct 2003
    Posts
    3

    Smile Design Question

    I have a question concerning setting up tables. I'm wondering why I would set up the tables in one way rather than the other way.

    Example 1:

    Users Roles Group
    ------ ------ -------
    pk)UserID pk)UserID pk)GroupID
    UserName pk)GroupID GroupName
    Password

    Example 2:

    Users Group
    ------
    pk)UserID pk)GroupID
    UserName UserID
    Password GroupName

    Which one of these designs would be most efficient and why?
    Can someone help me on this one.

    Thanks,
    DW

  2. #2
    Join Date
    Sep 2002
    Location
    UK
    Posts
    5,171

    Re: Design Question

    Example 2 doesn't seem to make sense to me: each group can only have 1 user in it? But if you meant to make UserID part of a composite PK with GroupID, then it still isn't good because GroupName is then denormalised.

    So Example 1 is the way to go.

Posting Permissions

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