title: JOIN 3 tables and COUNT for result
body: <p>I am using an a join query between three tables. My query doesn't display entirely my desired result. There are three tables <code>team</code>, <code>school</code> and <code>game</code>. For example, how can I display the total wins Lawrence North High School(<code>school_id = 11111</code>) has?</p>
  
  <p>Current query:</p>
  
  <pre><code>SELECT school.school_name 
  FROM school 
  INNER JOIN team ON school.school_id = team.school_id 
  INNER JOIN game ON team.team_id = game.game_id 
  WHERE school.school_id = 11111 
  </code></pre>
  
  <p>tables used:</p>
  
  <pre><code>SQL&gt; Select * From Team;
  
     TEAM_ID   SPORT_ID  SCHOOL_ID TEAM_NAME
  ---------- ---------- ---------- ----------
           1          1      11111 WildCats
           2          2      11111 WILDCATS
           3          3      11111 WildCats
           4          4      11111 WILDCATS
           5          5      11111 WildCats
           6          6      11111 WildCats
           7          7      11111 WildCats
           8          1     123134 Bears
           9          2     123134 Bears
          10          3     123134 BEARS
          11          4     123134 Bears
          12          5     123134 Bears
          13          6     123134 BEars
  
  SQL&gt; Select * From School;
  
   SCHOOL_ID SCHOOL_NAME                   SCHOOL_TYPE
  ---------- ----------------------------- ------------
       11546 Ivy Tech College              COLLegE
       11090 LAWRENCE Central Grade School GRADE SCHOOL
       11111 Lawrence NORTH High School    HIGH SCHooL
       19283 Howe High SCHOOL              High SchooL
      123134 Lawrence Central High School  HIGH SCHOOL
         192 Little Big Horn Grade School  GRADE SCHOOL
  
  
  SQL&gt; Select * From Game;
  
     TEAM_ID GAME_DATE R
  ---------- --------- -
           1 10-SEP-98 w
           1 12-SEP-98 W
           2 17-SEP-98 w
           2 18-SEP-98 W
           3 18-SEP-98 w
           3 11-SEP-98 W
           4 20-SEP-98 L
           4 21-SEP-98 l
           5 21-SEP-98 L
           5 19-SEP-98 l
           6 26-SEP-98 L
           6 27-SEP-98 W
           7 28-SEP-98 w
           7 29-SEP-98 W
           8 11-OCT-98 W
           8 12-OCT-98 w
           9 13-OCT-98 L
           9 14-OCT-98 L
          10 14-OCT-98 L
          11 15-OCT-98 L
          12 16-OCT-98 W
          13 17-OCT-98 W
          11 18-OCT-98 W
          12 19-OCT-98 W
          13 11-NOV-98
          11 12-NOV-98
  </code></pre>