title: Finding an average SQL
body: <p>im trying to create an average on a rating.</p>
  
  <p>i have tried the AVG(column_name).  however the problem with this is it does a total for all the ratings and gives the average.</p>
  
  <pre><code>Select Company.company_id, company.Company_Name, avg(UserJobRating.Total_Rating)
  from company
  inner join UserJobRating on Job_id = UserJobRating.Job_ID
  inner join jobs on jobs.Company_id = company.company_id
  group by company.company_id
  </code></pre>
  
  <p>what i want is say for example, a spefic company has 10/15 jobs each with a job rating. i want it to group together the jobs specific to that company and give an average rating for the company over all their jobs.</p>
  
  <p>what type of select would i need to do in order to do this?</p>