title: Advantage of using Views in MySQL
body: <p>I've learned that views can be used to create custom "table views" (so to say) that aggregate related data from multiple tables.</p>
  
  <p>My question is: what are the advantages of views? Specifically, let's say I have two tables:</p>
  
  <pre><code>event | eid, typeid, name
  eventtype | typeid, max_team_members
  </code></pre>
  
  <p>Now I create a view:</p>
  
  <pre><code>eventdetails | event.eid, event.name, eventtype.max_team_members 
               | where event.typeid=eventtype.typeid
  </code></pre>
  
  <p>Now if I want to maximum number of members allowed in a team for some <code>event</code>, I could:</p>
  
  <ul>
  <li>use the view</li>
  <li>do a join query (or maybe a stored procedure).</li>
  </ul>
  
  <p>What would be my advantages/disadvantages in each method?</p>
  
  <p>Another query: if data in table events and eventtypes gets updated, is there any overhead involved in updating the data in the view (considering it caches resultant data)?</p>