title: Implementing a simple review database/application scheme
body: <p>I'm new to web development and database design, and I'm kind of stumped as how to best accomplish a simple review system for items.  </p>
  
  <p>In the current database schema I have a table, call it <code>tbl_item</code>, that has columns for different properties of items. I want users to be able to review items and associate each review in the <code>tbl_reviews</code> to a particular item. </p>
  
  <p>Of course I have a foreign key set up referencing an id column in <code>tbl_item</code> but I do not know where to go from here. Basically my question is: What should calculate the review average? </p>
  
  <p>Should the application make a SQL call every time a review score is requested for a particular item, where the DB would have to then search through all the <code>tbl_reviews</code> rows to find those with a particular <code>item_id</code>? </p>
  
  <p>(That seems wrong.) Should the DB get involved and have some type of calculated field or view or stored procedure that does the same? </p>
  
  <p>Should I have a new column in <code>tbl_item</code> that has the average score in it and is updated whenever any new review corresponding to a particular item is CRUD'ded? </p>
  
  <p>If it matters, I'm using Yii (PHP) and MySQL.</p>