Design Normalization

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bilibytes
    New Member
    • Jun 2008
    • 128

    #1

    Design Normalization

    Hi,

    I don't know what is the best design practice for this example:

    I have a table USERS with: id, name, ..., location_id
    and a table LOCATIONS: id, name

    what do you think is best:
    1. store the USERS and LOCATIONS relationship in a third table called User_to_Locatio n: user_id, location_id
    or
    2.leave it as it is with two tables and having the location_id in the USERS table?

    in the 1. option i should make two joins for querying
    in the 2. option i should make one join for querying

    but maybe the second is not a good design practice ? i don't know...

    Do you have any suggestion?

    Thank you very much
  • mwasif
    Recognized Expert Contributor
    • Jul 2006
    • 802

    #2
    Can a user belong to multiple locations? If not, keep the location_id in USERS table otherwise create a third table.

    Comment

    • bilibytes
      New Member
      • Jun 2008
      • 128

      #3
      Originally posted by mwasif
      Can a user belong to multiple locations? If not, keep the location_id in USERS table otherwise create a third table.
      Ok thank you very much!

      Comment

      Working...