title: How to get results count in SQL
body: <p>I have two tables:  </p>
  
  <pre><code>TB_Departament  
  (  
  id_dep, nome  
  1 , RRHH  
  2 , Security  
  3 , logistics  
  )  
  
  TB_Incident  
  (  
  id_tipo, id_dep  
  1 , 1  
  2 , 3  
  1 , 3  
  2 , 1  
  1 , 3  
  2 , 1  
  2 , 1  
  )  
  </code></pre>
  
  <p>If I count the <em>records department</em> get this:  </p>
  
  <pre><code>select d.nome, count(i.id_tipo) as Num from TB_Departament d, TB_Incident i 
  where i.id_dep = d.id_dep
  group by d.nome
  </code></pre>
  
  <p>resp:</p>
  
  <pre><code>RRHH 4  
  logistics 3  
  </code></pre>
  
  <p>but I need this:  </p>
  
  <pre><code>RRHH 4   
  Security 0  
  logistics 3  
  </code></pre>
  
  <p>How can i modify the query to get the right answer?</p>