title: count number of rows based on another table in sql server
body: <p>I have two tables - one for staff and another for their children.</p>
  
  <p>How can I group people on number of children?</p>
  
  <p>staff table</p>
  
  <pre><code>pID|name|family|ETC|  
  ---- |-------- |-------|-------|    
  123 |abc|ddd   | 134 | f |   
  124 |dfv |eee   | 900 | d |     
  126 |rgt |wwww|750|m|    
  </code></pre>
  
  <p><strong>children table</strong></p>
  
  <pre><code>pID|name|family|ETC|        
  ---- |-------- |-------|-------|    
  123 |mah|ddd |2005/06/09|son |    
  123 |dar|ddd |2013/11/01|girl|    
  123 |sia|ddd |2003/01/01|girl|    
  126 |naz|wwww|2007/25/01|girl|     
  </code></pre>
  
  <p><strong>Expected table</strong> </p>
  
  <pre><code>pID|no|        
  ----- |- |    
  123 |3|    
  124 |0|    
  126 |1|
  </code></pre>