Skip to content
Advertisement

List all teams and the average raw scores for all members

My query is giving all the teams the exact same average player score. When each team would should have their own average score based on their team members.

select Teams.TeamName, avg(Bowler_Scores.RawScore) AvgPlyrScore
from Teams
join Bowlers on Teams.TeamID = Teams.TeamID
join Bowler_Scores on Bowlers.BowlerID = Bowler_Scores.BowlerID
group by Teams.TeamName;

enter image description here

Advertisement

Answer

Looks like your join should be

join Bowlers on Bowlers.TeamID = Teams.TeamID
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement