How do I build a user table with aggregated article data? I'm new to Drupal, and I want to make an overview over aggregated user data related to the articles they have written.

I basically want to build a table like this:

------------------------------------------------------
| user | articles published | articles with comments |
------------------------------------------------------
| bob  |                 12 |                      3 |
------------------------------------------------------
| sue  |                 34 |                      0 |
------------------------------------------------------
| kim  |                  0 |                      0 |
------------------------------------------------------


What is the best way to make a table like this? Is this something I need to make my own module for? 

Would it be possible to aggregate this with an existing module?
Welcome to the Drupal StackExchange !

You can achieve this with some custom php code and couple of queries.

&lt;?php

   $articles_publishers = db_query("SELECT DISTINCT u.uid FROM {node} n LEFT JOIN {users} u on n.uid = u.uid where n.type = 'article'");
   foreach ($articles_publishers as $articles_publisher) {
     $publisher = user_load($articles_publisher-&gt;uid);
     $username = theme('username', array('account' =&gt; $publisher));
     $articles_published = db_query("SELECT count(*) FROM {node} where uid = :uid and status = 1 and type='article'", array(':uid' =&gt; $articles_publisher-&gt;uid))-&gt;fetchField();
     $articles_published_with_comments = db_query("SELECT count(*) FROM {node} n INNER JOIN {comment} c ON n.nid = c.nid where n.uid = :uid and n.status = 1 and n.type='article'", array(':uid' =&gt; $articles_publisher-&gt;uid))-&gt;fetchField();

     // Theme the information with above results

     print "Username :" . $username;
     print "articles published :" . $articles_published;
     print "articles with comments :" .  $articles_published_with_comments;
   }

?&gt;


use above code in a module custom block or Add Block with php option to display the information.

Hope it helps.