title: using where and inner join in mysql
body: <p>I have three tables.</p>
  
  <p><strong>locations</strong></p>
  
  <pre><code>ID   | NAME | TYPE |
  1    | add1 | stat |
  2    | add2 | coun | 
  3    | add3 | coun |
  4    | add4 | coun | 
  5    | add5 | stat | 
  </code></pre>
  
  <p><strong>schools</strong></p>
  
  <pre><code> ID | NAME  
   1  | sch1     
   2  | sch2
   3  |sch3 
  </code></pre>
  
  <p><strong>school_locations</strong></p>
  
  <pre><code> ID |LOCATIONS_ID |SCHOOL_ID
   1  | 1           |1
   2  | 2           |2
   3  | 3           |3
  </code></pre>
  
  <p>Here the table locations contains all the locations of the application.Locations for school are called by ID's.</p>
  
  <p>when i use the query</p>
  
  <pre><code>select locations.name from locations where type="coun";
  </code></pre>
  
  <p>it displays names with type "coun"</p>
  
  <p>But I want to display locations.name where only school_locations have type="coun"</p>
  
  <p>i tried following queries, but none seems to be working</p>
  
  <pre><code>select locations.name 
  from locations 
  where type="coun" 
  inner join school_locations 
     on locations.id=school_locations.location_id 
  inner join schools 
     on school_locations.school.id=schools.id;
  </code></pre>
  
  <p>and</p>
  
  <pre><code>select locations.name 
  from locations 
  inner join school_locations 
     on locations.id=school_locations.location_id 
  inner join schools 
     on school_locations.school.id=schools.id  where type="coun";
  </code></pre>
  
  <p>is it possible to use multiple inner joins in queries, or is there another way?</p>