title: SQL GROUP BY VS individually selecting data
body: <p>I have a sports database with table of players and then table of goals and penalties. Each goal has a scorer (player_id), time_scored, period, match, etc. The same goes for penalties (and other stats).</p>
  <p>Now I want to show my data in datagrid. It is a table of players which could be filtered and sorted. There will be players listed with theirs stats (goals count, penalty minutes summed, etc.).</p>
  <p>I am currently doing it like this, I select all the players from
  database, then in C# I iterate over them and for each I run queries to count theirs goals (COUNT goals WHERE player_id = p.id), penalties, etc.</p>
  <p>I wonder, will the GROUP BY statement be faster? How is it implemented? So I will group players and for each select goals count and so on. Or is there even a better way?</p>