title: Should I use a many-to-many or one table with boolean flags in this situation?
body: <p>I have a <code>properties</code> table and each <code>property</code> can have many <code>amenities</code>.</p>
  
  <p>Examples of <code>amenities</code> are "hasTerrace", "hasGarden" and "hasPrivateParking". <strong>There are about 50 amenities</strong>.</p>
  
  <p>The list of <code>amenities</code> is unlikely to change in the future. I see two options:</p>
  
  <ol>
  <li>Add boolean flags to the <code>properties</code> table for the 50 or so fields such as "hasTerrace".</li>
  <li>Create separate tables called <code>amenities</code> and <code>property_amenity</code> and have a <code>many-to-many</code> relationship.</li>
  </ol>
  
  <p>A typical use case would be querying for all properties that have any given number of amenities.</p>
  
  <p>I am inclined to keep everything in one table and use booleans because:</p>
  
  <ol>
  <li>The list of amenities is unlikely to change.</li>
  <li>I think that my queries will be faster (probably a crap reason given all of the db tweaking that could be done).</li>
  <li>My queries will be simpler.</li>
  <li>I will write less code and that code will be less complex.</li>
  </ol>
  
  <p><strong>However</strong>, having 60 or so fields in a table seems a quite high.</p>
  
  <p><strong>Which would be the best database design for the above problem?</strong></p>