title: MySQL join for two tables based on on column and excluding the values of another column
body: <p>I have two tables.</p>
  
  <ol>
  <li>Project table</li>
  <li>Project relationship table</li>
  </ol>
  
  <p>Project table contains all the project IDs and name</p>
  
  <pre><code>Id:1, name:project1
  Id:2, name:project2
  Id:3, name:project3
  Id:4, name:project4
  Id:5, name:project5
  Id:6, name:project6
  </code></pre>
  
  <p>Project relationship table contains parent-child relationship between all the project.</p>
  
  <pre><code>parent:1, child:2
  parent:1, child:3
  parent:4, child:5
  </code></pre>
  
  <p>Here parent and child refers to project IDs. I want a join query to get the list of only parent project along with their child-project count.</p>
  
  <p>Like this</p>
  
  <pre><code>Id:1, name:project1, count:2
  Id:4, name:project4, count:1
  Id:6, name:project6, count:0
  </code></pre>