title: Can't figure out a proper MySQL query
body: <p>I have a table with the following structure:</p>
  
  <pre><code>id | workerID | materialID | date | materialGathered
  </code></pre>
  
  <p>Different workers contribute different amounts of different material per day. A single worker can only contribute once a day, but not necessarily every day.</p>
  
  <p>What I need to do is to figure out which of them was the most productive and which of them was the least productive, while it is supposed to be measured as AVG() material gathered per day.</p>
  
  <p>I honestly have no idea how to do that, so I'll appreciate any help.</p>
  
  <p>EDIT1:</p>
  
  <p>Some sample data</p>
  
  <pre><code>1 | 1 | 2013-01-20 | 25
  2 | 1 | 2013-01-21 | 15
  3 | 1 | 2013-01-22 | 17
  4 | 1 | 2013-01-25 | 28
  5 | 2 | 2013-01-20 | 23
  6 | 2 | 2013-01-21 | 21
  7 | 3 | 2013-01-22 | 17
  8 | 3 | 2013-01-24 | 15
  9 | 3 | 2013-01-25 | 19
  </code></pre>
  
  <p>Doesn't really matter how the output looks, to be honest. Maybe a simple table like that:</p>
  
  <pre><code>workerID | avgMaterialGatheredPerDay
  </code></pre>
  
  <p>And I didn't really attempt anything because I literally have no idea, haha.</p>
  
  <p>EDIT2:</p>
  
  <p>Any time period that is in the table (from earliest to latest date in the table) is considered.</p>
  
  <p>Material doesn't matter at the moment. Only the arbitrary units in the materialGathered column matter.</p>