SQL:
SELECT g.name, g.id, count(*) FROM news_items AS n LEFT JOIN news_groups AS g ON (n.group_id = g.id) GROUP BY name, id