Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2012
    Posts
    5

    Using one table as a legend for another...

    Hello,

    As part of my current project I need to build a number of tables built on groups or services.

    My plan is to have one table to act as a legend, if you like;

    Code:
    ID | GROUP
    1 TEAM1
    2 TEAM2
    3 TEAM3
    The idea being that users can then be append to any group within the first table (populated by "SELECT group FROM groups" etc). For example;

    Code:
    ID | USER | GROUP
    1 JOE TEAM1
    2 BOB TEAM2
    3 TED TEAM3
    4 WILL TEAM2
    5 ADAM TEAM1
    Is this the most efficient way of achieving this? I dont like having more tables than I really need to, but I cant think of any other ways.

    Any advice would be appreciated

    Thanks!

  2. #2
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    That is a classic M:M (Many-to-many) design.
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  3. #3
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Wait...can a user be in more than one team?
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

Posting Permissions

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