title: What is the best way to design a database to store record with a lot of values?
body: <p>I want to design a database for events and track a lot of statistic about the it.</p>
  
  <p><strong>Option 1</strong></p>
  
  <p>Create one table for <code>Events</code> and put all my statistic column in it.  Like number of male, number of female, number of unidentified gender,  temperature that day, time it started, any fights, was the police called, and etc.</p>
  
  <p>The query would be a very simple <code>select * from events</code></p>
  
  <p><strong>Option 2</strong></p>
  
  <p>Create two tables, one for <code>Events</code> and one for <code>EventsAttributes</code>.  In the <code>Events</code> table I would store important stuff like id, event title, and start/end time.</p>
  
  <p>In <code>EventsAttributes</code> I would store all the event statistic and link them back to <code>Events</code> with a <code>eventId</code> foreign key.</p>
  
  <p>The query would look like below. (<code>attributeType == 1</code> would represent number of males)</p>
  
  <p><code>select e.*, 
  (select ev.value from EventAttributes ev where ev.eventId = e.id and attributeType = 1) as NumberOfMale
  from Events e
  </code></p>
  
  <p>The query would be not be as straight forward as option 1, but I want to design it the right way and live with the messy query.</p>
  
  <p>So which option is the right way to do it, and why (I'm not a database admin, but curious).</p>
  
  <p>Thank you for your time.</p>