title: Sql query to pull top 3 records with max votes in each category
body: <p>Need some help with putting this query together. I'm using Mysql</p>
  
  <p>I have two tables</p>
  
  <h2>Video - contains videos uploaded by users</h2>
  
  <ul>
  <li>video_id </li>
  <li>user_id </li>
  <li>category_id </li>
  </ul>
  
  <h2>Vote - contains a vote given by any user for a particular video</h2>
  
  <ul>
  <li>vote_id </li>
  <li>video_id </li>
  <li>user_id </li>
  </ul>
  
  <p>I don't want to hardcode the categories in the query - the Categories are stored in the Category table which has category_id and category_name</p>
  
  <p>I basically want a query that pulls the top 3 videos (ones with max votes) for each category.</p>
  
  <p>Sample Data - Video Table <br/></p>
  
  <pre>
  video_id |  user_id  | category_id
     1          100          10
     2          101          10
     3          102          11
     4          103          11
     5          104          11
     6          105          11
     7          105          12
  </pre> 
  
  <p>Sample Data - Vote Table <br/></p>
  
  <pre>
  vote_id  |  video_id |  user_id
    11           3          105
    12           3          102
    13           3          111
    14           3          121
    15           4          200
    16           4          201
    17           1          222
  </pre>
  
  <p>Sample Data - Category Table <br/></p>
  
  <pre>
  category_id  |  category_name
     10               HipHop
     11               Rap
     12               Country
  </pre>