title: Multivalued attributes in Relational databases?
body: <p>How well an idea are multi-valued attributes in a relational database when they are to be referred extensively?</p>
  
  <p>Let me give you an example to show what I mean. Suppose I have the following table:</p>
  
  <pre><code>UserID          Attribute1
  
  User1           a,b,c
  User2           x,y,z
  User3           a,x,y
  User4           c,b,z
  [a,b,c,x,y,z are to be strings]
  </code></pre>
  
  <p>There is another user <code>User5</code> to whom I have to make some suggestions about other users based on whether his <code>Attribute1</code> matches any one of other 4 users or not.</p>
  
  <p><em>[In graph databases, the task could have been much easier as I could have created multiple nodes from the respective users using the same relationship.]</em></p>
  
  <p>Now, this table is just a micro-level abstraction of what an actual database will look like. The number of rows in a table may run into hundreds of thousands, if not millions. Also, the multiple values may actually be a lot more than 3. Apart from this, the database can be under heavy load, and in that situation, there may be some issues.</p>
  
  <p>So, are multi-valued attributes helpful in such cases? Or is there any better way of doing the same? One obvious way I can think of is to store it as:</p>
  
  <pre><code>UserID          Attribute1
  
  User1           a
  User1           b
  User1           c
  User2           x
  User2           y
  User2           z
  User3           a
  User3           x
  User3           y
  User4           c
  User4           b
  User4           z
  </code></pre>
  
  <p>Any faster way of dealing such situations in databases? Or are there any built-in features of modern-day databases to exploit?</p>