SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Nov 2008
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to store multiple values of one attribute?

    I have a Users table which stores various characteristics about the users. For example basic stuff like age, sex, location, etc. These ofcourse hold single values which are easy to store. But I also have attributes that need to hold multiple choice values. It doesn't seem like good database design to store multiple comma separated values into one field. But it also seems counterintuitive to store the atributes with multiple choice values in a separate table. So what would be the correct solution?

  2. #2
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,274
    Mentioned
    60 Post(s)
    Tagged
    3 Thread(s)
    Quote Originally Posted by Botch View Post
    It doesn't seem like good database design to store multiple comma separated values into one field.
    it isn't

    Quote Originally Posted by Botch View Post
    But it also seems counterintuitive to store the atributes with multiple choice values in a separate table.
    i guess this depends on who is doing the intuiting

    this is actually the correct solution
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  3. #3
    SitePoint Member
    Join Date
    Nov 2008
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks! Guess I have to re-arrange some stuff hehe


Bookmarks

Posting Permissions

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