title: SQL - show all rows in table using group by and where
body: <p>I have the following problem: I should print the count of sunk ships of all countries. So I write the following:</p>
  
  <pre><code>use ships;
  
  select CLASSES.CLASS, COUNT(*)
  from CLASSES
  left join SHIPS on CLASSES.CLASS = SHIPS.CLASS
  left join OUTCOMES on NAME = SHIP
  where RESULT = 'sunk'
  group by CLASSES.CLASS;
  </code></pre>
  
  <p>but if some country doesn't have a sunk ship it will not appear in result. But I want every country to be in the result and if it doesn't have sunk ships to shop 0 for count.
  How can I achieve that?
  Thanks in advance.</p>