Average rating from SQL database survey data <p>I've been trying to return the average rating of an organizer based on ratings from a table with survey data (targetting one column).</p> <pre><code>Table: Workshops Cols: id[pk] | title | description | survey_id[fk] | organizer_id[fk] Table: Organizers Cols: organizer_id[pk] | organizer_name | organizer_email | organizer_rating Table: Surveys Cols: survey_id[pk] | survey_desc | survey </code></pre> <p>And the table with user responses is as follows:</p> <pre><code>Table: SurveyUserResponse Cols: s_u_r_id[pk] | username | survey_id[fk] | answer_1 | answer_2 | answer_3 </code></pre> <p>Answer 3 is essentially the speaker's rating. I attempted to select the average rating on answer 3 and joining it with workshops based on organizer ID but it does not return the right average for an organizer. </p> <p>This has got me quite stumped and I am unsure how to get the rating into the organizer rating column of the ratings table.</p> <p>Any help would be greatly appreciated.</p> <p><strong>EDIT:</strong></p> <p>Thank you for the advice Eduard. As per your suggestion, this is an example record:</p> <pre><code>Table: Workshops id | title | description | survey_id | organizer_id --------------------------------------------------- 1 | ws01 | on pottery | 1 | 1 Table: Organizers organizer_id | organizer_name | organizer_email | organizer_rating ----------------------------------------------------------------------- 1 | Ray Dion | r.dion@ws01.com | &lt;trying to get result here&gt; Table : Surveys survey_id | survey_desc | survey --------------------------------- 1 | ws01 survey | test Table: SurveyUserResponse s_u_r_id | username | survey_id | answer_1 | answer_2 | answer_3 ----------------------------------------------------------------- 114 | joe21331 | 1 | 4 | 5 | 3 </code></pre> <p>This is what I came up with so far just to test if a proper data set is returned:</p> <pre><code> SELECT Organizers.organizer_id, Organizers.organizer_name, AVG(survey_user_response.answer_value_3) AS organizer_rating FROM Organizers, survey_user_response INNER JOIN Workshops organizer_id ON Workshops.organizer_id = Organizers.organizer_id ORDER BY organizer_rating DESC </code></pre>