Database design. One-to-many or Many-to-many?
<p>In my application i need to assign multiple groups to my users. There are 1000+ users and 10-15 groups. </p>

<p>Which database design is better?</p>

<p>One-to-many: </p>

<pre><code>USER_ID | GROUP_1 | GROUP_2 | ... | GROUP_15
--------------------------------------------
 1      | true    | false   | ... | true
 2      | false   | true    | ... | true
 3      | true    | true    | ... | true
 .      | .       | .       | ... | . 
 .      | .       | .       | ... | . 
 .      | .       | .       | ... | . 
</code></pre>

<p>or many-to-many:</p>

<pre><code>USER_ID | GROUP_ID 
------------------
 1      | 1
 1      | 15
 2      | 2
 2      | 15
 3      | 1
 3      | 2
 3      | 15
 .      | .       
 .      | .       
 .      | .       
</code></pre>

<p>?</p>