title: Count the number of elements in sql server table
body: <p>I have 2 tables which looks like this:</p>
  
  <p><strong><em>ARTICLES TABLE:</em></strong>
  <img src="https://i.stack.imgur.com/8tm7t.jpg" alt=""></p>
  
  <p>and the output should look like this:</p>
  
  <p><img src="https://i.stack.imgur.com/Uhrhs.jpg" alt="enter image description here"></p>
  
  <p>How can I accomplish this using both sql query (i'm using sql server 2005) and using linq to sql query ?</p>
  
  <p>BTW i'm using sql server 2005, asp.net with c# in Visual studio 2008.</p>
  
  <p>Please help me</p>
  
  <p>Thanks in anticipation</p>